Script access to timeline items

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

hpJohn

  • Posts: 1
  • Joined: Tue Nov 06, 2018 4:10 pm
  • Real Name: John Pope

Script access to timeline items

PostTue Nov 06, 2018 4:51 pm

Im trying to programmatically set keyframes for timeline clips, for things like Transform->Position/Zoom and Composite->Opacity

Using the following script I can access the timeline item, but none of the members of 'Timeline item' (GetDuration, GetFlags, GetMarkers, etc) appear to point to these properties. How can I modify these values?

It would also be useful if, instead of "timeline.GetItemsInTrack("video",1)" I could use something like "GetCurrentlySelectedItem()" but that also seems un-doable.

Code: Select all
import imp
dr = imp.load_source('DaVinciResolveScript', 'C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting\Modules\DaVinciResolveScript.py')
resolve = dr.scriptapp('Resolve')

projectManager = resolve.GetProjectManager()
project = projectManager.GetCurrentProject()
timeline = project.GetCurrentTimeline()

items = timeline.GetItemsInTrack("video",1)
item = items[1]
print(item.GetName()) #Item successfully acquired


Image

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 1 guest