From 5b7af5fd627bbbaa5388b594269b20304cc587e9 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 25 Jul 2024 17:22:59 +0800 Subject: [PATCH 01/12] add resetting paths for render product types in validate correct asset context --- client/ayon_nuke/api/lib.py | 1 + .../plugins/publish/validate_asset_context.py | 30 +++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index 9055212..c89965d 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -993,6 +993,7 @@ def format_anatomy(data): }, "frame": "#" * frame_padding, }) + print("data", data) return anatomy.format(data) diff --git a/client/ayon_nuke/plugins/publish/validate_asset_context.py b/client/ayon_nuke/plugins/publish/validate_asset_context.py index 903648f..cb08c7f 100644 --- a/client/ayon_nuke/plugins/publish/validate_asset_context.py +++ b/client/ayon_nuke/plugins/publish/validate_asset_context.py @@ -3,7 +3,8 @@ from __future__ import absolute_import import pyblish.api - +import nuke +from ayon_core.lib import StringTemplate from ayon_core.pipeline.publish import ( RepairAction, ValidateContentsOrder, @@ -11,6 +12,7 @@ OptionalPyblishPluginMixin ) from ayon_nuke.api import SelectInstanceNodeAction +from ayon_nuke.api.lib import format_anatomy class ValidateCorrectAssetContext( @@ -110,5 +112,29 @@ def repair(cls, instance): ) for _key in invalid_keys: created_instance[_key] = instance.context.data[_key] - create_context.save_changes() + if instance.data["productType"] in {"prerender", "render", "image"}: + cls.reset_write_node_filepath(instance) + + @classmethod + def reset_write_node_filepath(cls, instance): + instance_node = instance.data["transientData"]["node"] + write_node = nuke.allNodes(group=instance_node, filter="Write")[0] + data = dict({ + "fpath_template": ( + "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}"), + "ext": write_node["file_type"].value(), + "folderPath": instance.context.data["folderPath"], + "task": instance.context.data["task"], + "productName": instance.data["productName"], + "productType": instance.data["productType"] + }) + anatomy_filled = format_anatomy(data) + + # build file path to workfiles + fdir = str( + anatomy_filled["work"]["default"]["directory"] + ).replace("\\", "/") + data["work"] = fdir + fpath = StringTemplate(data["fpath_template"]).format_strict(data) + write_node["file"].setValue(fpath) From b716e71e7d3c47d24a715795016a1005784d34b3 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 25 Jul 2024 19:05:07 +0800 Subject: [PATCH 02/12] remove print function --- client/ayon_nuke/api/lib.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index c89965d..9055212 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -993,7 +993,6 @@ def format_anatomy(data): }, "frame": "#" * frame_padding, }) - print("data", data) return anatomy.format(data) From da7b3eee04e5e2aa6d99d899395e99ccc1884208 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 26 Jul 2024 13:28:25 +0800 Subject: [PATCH 03/12] implement separate update_instances function for NukeWriteCreator --- client/ayon_nuke/api/lib.py | 28 ++++++++++++ client/ayon_nuke/api/plugin.py | 34 ++++++++++++++ .../plugins/publish/validate_asset_context.py | 45 +++++++------------ 3 files changed, 79 insertions(+), 28 deletions(-) diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index 9055212..d540a70 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -2,6 +2,7 @@ import re import json import six +import copy import functools import warnings import platform @@ -2971,3 +2972,30 @@ def link_knobs(knobs, node, group_node): "Write node exposed knobs missing:\n\n{}\n\nPlease review" " project settings.".format("\n".join(missing_knobs)) ) + + +def reset_write_node_filepath(instance_node, data): + """Reset filepath in the write node when switching folderPath and task + + Args: + instance_node (nuke.Nodes): instance node + data (dict): instance data + """ + formatting_data = copy.deepcopy(data) + write_node = nuke.allNodes(group=instance_node, filter="Write")[0] + formatting_data.update({ + "fpath_template": ( + "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}"), + "ext": write_node["file_type"].value() + }) + anatomy_filled = format_anatomy(formatting_data) + + # build file path to workfiles + fdir = str( + anatomy_filled["work"]["default"]["directory"] + ).replace("\\", "/") + formatting_data["work"] = fdir + fpath = StringTemplate(formatting_data["fpath_template"]).format_strict( + formatting_data) + write_node["file"].setValue(fpath) + instance_node["name"].setValue(formatting_data["productName"]) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index fc30f32..339cfa0 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -40,6 +40,7 @@ get_node_data, get_view_process_node, get_filenames_without_hash, + reset_write_node_filepath, link_knobs ) from .pipeline import ( @@ -309,6 +310,39 @@ def set_selected_nodes(self, pre_create_data): else: self.selected_node = None + def update_instances(self, update_list): + for created_inst, changes in update_list: + instance_node = created_inst.transient_data["node"] + + # update instance node name if product name changed + if "productName" in changes.changed_keys: + changed_data = { + "productName": changes["productName"].new_value or ( + created_inst["productName"]), + "folderPath": changes["folderPath"].new_value or ( + created_inst["folderPath"] + ), + "task": changes["task"].new_value or ( + created_inst["task"] + ), + "productType": changes["productType"].new_value or ( + created_inst["productType"] + ) + } + reset_write_node_filepath(instance_node, changed_data) + # in case node is not existing anymore (user erased it manually) + try: + instance_node.fullName() + except ValueError: + self.remove_instances([created_inst]) + continue + + set_node_data( + instance_node, + INSTANCE_DATA_KNOB, + created_inst.data_to_store() + ) + def get_pre_create_attr_defs(self): attr_defs = [ BoolDef("use_selection", label="Use selection"), diff --git a/client/ayon_nuke/plugins/publish/validate_asset_context.py b/client/ayon_nuke/plugins/publish/validate_asset_context.py index cb08c7f..570016c 100644 --- a/client/ayon_nuke/plugins/publish/validate_asset_context.py +++ b/client/ayon_nuke/plugins/publish/validate_asset_context.py @@ -3,8 +3,7 @@ from __future__ import absolute_import import pyblish.api -import nuke -from ayon_core.lib import StringTemplate + from ayon_core.pipeline.publish import ( RepairAction, ValidateContentsOrder, @@ -12,7 +11,7 @@ OptionalPyblishPluginMixin ) from ayon_nuke.api import SelectInstanceNodeAction -from ayon_nuke.api.lib import format_anatomy +from ayon_nuke.api.lib import reset_write_node_filepath class ValidateCorrectAssetContext( @@ -112,29 +111,19 @@ def repair(cls, instance): ) for _key in invalid_keys: created_instance[_key] = instance.context.data[_key] - create_context.save_changes() - if instance.data["productType"] in {"prerender", "render", "image"}: - cls.reset_write_node_filepath(instance) - @classmethod - def reset_write_node_filepath(cls, instance): - instance_node = instance.data["transientData"]["node"] - write_node = nuke.allNodes(group=instance_node, filter="Write")[0] - data = dict({ - "fpath_template": ( - "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}"), - "ext": write_node["file_type"].value(), - "folderPath": instance.context.data["folderPath"], - "task": instance.context.data["task"], - "productName": instance.data["productName"], - "productType": instance.data["productType"] - }) - anatomy_filled = format_anatomy(data) - - # build file path to workfiles - fdir = str( - anatomy_filled["work"]["default"]["directory"] - ).replace("\\", "/") - data["work"] = fdir - fpath = StringTemplate(data["fpath_template"]).format_strict(data) - write_node["file"].setValue(fpath) + if instance.data["productType"] in {"prerender", "render", "image"}: + updated_created_instance = create_context.get_instance_by_id( + instance_id + ) + instance_node = instance.data["transientData"]["node"] + data = dict({ + "folderPath": updated_created_instance["folderPath"], + "task": updated_created_instance["task"], + "productName": updated_created_instance["productName"], + "productType": updated_created_instance["productType"] + }) + + reset_write_node_filepath(instance_node, data) + + create_context.save_changes() \ No newline at end of file From ec26d876e804338f7c491c54d5d7e82f9f026c35 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 26 Jul 2024 13:32:08 +0800 Subject: [PATCH 04/12] clean up the code --- .../plugins/publish/validate_asset_context.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/client/ayon_nuke/plugins/publish/validate_asset_context.py b/client/ayon_nuke/plugins/publish/validate_asset_context.py index 570016c..921846d 100644 --- a/client/ayon_nuke/plugins/publish/validate_asset_context.py +++ b/client/ayon_nuke/plugins/publish/validate_asset_context.py @@ -113,15 +113,12 @@ def repair(cls, instance): created_instance[_key] = instance.context.data[_key] if instance.data["productType"] in {"prerender", "render", "image"}: - updated_created_instance = create_context.get_instance_by_id( - instance_id - ) instance_node = instance.data["transientData"]["node"] data = dict({ - "folderPath": updated_created_instance["folderPath"], - "task": updated_created_instance["task"], - "productName": updated_created_instance["productName"], - "productType": updated_created_instance["productType"] + "folderPath": created_instance["folderPath"], + "task": created_instance["task"], + "productName": created_instance["productName"], + "productType": created_instance["productType"] }) reset_write_node_filepath(instance_node, data) From 3121061f3f1902c290d1c374dc18d5cba74a84ad Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 26 Jul 2024 17:24:09 +0800 Subject: [PATCH 05/12] move the update workfile path function into the plugin.py --- client/ayon_nuke/api/lib.py | 28 ---------- client/ayon_nuke/api/plugin.py | 54 +++++++++++-------- .../plugins/publish/validate_asset_context.py | 14 +---- 3 files changed, 34 insertions(+), 62 deletions(-) diff --git a/client/ayon_nuke/api/lib.py b/client/ayon_nuke/api/lib.py index d540a70..9055212 100644 --- a/client/ayon_nuke/api/lib.py +++ b/client/ayon_nuke/api/lib.py @@ -2,7 +2,6 @@ import re import json import six -import copy import functools import warnings import platform @@ -2972,30 +2971,3 @@ def link_knobs(knobs, node, group_node): "Write node exposed knobs missing:\n\n{}\n\nPlease review" " project settings.".format("\n".join(missing_knobs)) ) - - -def reset_write_node_filepath(instance_node, data): - """Reset filepath in the write node when switching folderPath and task - - Args: - instance_node (nuke.Nodes): instance node - data (dict): instance data - """ - formatting_data = copy.deepcopy(data) - write_node = nuke.allNodes(group=instance_node, filter="Write")[0] - formatting_data.update({ - "fpath_template": ( - "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}"), - "ext": write_node["file_type"].value() - }) - anatomy_filled = format_anatomy(formatting_data) - - # build file path to workfiles - fdir = str( - anatomy_filled["work"]["default"]["directory"] - ).replace("\\", "/") - formatting_data["work"] = fdir - fpath = StringTemplate(formatting_data["fpath_template"]).format_strict( - formatting_data) - write_node["file"].setValue(fpath) - instance_node["name"].setValue(formatting_data["productName"]) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index 339cfa0..c4dfd5c 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -3,6 +3,7 @@ import os import sys import six +import copy import random import string from collections import defaultdict @@ -40,13 +41,13 @@ get_node_data, get_view_process_node, get_filenames_without_hash, - reset_write_node_filepath, link_knobs ) from .pipeline import ( list_instances, remove_instance ) +from ayon_nuke.api.lib import format_anatomy def _collect_and_cache_nodes(creator): @@ -223,10 +224,7 @@ def update_instances(self, update_list): # update instance node name if product name changed if "productName" in changes.changed_keys: - instance_node["name"].setValue( - changes["productName"].new_value - ) - + update_write_node_filepath(created_inst, changes) # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() @@ -314,22 +312,8 @@ def update_instances(self, update_list): for created_inst, changes in update_list: instance_node = created_inst.transient_data["node"] - # update instance node name if product name changed - if "productName" in changes.changed_keys: - changed_data = { - "productName": changes["productName"].new_value or ( - created_inst["productName"]), - "folderPath": changes["folderPath"].new_value or ( - created_inst["folderPath"] - ), - "task": changes["task"].new_value or ( - created_inst["task"] - ), - "productType": changes["productType"].new_value or ( - created_inst["productType"] - ) - } - reset_write_node_filepath(instance_node, changed_data) + # update instance node data if context data has changed values + update_write_node_filepath(created_inst, changes) # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() @@ -1259,3 +1243,31 @@ def exposed_write_knobs(settings, plugin_name, instance_node): instance_node.addKnob(nuke.Text_Knob('', 'Write Knobs')) write_node = nuke.allNodes(group=instance_node, filter="Write")[0] link_knobs(exposed_knobs, write_node, instance_node) + + +def update_write_node_filepath(created_inst, changes): + keys = ("productName", "folderPath", "task", "productType") + if not any(key in changes.changed_keys for key in keys): + # No relevant changes, no need to update + return + data = created_inst.data_to_store() + # Update values with new formatted path + instance_node = created_inst.transient_data["node"] + formatting_data = copy.deepcopy(data) + write_node = nuke.allNodes(group=instance_node, filter="Write")[0] + formatting_data.update({ + "fpath_template": ( + "{work}/renders/nuke/{subset}/{subset}.{frame}.{ext}"), + "ext": write_node["file_type"].value() + }) + anatomy_filled = format_anatomy(formatting_data) + + # build file path to workfiles + fdir = str( + anatomy_filled["work"]["default"]["directory"] + ).replace("\\", "/") + formatting_data["work"] = fdir + fpath = StringTemplate(formatting_data["fpath_template"]).format_strict( + formatting_data) + write_node["file"].setValue(fpath) + instance_node["name"].setValue(formatting_data["productName"]) diff --git a/client/ayon_nuke/plugins/publish/validate_asset_context.py b/client/ayon_nuke/plugins/publish/validate_asset_context.py index 921846d..903648f 100644 --- a/client/ayon_nuke/plugins/publish/validate_asset_context.py +++ b/client/ayon_nuke/plugins/publish/validate_asset_context.py @@ -11,7 +11,6 @@ OptionalPyblishPluginMixin ) from ayon_nuke.api import SelectInstanceNodeAction -from ayon_nuke.api.lib import reset_write_node_filepath class ValidateCorrectAssetContext( @@ -112,15 +111,4 @@ def repair(cls, instance): for _key in invalid_keys: created_instance[_key] = instance.context.data[_key] - if instance.data["productType"] in {"prerender", "render", "image"}: - instance_node = instance.data["transientData"]["node"] - data = dict({ - "folderPath": created_instance["folderPath"], - "task": created_instance["task"], - "productName": created_instance["productName"], - "productType": created_instance["productType"] - }) - - reset_write_node_filepath(instance_node, data) - - create_context.save_changes() \ No newline at end of file + create_context.save_changes() From 04c51be6b095b6b1a363981322e8b90ddc2fd5a1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 26 Jul 2024 19:57:30 +0800 Subject: [PATCH 06/12] restore some codes which is unrelated to this PR --- client/ayon_nuke/api/plugin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index c4dfd5c..c93da64 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -224,7 +224,9 @@ def update_instances(self, update_list): # update instance node name if product name changed if "productName" in changes.changed_keys: - update_write_node_filepath(created_inst, changes) + instance_node["name"].setValue( + changes["productName"].new_value + ) # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() @@ -312,8 +314,9 @@ def update_instances(self, update_list): for created_inst, changes in update_list: instance_node = created_inst.transient_data["node"] - # update instance node data if context data has changed values - update_write_node_filepath(created_inst, changes) + # update instance node name if product name changed + if "productName" in changes.changed_keys: + update_write_node_filepath(created_inst, changes) # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() From 1b358895c85e02fae10512b3ff7a9a739c7019a1 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 26 Jul 2024 19:59:43 +0800 Subject: [PATCH 07/12] if the folderPath or task has some changed values, it will update the write node --- client/ayon_nuke/api/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index c93da64..7669e88 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -227,6 +227,7 @@ def update_instances(self, update_list): instance_node["name"].setValue( changes["productName"].new_value ) + # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() @@ -315,7 +316,7 @@ def update_instances(self, update_list): instance_node = created_inst.transient_data["node"] # update instance node name if product name changed - if "productName" in changes.changed_keys: + if "folderPath" or "task" in changes.changed_keys: update_write_node_filepath(created_inst, changes) # in case node is not existing anymore (user erased it manually) try: From 67ad4ab44f1e741ebaf8a99062093a4a00542fd5 Mon Sep 17 00:00:00 2001 From: Kayla Man <64118225+moonyuet@users.noreply.github.com> Date: Fri, 26 Jul 2024 20:05:10 +0800 Subject: [PATCH 08/12] Update client/ayon_nuke/api/plugin.py Co-authored-by: Roy Nieterau --- client/ayon_nuke/api/plugin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index 7669e88..0d6e69e 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -315,9 +315,7 @@ def update_instances(self, update_list): for created_inst, changes in update_list: instance_node = created_inst.transient_data["node"] - # update instance node name if product name changed - if "folderPath" or "task" in changes.changed_keys: - update_write_node_filepath(created_inst, changes) + update_write_node_filepath(created_inst, changes) # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() From ad9bda6561300e51ab2528f089048eef7fe45a10 Mon Sep 17 00:00:00 2001 From: Kayla Man <64118225+moonyuet@users.noreply.github.com> Date: Fri, 26 Jul 2024 20:05:16 +0800 Subject: [PATCH 09/12] Update client/ayon_nuke/api/plugin.py Co-authored-by: Roy Nieterau --- client/ayon_nuke/api/plugin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index 0d6e69e..d4ddd91 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -1248,6 +1248,13 @@ def exposed_write_knobs(settings, plugin_name, instance_node): def update_write_node_filepath(created_inst, changes): + """Update instance node on context changes. + + Whenever any of productName, folderPath, task or productType + changes then update: + - output filepath of the write node + - instance node's name to the product name + """ keys = ("productName", "folderPath", "task", "productType") if not any(key in changes.changed_keys for key in keys): # No relevant changes, no need to update From 94d16aa98c16a296705deec01ec1a76a0317f6d3 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 26 Jul 2024 20:20:33 +0800 Subject: [PATCH 10/12] move update_write_node_filepath after try exception --- client/ayon_nuke/api/plugin.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index d4ddd91..689bb10 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -315,7 +315,11 @@ def update_instances(self, update_list): for created_inst, changes in update_list: instance_node = created_inst.transient_data["node"] - update_write_node_filepath(created_inst, changes) + # update instance node name if product name changed + if "productName" in changes.changed_keys: + instance_node["name"].setValue( + changes["productName"].new_value + ) # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() @@ -323,6 +327,8 @@ def update_instances(self, update_list): self.remove_instances([created_inst]) continue + update_write_node_filepath(created_inst, changes) + set_node_data( instance_node, INSTANCE_DATA_KNOB, @@ -1249,7 +1255,7 @@ def exposed_write_knobs(settings, plugin_name, instance_node): def update_write_node_filepath(created_inst, changes): """Update instance node on context changes. - + Whenever any of productName, folderPath, task or productType changes then update: - output filepath of the write node @@ -1278,5 +1284,4 @@ def update_write_node_filepath(created_inst, changes): formatting_data["work"] = fdir fpath = StringTemplate(formatting_data["fpath_template"]).format_strict( formatting_data) - write_node["file"].setValue(fpath) - instance_node["name"].setValue(formatting_data["productName"]) + write_node["file"].setValue(fpath) \ No newline at end of file From 716e26af673eb69908afa210e8411a1a25e7f6a8 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 26 Jul 2024 20:22:04 +0800 Subject: [PATCH 11/12] linter issue --- client/ayon_nuke/api/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index 689bb10..7485421 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -1284,4 +1284,4 @@ def update_write_node_filepath(created_inst, changes): formatting_data["work"] = fdir fpath = StringTemplate(formatting_data["fpath_template"]).format_strict( formatting_data) - write_node["file"].setValue(fpath) \ No newline at end of file + write_node["file"].setValue(fpath) From 6eb6988f5caa77b19a14843b4d29e719b81072f0 Mon Sep 17 00:00:00 2001 From: Kayla Man <64118225+moonyuet@users.noreply.github.com> Date: Fri, 26 Jul 2024 21:30:45 +0800 Subject: [PATCH 12/12] Update client/ayon_nuke/api/plugin.py Co-authored-by: Roy Nieterau --- client/ayon_nuke/api/plugin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/ayon_nuke/api/plugin.py b/client/ayon_nuke/api/plugin.py index 7485421..860b5c2 100644 --- a/client/ayon_nuke/api/plugin.py +++ b/client/ayon_nuke/api/plugin.py @@ -315,17 +315,17 @@ def update_instances(self, update_list): for created_inst, changes in update_list: instance_node = created_inst.transient_data["node"] - # update instance node name if product name changed - if "productName" in changes.changed_keys: - instance_node["name"].setValue( - changes["productName"].new_value - ) # in case node is not existing anymore (user erased it manually) try: instance_node.fullName() except ValueError: self.remove_instances([created_inst]) continue + # update instance node name if product name changed + if "productName" in changes.changed_keys: + instance_node["name"].setValue( + changes["productName"].new_value + ) update_write_node_filepath(created_inst, changes)