Skip to content

Commit

Permalink
Merge pull request #17 from ynput/enhancement/fix_custom_otio_export
Browse files Browse the repository at this point in the history
Fix timecode detection and image sequence source range on OTIO AYON exporter for Hiero.
  • Loading branch information
jakubjezek001 authored Nov 4, 2024
2 parents f157ca2 + ece1fd1 commit 28404a9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions client/ayon_hiero/api/otio/hiero_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def create_otio_reference(clip):

# get file info for path and start frame
file_info = media_source.fileinfos().pop()
frame_start = file_info.startFrame()
start_frame = file_info.startFrame()
timecode_start = media_source.timecodeStart()
path = file_info.filename()

# get padding and other file infos
Expand Down Expand Up @@ -168,11 +169,11 @@ def create_otio_reference(clip):
target_url_base=dirname + os.sep,
name_prefix=file_head,
name_suffix=extension,
start_frame=frame_start,
start_frame=start_frame,
frame_zero_padding=padding,
rate=fps,
available_range=create_otio_time_range(
frame_start,
timecode_start,
frame_duration,
fps
)
Expand All @@ -186,7 +187,7 @@ def create_otio_reference(clip):
otio_ex_ref_item = otio.schema.ExternalReference(
target_url=reformat_path,
available_range=create_otio_time_range(
frame_start,
timecode_start,
frame_duration,
fps
)
Expand Down Expand Up @@ -265,9 +266,12 @@ def create_otio_clip(track_item):
name = track_item.name()

media_reference = create_otio_reference(clip)
available_start = media_reference.available_range.start_time
conformed_start_value = available_start.value_rescaled_to(fps)

source_range = create_otio_time_range(
int(source_in),
int(duration),
conformed_start_value + source_in,
duration,
fps
)

Expand Down

0 comments on commit 28404a9

Please sign in to comment.