From e1f040c9eaba834ae5585577c7c1b3779f0b7e3a Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 29 Dec 2022 15:05:34 +0100 Subject: [PATCH] nuke: validator exception legacy --- .../publish/help/validate_write_nodes.xml | 26 ++++++++++++++----- .../plugins/publish/validate_write_nodes.py | 21 +++++++++++++-- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/nuke/plugins/publish/help/validate_write_nodes.xml b/openpype/hosts/nuke/plugins/publish/help/validate_write_nodes.xml index cdf85102bc..1717622a45 100644 --- a/openpype/hosts/nuke/plugins/publish/help/validate_write_nodes.xml +++ b/openpype/hosts/nuke/plugins/publish/help/validate_write_nodes.xml @@ -3,16 +3,30 @@ Knobs values -## Invalid node's knobs values + ## Invalid node's knobs values -Following write node knobs needs to be repaired: + Following write node knobs needs to be repaired: -{xml_msg} + {xml_msg} -### How to repair? + ### How to repair? -1. Use Repair button. -2. Hit Reload button on the publisher. + 1. Use Repair button. + 2. Hit Reload button on the publisher. + + + + Legacy knob types + + ## Knobs are in obsolete configuration + + Settings needs to be fixed. + + ### How to repair? + + Contact your supervisor or fix it in project settings at + 'project_settings/nuke/imageio/nodes/requiredNodes' at knobs. + Each '__legacy__' type has to be defined accordingly to its type. \ No newline at end of file diff --git a/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py b/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py index c0b81f64ea..9027e54fc5 100644 --- a/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py +++ b/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py @@ -77,14 +77,31 @@ class ValidateNukeWriteNode( if write_node is None: return - correct_data = get_write_node_template_attr(write_group_node) + check_knobs = get_write_node_template_attr(write_group_node) check = [] self.log.debug("__ write_node: {}".format( write_node )) + self.log.debug("__ check_knobs: {}".format( + check_knobs + )) - for key, value in correct_data.items(): + for knob_data in check_knobs: + if ( + "type" not in knob_data + or knob_data["type"] == "__legacy__" + ): + PublishXmlValidationError( + self, ( + "Please update data in settings 'project_settings" + "/nuke/imageio/nodes/requiredNodes'" + ), + key="legacy" + ) + + key = knob_data["name"] + value = knob_data["value"] node_value = write_node[key].value() # fix type differences