add clip to timeline in correct place

This commit is contained in:
Jakub Jezek 2023-09-29 17:33:27 +02:00
parent d83eb73e04
commit 759dc59132
No known key found for this signature in database
GPG key ID: 730D7C02726179A7
2 changed files with 17 additions and 2 deletions

View file

@ -246,7 +246,8 @@ def get_media_pool_item(fpath, root: object = None) -> object:
def create_timeline_item(media_pool_item: object,
timeline: object = None,
source_start: int = None,
source_end: int = None) -> object:
source_end: int = None,
timeline_in: int = None) -> object:
"""
Add media pool item to current or defined timeline.
@ -278,6 +279,12 @@ def create_timeline_item(media_pool_item: object,
clip_data.update({"endFrame": source_end})
print(clip_data)
if timeline_in:
timeline_start = timeline.GetStartFrame()
# Create a clipInfo dictionary with the necessary information
clip_data["recordFrame"] = int(timeline_start + timeline_in)
# add to timeline
media_pool.AppendToTimeline([clip_data])