Hiero: fixing review workflow

This commit is contained in:
Jakub Jezek 2021-04-13 16:58:22 +02:00
parent 87ad6fed45
commit 1fef682dfc
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
4 changed files with 19 additions and 6 deletions

View file

@ -675,6 +675,9 @@ class PublishClip:
if kwargs.get("avalon"):
self.tag_data.update(kwargs["avalon"])
# add publish attribute to tag data
self.tag_data.update({"publish": True})
# adding ui inputs if any
self.ui_inputs = kwargs.get("ui_inputs", {})
@ -688,6 +691,7 @@ class PublishClip:
self._create_parents()
def convert(self):
# solve track item data and add them to tag data
self._convert_to_tag_data()
@ -707,6 +711,11 @@ class PublishClip:
else:
self.tag_data["asset"] = self.ti_name
if self.tag_data["heroTrack"] and self.review_layer:
self.tag_data.update({"reviewTrack": self.review_layer})
else:
self.tag_data.update({"reviewTrack": None})
# create pype tag on track_item and add data
lib.imprint(self.track_item, self.tag_data)
@ -862,9 +871,6 @@ class PublishClip:
# add data to return data dict
self.tag_data.update(tag_hierarchy_data)
if hero_track and self.review_layer:
self.tag_data.update({"reviewTrack": self.review_layer})
def _solve_tag_hierarchy_data(self, hierarchy_formating_data):
""" Solve tag data from hierarchy data and templates. """
# fill up clip name and hierarchy keys

View file

@ -84,6 +84,13 @@ def update_tag(tag, data):
mtd = tag.metadata()
# get metadata key from data
data_mtd = data.get("metadata", {})
# due to hiero bug we have to make sure keys which are not existent in
# data are cleared of value by `None`
for _mk in mtd.keys():
if _mk.replace("tag.", "") not in data_mtd.keys():
mtd.setValue(_mk, str(None))
# set all data metadata to tag metadata
for k, v in data_mtd.items():
mtd.setValue(

View file

@ -146,13 +146,13 @@ class PrecollectInstances(pyblish.api.ContextPlugin):
dict: otio clip object
"""
track_name = track_item.parent().name()
ti_track_name = track_item.parent().name()
timeline_range = self.create_otio_time_range_from_timeline_item_data(
track_item)
for otio_clip in otio_timeline.each_clip():
track_name = otio_clip.parent().name
parent_range = otio_clip.range_in_parent()
if track_name not in track_name:
if ti_track_name not in track_name:
continue
if otio_clip.name not in track_item.name():
continue

View file

@ -15,7 +15,7 @@ class CollectHierarchy(pyblish.api.ContextPlugin):
label = "Collect Hierarchy"
order = pyblish.api.CollectorOrder - 0.57
families = ["shot"]
hosts = ["resolve"]
hosts = ["resolve", "hiero"]
def process(self, context):
temp_context = {}