Merge pull request #845 from ynput/enhancement/AY-6027_Wrong-name-in-mp4-produced-during-the-publishing

Provided unique folder name based file prefix in Extract OTIO review
This commit is contained in:
Petr Kalis 2024-09-05 12:50:17 +02:00 committed by GitHub
commit 364842d37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,6 @@ class ExtractOTIOReview(publish.Extractor):
hosts = ["resolve", "hiero", "flame"]
# plugin default attributes
temp_file_head = "tempFile."
to_width = 1280
to_height = 720
output_ext = ".jpg"
@ -62,6 +61,9 @@ class ExtractOTIOReview(publish.Extractor):
make_sequence_collection
)
# TODO refactore from using instance variable
self.temp_file_head = self._get_folder_name_based_prefix(instance)
# TODO: convert resulting image sequence to mp4
# get otio clip and other time info from instance clip
@ -491,3 +493,21 @@ class ExtractOTIOReview(publish.Extractor):
out_frame_start = self.used_frames[-1]
return output_path, out_frame_start
def _get_folder_name_based_prefix(self, instance):
"""Creates 'unique' human readable file prefix to differentiate.
Multiple instances might share same temp folder, but each instance
would be differentiated by asset, eg. folder name.
It ix expected that there won't be multiple instances for same asset.
"""
folder_path = instance.data["folderPath"]
folder_name = folder_path.split("/")[-1]
folder_path = folder_path.replace("/", "_").lstrip("_")
file_prefix = f"{folder_path}_{folder_name}."
self.log.debug(f"file_prefix::{file_prefix}")
return file_prefix