Optimize logic

This commit is contained in:
Roy Nieterau 2024-03-26 10:11:47 +01:00
parent d214f51dc5
commit 248265d5eb

View file

@ -26,15 +26,10 @@ def has_shape_children(node):
return False
# Check if there are any shapes at all
shapes = cmds.ls(allDescendents, shapes=True)
shapes = cmds.ls(allDescendents, shapes=True, noIntermediate=True)
if not shapes:
return False
# Check if all descendent shapes are intermediateObjects;
# if so we consider this node a null node and return False.
if all(cmds.getAttr('{0}.intermediateObject'.format(x)) for x in shapes):
return False
return True