mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
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:
parent
afee12cd7a
commit
0d49f5a8df
1 changed files with 9 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue