From 0d49f5a8dfda7b2b3b5189befbdf4ac34388c5e4 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 21 Oct 2025 11:14:10 +0200 Subject: [PATCH] Fixes: Corrects file sequence frame offset Corrects the calculation of the frame offset for file sequences in editorial workflows. - Ensures accurate frame mapping. - Resolves issues with incorrect frame ranges. --- client/ayon_core/pipeline/editorial.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/pipeline/editorial.py b/client/ayon_core/pipeline/editorial.py index b553fae3fb..716035aa1c 100644 --- a/client/ayon_core/pipeline/editorial.py +++ b/client/ayon_core/pipeline/editorial.py @@ -202,7 +202,8 @@ def is_clip_from_media_sequence(otio_clip): def remap_range_on_file_sequence(otio_clip, otio_range): - """ + """ Remap the provided range on a file sequence clip. + Args: otio_clip (otio.schema.Clip): The OTIO clip to check. otio_range (otio.schema.TimeRange): The trim range to apply. @@ -256,10 +257,14 @@ def remap_range_on_file_sequence(otio_clip, otio_range): ) src_offset_in = otio_range.start_time - media_in - frame_in = otio.opentime.RationalTime.from_frames( - media_ref.start_frame + src_offset_in.to_frames(), + # make sure that only if any offset is present + if media_ref.start_frame == src_offset_in.to_frames(): + frame_in = src_offset_in.to_frames() + else: + frame_in = otio.opentime.RationalTime.from_frames( + media_ref.start_frame + src_offset_in.to_frames(), rate=available_range_rate, - ).to_frames() + ).to_frames() # e.g.: # duration = 10 frames at 24fps