mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #248 from BigRoy/enhancement/maya_validate_no_null_transform_optimize
Maya: optimize validate no null transform
This commit is contained in:
commit
3c6deff87f
1 changed files with 5 additions and 10 deletions
|
|
@ -19,22 +19,17 @@ def _as_report_list(values, prefix="- ", suffix="\n"):
|
|||
|
||||
def has_shape_children(node):
|
||||
# Check if any descendants
|
||||
allDescendents = cmds.listRelatives(node,
|
||||
allDescendents=True,
|
||||
fullPath=True)
|
||||
if not allDescendents:
|
||||
all_descendents = cmds.listRelatives(node,
|
||||
allDescendents=True,
|
||||
fullPath=True)
|
||||
if not all_descendents:
|
||||
return False
|
||||
|
||||
# Check if there are any shapes at all
|
||||
shapes = cmds.ls(allDescendents, shapes=True)
|
||||
shapes = cmds.ls(all_descendents, 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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue