From 2294e4c374a793b066c6ff11bafc034139018f12 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 12 Mar 2021 14:42:52 +0100 Subject: [PATCH 1/3] AE - fixed instance creation logic Only single instance should be created at a time --- .../plugins/create/create_render.py | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/pype/hosts/aftereffects/plugins/create/create_render.py b/pype/hosts/aftereffects/plugins/create/create_render.py index b346bc60d8..70abd36406 100644 --- a/pype/hosts/aftereffects/plugins/create/create_render.py +++ b/pype/hosts/aftereffects/plugins/create/create_render.py @@ -8,7 +8,13 @@ log = logging.getLogger(__name__) class CreateRender(pype.api.Creator): - """Render folder for publish.""" + """Render folder for publish. + + Creates subsets in format 'familyTaskSubsetname', + eg 'renderCompositingMain'. + + Create only single instance from composition at a time. + """ name = "renderDefault" label = "Render on Farm" @@ -20,7 +26,7 @@ class CreateRender(pype.api.Creator): items = stub.get_selected_items(comps=True, folders=False, footages=False) - else: + if len(items) > 1: self._show_msg("Please select only single composition at time.") return False @@ -30,15 +36,20 @@ class CreateRender(pype.api.Creator): "one composition.") return False - for item in items: + existing_subsets = [instance['subset'].lower() + for instance in aftereffects.list_instances()] + + item = items.pop() + if self.name.lower() in existing_subsets: txt = "Instance with name \"{}\" already exists.".format(self.name) - if self.name.lower() == item.name.lower(): - self._show_msg(txt) - return False - self.data["members"] = [item.id] - stub.imprint(item, self.data) - stub.set_label_color(item.id, 14) # Cyan options 0 - 16 - stub.rename_item(item, self.data["subset"]) + self._show_msg(txt) + return False + + self.data["members"] = [item.id] + self.data["uuid"] = item.id # for SubsetManager + stub.imprint(item, self.data) + stub.set_label_color(item.id, 14) # Cyan options 0 - 16 + stub.rename_item(item, stub.PUBLISH_ICON + self.data["subset"]) def _show_msg(self, txt): msg = Qt.QtWidgets.QMessageBox() From a111f929e894c029ab6082f44f8b8f16960d6b16 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 12 Mar 2021 14:43:50 +0100 Subject: [PATCH 2/3] AE - added higlighting loaded items --- pype/hosts/aftereffects/plugins/load/load_background.py | 5 +++-- pype/hosts/aftereffects/plugins/load/load_file.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pype/hosts/aftereffects/plugins/load/load_background.py b/pype/hosts/aftereffects/plugins/load/load_background.py index 879734e4f9..e6f8b6a032 100644 --- a/pype/hosts/aftereffects/plugins/load/load_background.py +++ b/pype/hosts/aftereffects/plugins/load/load_background.py @@ -29,7 +29,8 @@ class BackgroundLoader(api.Loader): "{}_{}".format(context["asset"]["name"], name)) layers = get_background_layers(self.fname) - comp = stub.import_background(None, comp_name, layers) + comp = stub.import_background(None, stub.LOADED_ICON + comp_name, + layers) if not comp: self.log.warning( @@ -72,7 +73,7 @@ class BackgroundLoader(api.Loader): layers = get_background_layers(path) comp = stub.reload_background(container["members"][1], - comp_name, + stub.LOADED_ICON + comp_name, layers) # update container diff --git a/pype/hosts/aftereffects/plugins/load/load_file.py b/pype/hosts/aftereffects/plugins/load/load_file.py index ba11856678..500a53a69b 100644 --- a/pype/hosts/aftereffects/plugins/load/load_file.py +++ b/pype/hosts/aftereffects/plugins/load/load_file.py @@ -48,7 +48,8 @@ class FileLoader(api.Loader): if '.psd' in file: import_options['ImportAsType'] = 'ImportAsType.COMP' - comp = stub.import_file(self.fname, comp_name, import_options) + comp = stub.import_file(self.fname, stub.LOADED_ICON + comp_name, + import_options) if not comp: self.log.warning( @@ -87,7 +88,7 @@ class FileLoader(api.Loader): layer_name = container["namespace"] path = api.get_representation_path(representation) # with aftereffects.maintained_selection(): # TODO - stub.replace_item(layer, path, layer_name) + stub.replace_item(layer, path, stub.LOADED_ICON + layer_name) stub.imprint( layer, {"representation": str(representation["_id"]), "name": context["subset"], From d7ab841f61837a83a66cadb53ca7f600cff2e700 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 12 Mar 2021 16:22:43 +0100 Subject: [PATCH 3/3] Remove maya-look-assigner --- repos/maya-look-assigner | 1 - 1 file changed, 1 deletion(-) delete mode 160000 repos/maya-look-assigner diff --git a/repos/maya-look-assigner b/repos/maya-look-assigner deleted file mode 160000 index 7adabe8f0e..0000000000 --- a/repos/maya-look-assigner +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7adabe8f0e6858bfe5b6bf0b39bd428ed72d0452