Merge pull request #207 from BigRoy/bugfix/maya_validate_rig_contents_geometry_return_invalid

Bugfix: Maya validate rig contents geometry actually return invalid nodes
This commit is contained in:
Toke Jepsen 2024-03-25 18:10:14 +00:00 committed by GitHub
commit d214f51dc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,9 +92,9 @@ class ValidateRigContents(pyblish.api.InstancePlugin,
"""Validate missing objectsets in rig sets
Args:
instance (str): instance
required_objsets (list): list of objectset names
rig_sets (list): list of rig sets
instance (pyblish.api.Instance): instance
required_objsets (list[str]): list of objectset names
rig_sets (list[str]): list of rig sets
Raises:
PublishValidationError: When the error is raised, it will show
@ -114,15 +114,15 @@ class ValidateRigContents(pyblish.api.InstancePlugin,
Check if all rig set members are within the hierarchy of the rig root
Args:
instance (str): instance
content (list): list of content from rig sets
instance (pyblish.api.Instance): instance
content (list[str]): list of content from rig sets
Raises:
PublishValidationError: It means no dag nodes in
the rig instance
Returns:
list: invalid hierarchy
List[str]: invalid hierarchy
"""
# Ensure there are at least some transforms or dag nodes
# in the rig instance
@ -145,15 +145,13 @@ class ValidateRigContents(pyblish.api.InstancePlugin,
@classmethod
def validate_geometry(cls, set_members):
"""
Checks if the node types of the set members valid
"""Checks if the node types of the set members valid
Args:
set_members: list of nodes of the controls_set
hierarchy: list of nodes which reside under the root node
set_members (list[str]): nodes of the out_set
Returns:
errors (list)
list[str]: Nodes of invalid types.
"""
# Validate all shape types
@ -167,18 +165,17 @@ class ValidateRigContents(pyblish.api.InstancePlugin,
if cmds.nodeType(shape) not in cls.accepted_output:
invalid.append(shape)
return invalid
@classmethod
def validate_controls(cls, set_members):
"""
Checks if the control set members are allowed node types.
Checks if the node types of the set members valid
"""Checks if the node types of the set members are valid for controls.
Args:
set_members: list of nodes of the controls_set
hierarchy: list of nodes which reside under the root node
set_members (list[str]): list of nodes of the controls_set
Returns:
errors (list)
list: Controls of disallowed node types.
"""
# Validate control types
@ -194,7 +191,7 @@ class ValidateRigContents(pyblish.api.InstancePlugin,
"""Get the target objectsets and rig sets nodes
Args:
instance (str): instance
instance (pyblish.api.Instance): instance
Returns:
tuple: 2-tuple of list of objectsets,
@ -253,11 +250,10 @@ class ValidateSkeletonRigContents(ValidateRigContents):
"""Get the target objectsets and rig sets nodes
Args:
instance (str): instance
instance (pyblish.api.Instance): instance
Returns:
tuple: 2-tuple of list of objectsets,
list of rig sets nodes
tuple: 2-tuple of list of objectsets, list of rig sets nodes
"""
objectsets = ["skeletonMesh_SET"]
skeleton_mesh_nodes = instance.data.get("skeleton_mesh", [])