From 6ae8537983ba2d885744ac831a79e95f4b766499 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 15:31:41 +0100 Subject: [PATCH] maya 'ValidateRenderSettings' can handle AYON settings --- .../plugins/publish/validate_rendersettings.py | 13 ++++++++++--- client/ayon_core/settings/ayon_settings.py | 15 --------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/client/ayon_core/hosts/maya/plugins/publish/validate_rendersettings.py b/client/ayon_core/hosts/maya/plugins/publish/validate_rendersettings.py index ed70d81b63..7f6c0bab1d 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/validate_rendersettings.py +++ b/client/ayon_core/hosts/maya/plugins/publish/validate_rendersettings.py @@ -281,6 +281,8 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): # if so, compare its value from the one required. for data in cls.get_nodes(instance, renderer): for node in data["nodes"]: + # Why is captured 'PublishValidationError'? How it can be + # raised by 'cmds.getAttr(...)'? try: render_value = cmds.getAttr( "{}.{}".format(node, data["attribute"]) @@ -310,11 +312,16 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin): @classmethod def get_nodes(cls, instance, renderer): maya_settings = instance.context.data["project_settings"]["maya"] + renderer_key = "{}_render_attributes".format(renderer) validation_settings = ( maya_settings["publish"]["ValidateRenderSettings"].get( - "{}_render_attributes".format(renderer) - ) or [] - ) + renderer_key + ) + ) or [] + validation_settings = [ + (item["type"], item["value"]) + for item in validation_settings + ] result = [] for attr, values in OrderedDict(validation_settings).items(): values = [convert_to_int_or_float(v) for v in values if v] diff --git a/client/ayon_core/settings/ayon_settings.py b/client/ayon_core/settings/ayon_settings.py index 9cadb36869..e9ec2ba650 100644 --- a/client/ayon_core/settings/ayon_settings.py +++ b/client/ayon_core/settings/ayon_settings.py @@ -336,21 +336,6 @@ def _convert_maya_project_settings(ayon_settings, output): # --- Publish (START) --- ayon_publish = ayon_maya["publish"] - # Extract playblast capture settings - validate_rendern_settings = ayon_publish["ValidateRenderSettings"] - for key in ( - "arnold_render_attributes", - "vray_render_attributes", - "redshift_render_attributes", - "renderman_render_attributes", - ): - if key not in validate_rendern_settings: - continue - validate_rendern_settings[key] = [ - [item["type"], item["value"]] - for item in validate_rendern_settings[key] - ] - plugin_path_attributes = ayon_publish["ValidatePluginPathAttributes"] plugin_path_attributes["attribute"] = { item["name"]: item["value"]