Merge pull request #2548 from pypeclub/feature/extract_reveiew_metadata_update

This commit is contained in:
Jakub Ježek 2022-01-19 14:10:33 +01:00 committed by GitHub
commit abca1f413a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 8 deletions

View file

@ -85,6 +85,28 @@ class ExtractOTIOReview(openpype.api.Extractor):
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

View file

@ -292,6 +292,21 @@ class ExtractReview(pyblish.api.InstancePlugin):
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
@ -317,14 +332,6 @@ class ExtractReview(pyblish.api.InstancePlugin):
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,