diff --git a/openpype/hosts/aftereffects/plugins/create/create_render.py b/openpype/hosts/aftereffects/plugins/create/create_render.py index b8fc747670..bb78e89a89 100644 --- a/openpype/hosts/aftereffects/plugins/create/create_render.py +++ b/openpype/hosts/aftereffects/plugins/create/create_render.py @@ -49,7 +49,7 @@ class CreateRender(openpype.api.Creator): 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"]) + stub.rename_item(item.id, stub.PUBLISH_ICON + self.data["subset"]) def _show_msg(self, txt): msg = Qt.QtWidgets.QMessageBox() diff --git a/openpype/hosts/aftereffects/plugins/load/load_file.py b/openpype/hosts/aftereffects/plugins/load/load_file.py index 74de6b7ac1..e63a538e7b 100644 --- a/openpype/hosts/aftereffects/plugins/load/load_file.py +++ b/openpype/hosts/aftereffects/plugins/load/load_file.py @@ -88,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, stub.LOADED_ICON + layer_name) + stub.replace_item(layer.id, path, stub.LOADED_ICON + layer_name) stub.imprint( layer, {"representation": str(representation["_id"]), "name": context["subset"], diff --git a/openpype/hosts/aftereffects/plugins/publish/add_publish_highlight.py b/openpype/hosts/aftereffects/plugins/publish/add_publish_highlight.py new file mode 100644 index 0000000000..2425f72e3e --- /dev/null +++ b/openpype/hosts/aftereffects/plugins/publish/add_publish_highlight.py @@ -0,0 +1,21 @@ +import pyblish.api + +from avalon import aftereffects + + +class AddPublishHighlight(pyblish.api.InstancePlugin): + """ + Revert back rendered comp name and add publish highlight + """ + + label = "Add render highlight" + order = pyblish.api.IntegratorOrder + 8.0 + hosts = ["aftereffects"] + families = ["render.farm"] + optional = True + + def process(self, instance): + stub = aftereffects.stub() + item = instance.data + # comp name contains highlight icon + stub.rename_item(item["comp_id"], item["comp_name"]) diff --git a/openpype/hosts/aftereffects/plugins/publish/collect_render.py b/openpype/hosts/aftereffects/plugins/publish/collect_render.py index 59660a9bdc..4a124991fd 100644 --- a/openpype/hosts/aftereffects/plugins/publish/collect_render.py +++ b/openpype/hosts/aftereffects/plugins/publish/collect_render.py @@ -23,6 +23,8 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): padding_width = 6 rendered_extension = 'png' + stub = aftereffects.stub() + def get_instances(self, context): instances = [] @@ -31,9 +33,9 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): asset_entity = context.data["assetEntity"] project_entity = context.data["projectEntity"] - compositions = aftereffects.stub().get_items(True) + compositions = self.stub.get_items(True) compositions_by_id = {item.id: item for item in compositions} - for inst in aftereffects.stub().get_metadata(): + for inst in self.stub.get_metadata(): schema = inst.get('schema') # loaded asset container skip it if schema and 'container' in schema: @@ -43,7 +45,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): raise ValueError("Couldn't find id, unable to publish. " + "Please recreate instance.") item_id = inst["members"][0] - work_area_info = aftereffects.stub().get_work_area(int(item_id)) + work_area_info = self.stub.get_work_area(int(item_id)) frameStart = work_area_info.workAreaStart frameEnd = round(work_area_info.workAreaStart + @@ -94,6 +96,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): instances.append(instance) + self.log.debug("instances::{}".format(instances)) return instances def get_expected_files(self, render_instance): @@ -113,7 +116,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender): end = render_instance.frameEnd # pull file name from Render Queue Output module - render_q = aftereffects.stub().get_render_info() + render_q = self.stub.get_render_info() if not render_q: raise ValueError("No file extension set in Render Queue") _, ext = os.path.splitext(os.path.basename(render_q.file_name)) diff --git a/openpype/hosts/aftereffects/plugins/publish/extract_save_scene.py b/openpype/hosts/aftereffects/plugins/publish/extract_save_scene.py index fa6ad37073..5418ea6299 100644 --- a/openpype/hosts/aftereffects/plugins/publish/extract_save_scene.py +++ b/openpype/hosts/aftereffects/plugins/publish/extract_save_scene.py @@ -5,10 +5,11 @@ from avalon import aftereffects class ExtractSaveScene(openpype.api.Extractor): """Save scene before extraction.""" - order = openpype.api.Extractor.order - 0.49 + order = openpype.api.Extractor.order - 0.48 label = "Extract Save Scene" hosts = ["aftereffects"] families = ["workfile"] def process(self, instance): - aftereffects.stub().save() + stub = aftereffects.stub() + stub.save() diff --git a/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py b/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py new file mode 100644 index 0000000000..291f22e3b8 --- /dev/null +++ b/openpype/hosts/aftereffects/plugins/publish/remove_publish_highlight.py @@ -0,0 +1,23 @@ +import openpype.api +from avalon import aftereffects + + +class RemovePublishHighlight(openpype.api.Extractor): + """Clean utf characters which are not working in DL + + Published compositions are marked with unicode icon which causes + problems on specific render environments. Clean it first, sent to + rendering, add it later back to avoid confusion. + """ + + order = openpype.api.Extractor.order - 0.49 # just before save + label = "Clean render comp" + hosts = ["aftereffects"] + families = ["render.farm"] + + def process(self, instance): + stub = aftereffects.stub() + self.log.debug("instance::{}".format(instance.data)) + item = instance.data + comp_name = item["comp_name"].replace(stub.PUBLISH_ICON, '') + stub.rename_item(item["comp_id"], comp_name)