Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
feat(hiero): adding review collection and processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubjezek001 committed Nov 18, 2020
1 parent 2c2e434 commit fb6619f
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 375 deletions.
259 changes: 0 additions & 259 deletions pype/plugins/hiero/_publish/collect_review.py

This file was deleted.

4 changes: 3 additions & 1 deletion pype/plugins/hiero/publish/collect_frame_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def process(self, instance):
"frameEnd": frame_end,

"clipDuration": clip_duration,
"clipDurationH": clip_duration_h
"clipDurationH": clip_duration_h,

"fps": instance.context.data["fps"]
})
self.log.info("Frame range data for instance `{}` are: {}".format(
instance, data))
Expand Down
43 changes: 38 additions & 5 deletions pype/plugins/hiero/publish/collect_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,29 @@ def process(self, context):
self.log.info(
"Processing enabled track items: {}".format(len(track_items)))

for _ti in track_items:
track_items_review_cleared = list()
review_track_items = dict()
for __ti in track_items:
# get pype tag data
tag_parsed_data = phiero.get_track_item_pype_data(__ti)
# self.log.debug(pformat(tag_parsed_data))

if tag_parsed_data.get("id") != "pyblish.avalon.instance":
continue

asset = tag_parsed_data["asset"]
review = tag_parsed_data["review"]
master_layer = tag_parsed_data["masterLayer"]
track = __ti.parent()
# skip instance creation if review and not master track
if review and not master_layer and "review" in track.name():
review_track_items.update({
asset: __ti
})
else:
track_items_review_cleared.append(__ti)

for _ti in track_items_review_cleared:
data = dict()

# get pype tag data
Expand All @@ -48,11 +70,13 @@ def process(self, context):

asset = tag_parsed_data["asset"]
subset = tag_parsed_data["subset"]
review = tag_parsed_data["review"]
master_layer = tag_parsed_data["masterLayer"]

# insert family into families
family = tag_parsed_data["family"]
families = tag_parsed_data["families"]
families.insert(0, family)
families = [str(f) for f in tag_parsed_data["families"]]
families.insert(0, str(family))

track = _ti.parent()
source = _ti.source().mediaSource()
Expand All @@ -61,8 +85,16 @@ def process(self, context):
file_info = next((f for f in source.fileinfos()), None)
source_first_frame = int(file_info.startFrame())

# apply only for feview and master track instance
if review and master_layer:
families += ["review", "ftrack"]
data.update({
"reviewItem": review_track_items[asset],
"reviewItemData": dict()
})

data.update({
"name": "{}_{}".format(asset, subset),
"name": "{} {} {}".format(asset, subset, families),
"asset": asset,
"item": _ti,
"families": families,
Expand All @@ -79,11 +111,12 @@ def process(self, context):
},

# source attribute
"source": source,
"source": source_path,
"sourcePath": source_path,
"sourceFileHead": file_head,
"sourceFirst": source_first_frame,
})

instance = context.create_instance(**data)

self.log.info("Creating instance: {}".format(instance))
Expand Down
Loading

0 comments on commit fb6619f

Please sign in to comment.