diff --git a/openpype/hosts/maya/plugins/publish/collect_look.py b/openpype/hosts/maya/plugins/publish/collect_look.py index 20a9d4ca12..53897b21f6 100644 --- a/openpype/hosts/maya/plugins/publish/collect_look.py +++ b/openpype/hosts/maya/plugins/publish/collect_look.py @@ -386,10 +386,13 @@ class CollectLook(pyblish.api.InstancePlugin): self.log.info("Collected resources: {}".format(instance.data["resources"])) - # Log a warning when no relevant sets were retrieved for the look. - if not instance.data["lookData"]["relationships"]: - self.log.warning("No sets found for the nodes in the instance: " - "%s" % instance[:]) + # Log warning when no relevant sets were retrieved for the look. + if ( + not instance.data["lookData"]["relationships"] + and "model" not in self.families + ): + self.log.warning("No sets found for the nodes in the " + "instance: %s" % instance[:]) # Ensure unique shader sets # Add shader sets to the instance for unify ID validation diff --git a/openpype/hosts/maya/plugins/publish/validate_model_content.py b/openpype/hosts/maya/plugins/publish/validate_model_content.py index 3d4f122af4..aee0ea52f0 100644 --- a/openpype/hosts/maya/plugins/publish/validate_model_content.py +++ b/openpype/hosts/maya/plugins/publish/validate_model_content.py @@ -9,7 +9,7 @@ from openpype.hosts.maya.api import lib class ValidateModelContent(pyblish.api.InstancePlugin): """Adheres to the content of 'model' family - - Must have one top group. + - Must have one top group. (configurable) - Must only contain: transforms, meshes and groups """ @@ -20,6 +20,8 @@ class ValidateModelContent(pyblish.api.InstancePlugin): label = "Model Content" actions = [openpype.hosts.maya.api.action.SelectInvalidAction] + validate_top_group = True + @classmethod def get_invalid(cls, instance): @@ -59,12 +61,13 @@ class ValidateModelContent(pyblish.api.InstancePlugin): # Top group assemblies = cmds.ls(content_instance, assemblies=True, long=True) - if len(assemblies) != 1: + if len(assemblies) != 1 and cls.validate_top_group: cls.log.error("Must have exactly one top group") - if len(assemblies) == 0: - cls.log.warning("No top group found. " - "(Are there objects in the instance?" - " Or is it parented in another group?)") + return assemblies + if len(assemblies) == 0: + cls.log.warning("No top group found. " + "(Are there objects in the instance?" + " Or is it parented in another group?)") return assemblies or True def _is_visible(node): diff --git a/openpype/settings/defaults/project_settings/maya.json b/openpype/settings/defaults/project_settings/maya.json index 73c75ef3ee..f4b9760fe1 100644 --- a/openpype/settings/defaults/project_settings/maya.json +++ b/openpype/settings/defaults/project_settings/maya.json @@ -275,6 +275,11 @@ "optional": true, "active": true }, + "ValidateModelContent": { + "enabled": true, + "optional": false, + "validate_top_group": true + }, "ValidateNoAnimation": { "enabled": false, "optional": true, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json index 9fd19d7be2..606dd6c2bb 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json @@ -214,6 +214,30 @@ } ] }, + { + "type": "dict", + "collapsible": true, + "key": "ValidateModelContent", + "label": "Validate Model Content", + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "optional", + "label": "Optional" + }, + { + "type": "boolean", + "key": "validate_top_group", + "label": "Validate one top group" + } + ] + }, { "type": "dict", "collapsible": true,