name of the read node should be updated correctly when setting versions and switching assets

This commit is contained in:
Kayla Man 2023-08-11 15:29:36 +08:00
parent 745aacea0c
commit 4013148167

View file

@ -212,6 +212,8 @@ class LoadImage(load.LoaderPlugin):
last = first = int(frame_number)
# Set the global in to the start frame of the sequence
read_name = self._get_node_name(representation)
node["name"].setValue(read_name)
node["file"].setValue(file)
node["origfirst"].setValue(first)
node["first"].setValue(first)
@ -250,3 +252,17 @@ class LoadImage(load.LoaderPlugin):
with viewer_update_and_undo_stop():
nuke.delete(node)
def _get_node_name(self, representation):
repre_cont = representation["context"]
name_data = {
"asset": repre_cont["asset"],
"subset": repre_cont["subset"],
"representation": representation["name"],
"ext": repre_cont["representation"],
"id": representation["_id"],
"class_name": self.__class__.__name__
}
return self.node_name_template.format(**name_data)