option for include children
This commit is contained in:
parent
a1f10e67e5
commit
b5259e107d
1 changed files with 8 additions and 1 deletions
|
|
@ -377,17 +377,24 @@ class SLICENODE_IntMath(MathNode):
|
||||||
class SLICENODE_GetMesh(SliceNode):
|
class SLICENODE_GetMesh(SliceNode):
|
||||||
bl_label = "Get Mesh"
|
bl_label = "Get Mesh"
|
||||||
|
|
||||||
|
include_children: NfBoolProperty(name="Include Children", default=True) # pyright: ignore[reportInvalidTypeForm]
|
||||||
|
|
||||||
def init(self, context):
|
def init(self, context):
|
||||||
self.add_input("SLICESOCK_Object")
|
self.add_input("SLICESOCK_Object")
|
||||||
self.add_output("SLICESOCK_Mesh")
|
self.add_output("SLICESOCK_Mesh")
|
||||||
|
|
||||||
|
def draw_buttons(self, context, layout):
|
||||||
|
assert layout
|
||||||
|
layout.prop(self, "include_children")
|
||||||
|
|
||||||
def evaluate_output(self, socket_name: str, **_kwargs) -> SlicingCollection | None:
|
def evaluate_output(self, socket_name: str, **_kwargs) -> SlicingCollection | None:
|
||||||
if socket_name != "Mesh": return None
|
if socket_name != "Mesh": return None
|
||||||
|
|
||||||
obj: Any = self.resolve("Object")
|
obj: Any = self.resolve("Object")
|
||||||
if not obj: return None
|
if not obj: return None
|
||||||
|
|
||||||
family = [obj] + get_all_children(obj)
|
family = [obj] + (get_all_children(obj) if self.include_children else [])
|
||||||
|
|
||||||
sc: SlicingCollection = SlicingCollection(family, obj.name)
|
sc: SlicingCollection = SlicingCollection(family, obj.name)
|
||||||
|
|
||||||
return sc
|
return sc
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue