mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Ensure rig controls_SET and out_SET have at least any members
This commit is contained in:
parent
47c60ed1d3
commit
2907a47766
1 changed files with 12 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ class ValidateRigContents(pyblish.api.InstancePlugin):
|
|||
|
||||
Every rig must contain at least two object sets:
|
||||
"controls_SET" - Set of all animatable controls
|
||||
"pointcache_SET" - Set of all cachable meshes
|
||||
"out_SET" - Set of all cachable meshes
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ class ValidateRigContents(pyblish.api.InstancePlugin):
|
|||
|
||||
from maya import cmds
|
||||
|
||||
objsets = ("controls_SET", "pointcache_SET")
|
||||
objsets = ("controls_SET", "out_SET")
|
||||
|
||||
missing = list()
|
||||
for objset in objsets:
|
||||
|
|
@ -40,7 +40,15 @@ class ValidateRigContents(pyblish.api.InstancePlugin):
|
|||
|
||||
self.log.info("Evaluating contents of object sets..")
|
||||
not_meshes = list()
|
||||
members = cmds.sets("pointcache_SET", query=True) or []
|
||||
|
||||
# Ensure contents in sets
|
||||
members = cmds.sets("out_SET", query=True) or []
|
||||
assert members, "Must have members in rig out_SET"
|
||||
|
||||
controls = cmds.sets("controls_SET", query=True) or []
|
||||
assert controls, "Must have controls in rig control_SET"
|
||||
|
||||
# Validate the contents further
|
||||
shapes = cmds.listRelatives(members,
|
||||
allDescendents=True,
|
||||
shapes=True,
|
||||
|
|
@ -59,5 +67,5 @@ class ValidateRigContents(pyblish.api.InstancePlugin):
|
|||
% not_transforms)
|
||||
|
||||
assert not_meshes == [], (
|
||||
"Only meshes can be part of the pointcache_SET: %s"
|
||||
"Only meshes can be part of the out_SET: %s"
|
||||
% not_meshes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue