
I had a look at the Resolve executable and found some API functions that aren't yet listed in the API documentation.
After some trial and error I was able to work out the parameters needed.
It all seems to work just fine, but since it's not documented you should probably expect changes in later releases.
Here's the same list in a similar form as the API readme (including the possible values for trackType and audioChannelSubType that I could find):
Updated for DaVinci Resolve 18.1
After some trial and error I was able to work out the parameters needed.
- Timeline
- bool AddTrack(string trackType, string audioChannelSubType)
- bool DeleteTrack(string trackType, int index)
- bool SetTrackEnable(string trackType, int index, bool enable)
- bool GetIsTrackEnabled(string trackType, int index)
- bool SetTrackLock(string trackType, int index, bool lock)
- bool GetIsTrackLocked(string trackType, int index)
- bool SetClipsLinked(table items, bool link)
- bool AddTrack(string trackType, string audioChannelSubType)
- TimelineItem
- bool GetClipEnabled()
- bool SetClipEnabled(bool enable)
- bool SetNodeLocked(int nodeIndex, bool lock)
- bool GetClipEnabled()
- MediaPool
- table TimelineItem AppendToTimeline(table clipInfo)
In addition to the documented clipInfo properties; mediaPoolItem, startFrame, endFrame and mediaType, it also accepts trackIndex and recordFrame. This means we can finally place clips anywhere on the timeline!
- table TimelineItem AppendToTimeline(table clipInfo)
It all seems to work just fine, but since it's not documented you should probably expect changes in later releases.
Here's the same list in a similar form as the API readme (including the possible values for trackType and audioChannelSubType that I could find):
- Code: Select all
Timeline
AddTrack(trackType, audioChannelSubType) --> Bool # Adds a track of the given type ("audio", "video" or "subtitle") to the timeline. The audioChannelSubType is only needed for audio tracks and is one of "mono", "stereo", "5.1film", "7.1film", or "adaptive1" to "adaptive24".
DeleteTrack(trackType, index) --> Bool # Deletes a track of the given type at the specified index (int). 1 <= index <= GetTrackCount(trackType)
SetTrackEnable(trackType, index, enable) --> Bool # Enables or disables the given track. The enable parameter is a boolean value.
GetIsTrackEnabled(trackType, index) --> Bool # Returns whether a track is enabled or not.
SetTrackLock(trackType, index, lock) --> Bool # Locks or unlocks the given track. The lock parameter is a boolean value.
GetIsTrackLocked(trackType, index) --> Bool # Returns whether a track is locked or not.
SetClipsLinked([items], link) --> Bool # Links or unlinks the given clips (TimelineItem objects). The link parameter is a boolean value.
TimelineItem
GetClipEnabled() --> Bool # Returns whether a clip is enabled or not.
SetClipEnabled(enable) --> Bool # Enables or disables a clips. The enable parameter is a boolean value.
SetNodeLocked(nodeIndex, lock) --> Bool # Locks or unlocks a Color page node at the given nodeIndex (int). The lock parameter is a boolean value.
Updated for DaVinci Resolve 18.1
Last edited by roger.magnusson on Thu Dec 08, 2022 8:40 pm, edited 2 times in total.