Skip to content

Commit

Permalink
Update client/ayon_flame/otio/flame_export.py
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Trllo <[email protected]>
  • Loading branch information
robin-ynput and iLLiCiTiT authored Dec 2, 2024
1 parent 8127064 commit d149214
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions client/ayon_flame/otio/flame_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,19 +568,13 @@ def _distribute_segments_on_track(segments, otio_track):
"""
if not segments:
return

prev_item_record_out = segments[0]["record_out"]
for itemindex, segment_data in enumerate(segments):
log.debug("_ itemindex: %d", itemindex)
log.debug("_ segment_data: %r", segment_data)

prev_item = (
segment_data
if itemindex == 0
else segments[itemindex - 1]
)

# calculate clip frame range difference from each other
clip_diff = segment_data["record_in"] - prev_item["record_out"]
clip_diff = segment_data["record_in"] - prev_item_record_out

# initial track gap
# add gap if first track item is not starting
Expand All @@ -593,12 +587,13 @@ def _distribute_segments_on_track(segments, otio_track):
# frame range differences from each other
elif itemindex and clip_diff != 1:
add_otio_gap(
segment_data, otio_track, prev_item["record_out"])
segment_data, otio_track, prev_item_record_out)

# create otio clip and add it to track
otio_clip = create_otio_clip(segment_data)
log.debug("_ otio_clip: %r", otio_clip)
otio_track.append(otio_clip)
prev_item_record_out = segment_data["record_out"]


def create_otio_timeline(sequence):
Expand Down

0 comments on commit d149214

Please sign in to comment.