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

Commit

Permalink
Merge pull request #2548 from pypeclub/feature/extract_reveiew_metada…
Browse files Browse the repository at this point in the history
…ta_update
  • Loading branch information
jakubjezek001 authored Jan 19, 2022
2 parents 45862d4 + 91407aa commit abca1f4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
22 changes: 22 additions & 0 deletions openpype/plugins/publish/extract_otio_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,28 @@ def process(self, instance):
for index, r_otio_cl in enumerate(otio_review_clips):
# QUESTION: what if transition on clip?

# check if resolution is the same
width = self.to_width
height = self.to_height
otio_media = r_otio_cl.media_reference
media_metadata = otio_media.metadata

# get from media reference metadata source
if media_metadata.get("openpype.source.width"):
width = int(media_metadata.get("openpype.source.width"))
if media_metadata.get("openpype.source.height"):
height = int(media_metadata.get("openpype.source.height"))

# compare and reset
if width != self.to_width:
self.to_width = width
if height != self.to_height:
self.to_height = height

self.log.debug("> self.to_width x self.to_height: {} x {}".format(
self.to_width, self.to_height
))

# get frame range values
src_range = r_otio_cl.source_range
start = src_range.start_time.value
Expand Down
23 changes: 15 additions & 8 deletions openpype/plugins/publish/extract_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,21 @@ def main_process(self, instance):
temp_data["frame_start"],
temp_data["frame_end"])

# create or update outputName
output_name = new_repre.get("outputName", "")
output_ext = new_repre["ext"]
if output_name:
output_name += "_"
output_name += output_def["filename_suffix"]
if temp_data["without_handles"]:
output_name += "_noHandles"

# add outputName to anatomy format fill_data
fill_data.update({
"output": output_name,
"ext": output_ext
})

try: # temporary until oiiotool is supported cross platform
ffmpeg_args = self._ffmpeg_arguments(
output_def, instance, new_repre, temp_data, fill_data
Expand All @@ -317,14 +332,6 @@ def main_process(self, instance):
for f in files_to_clean:
os.unlink(f)

output_name = new_repre.get("outputName", "")
output_ext = new_repre["ext"]
if output_name:
output_name += "_"
output_name += output_def["filename_suffix"]
if temp_data["without_handles"]:
output_name += "_noHandles"

new_repre.update({
"name": "{}_{}".format(output_name, output_ext),
"outputName": output_name,
Expand Down

0 comments on commit abca1f4

Please sign in to comment.