mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Provided unique file prefix
Limits overwrites from multiple instances
This commit is contained in:
parent
9f2d454f73
commit
cc74f25e7a
1 changed files with 18 additions and 1 deletions
|
|
@ -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,8 @@ class ExtractOTIOReview(publish.Extractor):
|
|||
make_sequence_collection
|
||||
)
|
||||
|
||||
self.temp_file_head = self._get_unique_file_prefix(instance)
|
||||
|
||||
# TODO: convert resulting image sequence to mp4
|
||||
|
||||
# get otio clip and other time info from instance clip
|
||||
|
|
@ -491,3 +492,19 @@ class ExtractOTIOReview(publish.Extractor):
|
|||
out_frame_start = self.used_frames[-1]
|
||||
|
||||
return output_path, out_frame_start
|
||||
|
||||
def _get_unique_file_prefix(self, instance):
|
||||
"""Creates unique human readable file prefix to differentiate.
|
||||
|
||||
Multiple instances might share same temp folder, this will provide
|
||||
unique prefix for intermediate file for burnins.
|
||||
"""
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue