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.
This commit is contained in:
Jakub Jezek 2025-10-21 11:14:10 +02:00
parent afee12cd7a
commit 0d49f5a8df
No known key found for this signature in database
GPG key ID: 06DBD609ADF27FD9

View file

@ -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