From 6e618c6f10f9070384ea023e87f8939f41217fec Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 3 Dec 2020 13:16:22 +0100 Subject: [PATCH] feat(resolve): adding before if timeline start lower then clip start --- pype/hosts/resolve/otio.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pype/hosts/resolve/otio.py b/pype/hosts/resolve/otio.py index 782775253e..71cdbcc97b 100644 --- a/pype/hosts/resolve/otio.py +++ b/pype/hosts/resolve/otio.py @@ -185,6 +185,7 @@ def get_otio_clip_instance_data(track_item_data): track_name = track_item_data["track"]["name"] track_index = track_item_data["track"]["index"] + timeline_start = timeline.GetStartFrame() frame_start = track_item.GetStart() frame_duration = track_item.GetDuration() project_fps = project.GetSetting("timelineFrameRate") @@ -197,6 +198,19 @@ def get_otio_clip_instance_data(track_item_data): otio_track = create_otio_track( track_type, "{}{}".format(track_name, track_index)) + # add gap if track item is not starting from timeline start + # if gap between track start and clip start + if frame_start > timeline_start: + # create gap and add it to track + otio_track.append( + create_otio_gap( + 0, + frame_start, + timeline_start, + project_fps + ) + ) + # create otio clip otio_clip = create_otio_clip(track_item)