AppendToTimeline([{clipInfo}, ...])
Appends list of clipInfos specified as dict of "mediaPoolItem", "startFrame" (float/int), "endFrame" (float/int), (optional) "mediaType" (int; 1 - Video only, 2 - Audio only), "trackIndex" (int) and "recordFrame" (float/int). Returns the list of appended timelineItems.
- Code: Select all
projectManager = resolve.GetProjectManager()
project = projectManager.GetCurrentProject()
mediapool = project.GetMediaPool()
currFolder = mediapool.GetCurrentFolder()
clips = currFolder.GetClipList()
mediapool.AppendToTimeline([{'mediaPoolItem': clips[0], 'startFrame': 0, 'endFrame': 25, 'recordFrame': 90000, 'mediaType': 1, 'trackIndex': 2}])
This code will append the first 25 frames of the first clip in the current bin to frame 90000 of the current timeline on V2.
'recordFrame': 90000 equals to timecode 01:00:00:00 in a 25p timeline
To get the startframe of your timeline:
- Code: Select all
timeline = project.GetCurrentTimeline()
print(timeline.GetStartFrame())