From 1dee7ceb6464f37c2582b5dbc8d10e0a20327197 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 9 Sep 2022 14:09:38 +0200 Subject: [PATCH 1/4] Tweak logging for attribute validation check + clean-up splitting logic --- .../plugins/publish/validate_rendersettings.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py index 08ecc0d149..25674effa8 100644 --- a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py +++ b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py @@ -257,14 +257,18 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): # go through definitions and test if such node.attribute exists. # if so, compare its value from the one required. for attr, value in OrderedDict(validation_settings).items(): - # first get node of that type cls.log.debug("{}: {}".format(attr, value)) - node_type = attr.split(".")[0] - attribute_name = ".".join(attr.split(".")[1:]) + if "." not in attr: + cls.log.warning("Skipping invalid attribute defined in " + "validation settings: '{}'".format(attr)) + + node_type, attribute_name = attr.split(".", 1) + + # first get node of that type nodes = cmds.ls(type=node_type) - if not isinstance(nodes, list): - cls.log.warning("No nodes of '{}' found.".format(node_type)) + if not nodes: + cls.log.info("No nodes of type '{}' found.".format(node_type)) continue for node in nodes: From dc2d6e59a4ed0f53a77b09479f2b038c9b25f383 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 9 Sep 2022 14:10:05 +0200 Subject: [PATCH 2/4] Skip invalid attr correctly --- openpype/hosts/maya/plugins/publish/validate_rendersettings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py index 25674effa8..883b0daa88 100644 --- a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py +++ b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py @@ -261,6 +261,7 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): if "." not in attr: cls.log.warning("Skipping invalid attribute defined in " "validation settings: '{}'".format(attr)) + continue node_type, attribute_name = attr.split(".", 1) From dfb0677971ef10a1bf919b87e70266d4c2b7888a Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 9 Sep 2022 14:13:36 +0200 Subject: [PATCH 3/4] Revert message back to a warning --- openpype/hosts/maya/plugins/publish/validate_rendersettings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py index 883b0daa88..818f814076 100644 --- a/openpype/hosts/maya/plugins/publish/validate_rendersettings.py +++ b/openpype/hosts/maya/plugins/publish/validate_rendersettings.py @@ -269,7 +269,8 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): nodes = cmds.ls(type=node_type) if not nodes: - cls.log.info("No nodes of type '{}' found.".format(node_type)) + cls.log.warning( + "No nodes of type '{}' found.".format(node_type)) continue for node in nodes: From 484e3175c9b0ebb694e565a628e0c991ace0495b Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 29 Sep 2022 16:41:00 +0200 Subject: [PATCH 4/4] Fix example labels to show node name needs to be included --- .../schemas/schema_maya_render_settings.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_render_settings.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_render_settings.json index 6ee02ca78f..0cbb684fc6 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_render_settings.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_maya_render_settings.json @@ -140,7 +140,7 @@ }, { "type": "label", - "label": "Add additional options - put attribute and value, like AASamples" + "label": "Add additional options - put attribute and value, like defaultArnoldRenderOptions.AASamples = 4" }, { "type": "dict-modifiable", @@ -276,7 +276,7 @@ }, { "type": "label", - "label": "Add additional options - put attribute and value, like aaFilterSize" + "label": "Add additional options - put attribute and value, like vraySettings.aaFilterSize = 1.5" }, { "type": "dict-modifiable", @@ -405,7 +405,7 @@ }, { "type": "label", - "label": "Add additional options - put attribute and value, like reflectionMaxTraceDepth" + "label": "Add additional options - put attribute and value, like redshiftOptions.reflectionMaxTraceDepth = 3" }, { "type": "dict-modifiable",