mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Validate xgen
This commit is contained in:
parent
6af973fc8f
commit
91d935c948
1 changed files with 28 additions and 0 deletions
28
openpype/hosts/maya/plugins/publish/validate_xgen.py
Normal file
28
openpype/hosts/maya/plugins/publish/validate_xgen.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import maya.cmds as cmds
|
||||
|
||||
import pyblish.api
|
||||
|
||||
|
||||
class ValidateXgen(pyblish.api.InstancePlugin):
|
||||
"""Ensure Xgen objectset only contains collections."""
|
||||
|
||||
label = "Xgen"
|
||||
order = pyblish.api.ValidatorOrder
|
||||
host = ["maya"]
|
||||
families = ["xgen"]
|
||||
|
||||
def process(self, instance):
|
||||
nodes = (
|
||||
cmds.ls(instance, type="xgmPalette", long=True) +
|
||||
cmds.ls(instance, type="transform", long=True) +
|
||||
cmds.ls(instance, type="xgmDescription", long=True) +
|
||||
cmds.ls(instance, type="xgmSubdPatch", long=True)
|
||||
)
|
||||
remainder_nodes = []
|
||||
for node in instance:
|
||||
if node in nodes:
|
||||
continue
|
||||
remainder_nodes.append(node)
|
||||
|
||||
msg = "Invalid nodes in the objectset:\n{}".format(remainder_nodes)
|
||||
assert not remainder_nodes, msg
|
||||
Loading…
Add table
Add a link
Reference in a new issue