mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #48 from pypeclub/fix/AE_DL_comp_name
Fix AD DL comp name
This commit is contained in:
commit
f81a7391a3
6 changed files with 56 additions and 8 deletions
|
|
@ -49,7 +49,7 @@ class CreateRender(openpype.api.Creator):
|
||||||
self.data["uuid"] = item.id # for SubsetManager
|
self.data["uuid"] = item.id # for SubsetManager
|
||||||
stub.imprint(item, self.data)
|
stub.imprint(item, self.data)
|
||||||
stub.set_label_color(item.id, 14) # Cyan options 0 - 16
|
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):
|
def _show_msg(self, txt):
|
||||||
msg = Qt.QtWidgets.QMessageBox()
|
msg = Qt.QtWidgets.QMessageBox()
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class FileLoader(api.Loader):
|
||||||
layer_name = container["namespace"]
|
layer_name = container["namespace"]
|
||||||
path = api.get_representation_path(representation)
|
path = api.get_representation_path(representation)
|
||||||
# with aftereffects.maintained_selection(): # TODO
|
# 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(
|
stub.imprint(
|
||||||
layer, {"representation": str(representation["_id"]),
|
layer, {"representation": str(representation["_id"]),
|
||||||
"name": context["subset"],
|
"name": context["subset"],
|
||||||
|
|
|
||||||
|
|
@ -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"])
|
||||||
|
|
@ -23,6 +23,8 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender):
|
||||||
padding_width = 6
|
padding_width = 6
|
||||||
rendered_extension = 'png'
|
rendered_extension = 'png'
|
||||||
|
|
||||||
|
stub = aftereffects.stub()
|
||||||
|
|
||||||
def get_instances(self, context):
|
def get_instances(self, context):
|
||||||
instances = []
|
instances = []
|
||||||
|
|
||||||
|
|
@ -31,9 +33,9 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender):
|
||||||
asset_entity = context.data["assetEntity"]
|
asset_entity = context.data["assetEntity"]
|
||||||
project_entity = context.data["projectEntity"]
|
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}
|
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')
|
schema = inst.get('schema')
|
||||||
# loaded asset container skip it
|
# loaded asset container skip it
|
||||||
if schema and 'container' in schema:
|
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. " +
|
raise ValueError("Couldn't find id, unable to publish. " +
|
||||||
"Please recreate instance.")
|
"Please recreate instance.")
|
||||||
item_id = inst["members"][0]
|
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
|
frameStart = work_area_info.workAreaStart
|
||||||
|
|
||||||
frameEnd = round(work_area_info.workAreaStart +
|
frameEnd = round(work_area_info.workAreaStart +
|
||||||
|
|
@ -94,6 +96,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender):
|
||||||
|
|
||||||
instances.append(instance)
|
instances.append(instance)
|
||||||
|
|
||||||
|
self.log.debug("instances::{}".format(instances))
|
||||||
return instances
|
return instances
|
||||||
|
|
||||||
def get_expected_files(self, render_instance):
|
def get_expected_files(self, render_instance):
|
||||||
|
|
@ -113,7 +116,7 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender):
|
||||||
end = render_instance.frameEnd
|
end = render_instance.frameEnd
|
||||||
|
|
||||||
# pull file name from Render Queue Output module
|
# 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:
|
if not render_q:
|
||||||
raise ValueError("No file extension set in Render Queue")
|
raise ValueError("No file extension set in Render Queue")
|
||||||
_, ext = os.path.splitext(os.path.basename(render_q.file_name))
|
_, ext = os.path.splitext(os.path.basename(render_q.file_name))
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@ from avalon import aftereffects
|
||||||
class ExtractSaveScene(openpype.api.Extractor):
|
class ExtractSaveScene(openpype.api.Extractor):
|
||||||
"""Save scene before extraction."""
|
"""Save scene before extraction."""
|
||||||
|
|
||||||
order = openpype.api.Extractor.order - 0.49
|
order = openpype.api.Extractor.order - 0.48
|
||||||
label = "Extract Save Scene"
|
label = "Extract Save Scene"
|
||||||
hosts = ["aftereffects"]
|
hosts = ["aftereffects"]
|
||||||
families = ["workfile"]
|
families = ["workfile"]
|
||||||
|
|
||||||
def process(self, instance):
|
def process(self, instance):
|
||||||
aftereffects.stub().save()
|
stub = aftereffects.stub()
|
||||||
|
stub.save()
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue