diff --git a/docs/nodes/list_masks/mask_join.rst b/docs/nodes/list_masks/mask_join.rst index 2cab98d1523cf8c2d6a9462c6e1b63e0effa351f..c0537e8867578a466ee463d6d2d0a0679a77127e 100644 --- a/docs/nodes/list_masks/mask_join.rst +++ b/docs/nodes/list_masks/mask_join.rst @@ -42,7 +42,7 @@ In the N-Panel (and on the right-click menu) you can find: Outputs ------- -* **Data:** Mixed data of the incoming data, the length of Outputs depends on the **Data True**, **Data False** and **Mask** list lengths. +* **Data:** Mixed data of the incoming data, the length of Outputs depends on the **Data True**, **Data False** and **Mask** list lengths. If, at the choice level, the node encounters true and false input lists simultaneously empty, the corresponding output is an empty list. If only one of the two is empty, then values chosen from the other by the mask are replaced by None. Example ------- diff --git a/nodes/list_masks/mask_join.py b/nodes/list_masks/mask_join.py index 3176a1ca1efa52cb4927b576529ab1fb0beea26e..a49f42e2a646c4e5760b46caa0991f0194f768b3 100644 --- a/nodes/list_masks/mask_join.py +++ b/nodes/list_masks/mask_join.py @@ -80,7 +80,12 @@ class SvMaskJoinNodeMK2(bpy.types.Node, SverchCustomTreeNode): def apply_choice_mask(self, mask, data_t, data_f): out = [] - param = list_match_func[self.list_match_global]([mask, data_t, data_f]) + if len(data_t) == 0: + data_t = [None] * len(data_f) + elif len(data_f) == 0: + data_f = [None] * len(data_t) + + param = list_match_func[self.list_match_global]([mask, data_t, data_f]) for m, t, f in zip(*param): if m: out.append(t)