diff --git a/pype/hosts/nuke/plugins/load/load_image.py b/pype/hosts/nuke/plugins/load/load_image.py index dcaf31c9e39..7033cca9f86 100644 --- a/pype/hosts/nuke/plugins/load/load_image.py +++ b/pype/hosts/nuke/plugins/load/load_image.py @@ -12,11 +12,7 @@ class LoadImage(api.Loader): """Load still image into Nuke""" - families = [ - "render2d", "source", "plate", - "render", "prerender", "review", - "image" - ] + families = ["render", "source", "plate", "review", "image"] representations = ["exr", "dpx", "jpg", "jpeg", "png", "psd"] label = "Load Image" @@ -24,6 +20,8 @@ class LoadImage(api.Loader): icon = "image" color = "white" + node_name_template = "{class_name}_{ext}" + options = [ qargparse.Integer( "frame_number", @@ -75,10 +73,16 @@ def load(self, context, name, namespace, options): frame, format(frame_number, "0{}".format(padding))) - read_name = "Read_{0}_{1}_{2}".format( - repr_cont["asset"], - repr_cont["subset"], - repr_cont["representation"]) + name_data = { + "asset": repr_cont["asset"], + "subset": repr_cont["subset"], + "representation": context["representation"]["name"], + "ext": repr_cont["representation"], + "id": context["representation"]["_id"], + "class_name": self.__class__.__name__ + } + + read_name = self.node_name_template.format(**name_data) # Create the Loader with the filename path set with viewer_update_and_undo_stop(): diff --git a/pype/hosts/nuke/plugins/load/load_mov.py b/pype/hosts/nuke/plugins/load/load_mov.py index 830359ccf90..0314322609b 100644 --- a/pype/hosts/nuke/plugins/load/load_mov.py +++ b/pype/hosts/nuke/plugins/load/load_mov.py @@ -69,19 +69,8 @@ def add_review_presets_config(): class LoadMov(api.Loader): """Load mov file into Nuke""" - presets = add_review_presets_config() - families = [ - "source", - "plate", - "render", - "prerender", - "review"] + presets["families"] - - representations = [ - "mov", - "preview", - "review", - "mp4"] + presets["representations"] + families = ["render", "source", "plate", "review"] + representations = ["mov", "review", "mp4"] label = "Load mov" order = -10 @@ -90,6 +79,8 @@ class LoadMov(api.Loader): script_start = nuke.root()["first_frame"].value() + node_name_template = "{class_name}_{ext}" + def load(self, context, name, namespace, data): from avalon.nuke import ( containerise, @@ -133,10 +124,16 @@ def load(self, context, name, namespace, data): file = file.replace("\\", "/") - read_name = "Read_{0}_{1}_{2}".format( - repr_cont["asset"], - repr_cont["subset"], - repr_cont["representation"]) + name_data = { + "asset": repr_cont["asset"], + "subset": repr_cont["subset"], + "representation": context["representation"]["name"], + "ext": repr_cont["representation"], + "id": context["representation"]["_id"], + "class_name": self.__class__.__name__ + } + + read_name = self.node_name_template.format(**name_data) # Create the Loader with the filename path set with viewer_update_and_undo_stop(): diff --git a/pype/hosts/nuke/plugins/load/load_sequence.py b/pype/hosts/nuke/plugins/load/load_sequence.py index f99b7be52f8..5cc2d019a00 100644 --- a/pype/hosts/nuke/plugins/load/load_sequence.py +++ b/pype/hosts/nuke/plugins/load/load_sequence.py @@ -72,14 +72,16 @@ def loader_shift(node, frame, relative=False): class LoadSequence(api.Loader): """Load image sequence into Nuke""" - families = ["render2d", "source", "plate", "render", "prerender", "review"] - representations = ["exr", "dpx", "jpg", "jpeg", "png"] + families = ["render", "source", "plate", "review"] + representations = ["exr", "dpx"] label = "Load Image Sequence" order = -20 icon = "file-video-o" color = "white" + node_name_template = "{class_name}_{ext}" + def load(self, context, name, namespace, data): from avalon.nuke import ( containerise, @@ -125,10 +127,16 @@ def load(self, context, name, namespace, data): padding = len(frame) file = file.replace(frame, "#" * padding) - read_name = "Read_{0}_{1}_{2}".format( - repr_cont["asset"], - repr_cont["subset"], - context["representation"]["name"]) + name_data = { + "asset": repr_cont["asset"], + "subset": repr_cont["subset"], + "representation": context["representation"]["name"], + "ext": repr_cont["representation"], + "id": context["representation"]["_id"], + "class_name": self.__class__.__name__ + } + + read_name = self.node_name_template.format(**name_data) # Create the Loader with the filename path set with viewer_update_and_undo_stop(): diff --git a/pype/settings/defaults/project_settings/nuke.json b/pype/settings/defaults/project_settings/nuke.json index d727a6ba1e4..71fe146b8a7 100644 --- a/pype/settings/defaults/project_settings/nuke.json +++ b/pype/settings/defaults/project_settings/nuke.json @@ -95,20 +95,60 @@ "load": { "LoadImage": { "enabled": true, - "representations": [] + "families": [ + "render2d", + "source", + "plate", + "render", + "prerender", + "review", + "image" + ], + "representations": [ + "exr", + "dpx", + "jpg", + "jpeg", + "png", + "psd" + ], + "node_name_template": "{class_name}_{ext}" }, "LoadMov": { "enabled": true, - "representations": [] + "families": [ + "source", + "plate", + "render", + "prerender", + "review" + ], + "representations": [ + "mov", + "review", + "mp4", + "h264" + ], + "node_name_template": "{class_name}_{ext}" }, "LoadSequence": { "enabled": true, + "families": [ + "render2d", + "source", + "plate", + "render", + "prerender", + "review" + ], "representations": [ - "png", - "jpg", "exr", - "" - ] + "dpx", + "jpg", + "jpeg", + "png" + ], + "node_name_template": "{class_name}_{ext}" } }, "workfile_build": { diff --git a/pype/settings/entities/schemas/projects_schema/schemas/template_loader_plugin.json b/pype/settings/entities/schemas/projects_schema/schemas/template_loader_plugin.json index 20dca6df179..d01691ed5fd 100644 --- a/pype/settings/entities/schemas/projects_schema/schemas/template_loader_plugin.json +++ b/pype/settings/entities/schemas/projects_schema/schemas/template_loader_plugin.json @@ -11,11 +11,22 @@ "key": "enabled", "label": "Enabled" }, + { + "type": "list", + "key": "families", + "label": "Families", + "object_type": "text" + }, { "type": "list", "key": "representations", "label": "Representations", "object_type": "text" + }, + { + "type": "text", + "key": "node_name_template", + "label": "Node name template" } ] }