TimelineItem
TimelineItem
Basic Info
GetName()
Return: string
Returns a name of the item.
GetDuration()
Return: int
Returns a duration of item.
GetStart()
Return: int
Returns a position of first frame.
GetEnd()
Return: int
Returns a position of end frame.
GetLeftOffset()
Return: int
Returns a maximum extension by frame for clip from left side.
GetRightOffset()
Return: int
Returns a maximum extension by frame for clip from right side.
GetMediaPoolItem()
Return: MediaPoolItem
Returns a corresponding to the timeline item media pool item if it exists.
SetLUT(nodeIndex, lutPath)
Return: Bool
Note
nodeIndex
start from 1
instead of 0
since 16.2
Sets LUT on the node mapping the node index provided.
The lutPath can be a relative path or absolute path.
The operation will be successful for valid lut paths that Resolve has already discovered.
SetCDL([CDL map])
Return: Bool
Keys of map are:
- "NodeIndex"
- "Slope"
- "Offset"
- "Power"
- "Saturation"
Note
nodeIndex
start from 1
instead of 0
since 16.2
Example python code :
SetCDL({"NodeIndex" : "0", # 16.2 之后从 1 开始
"Slope" : "0.5 0.4 0.2",
"Offset" : "0.4 0.3 0.2",
"Power" : "0.6 0.7 0.8",
"Saturation" : "0.65"})
CopyGrades([tgtTimelineItems])
Return: Bool
Copies grade to all the items in tgtTimelineItems list.
Returns true on success and false if any error occured.
GetStereoConvergenceValues()
Return: {keyframes...}
Returns a table of keyframe offsets and respective convergence values
Note
Before 16.2
, return [offset, value]
GetStereoLeftFloatingWindowParams()
Return: {keyframes...}
For the LEFT eye -> returns a dict (offset -> dict) of keyframe offsets and respective floating window params.
Value at particular offset includes the left, right, top and bottom floating window values.
Note
Before 16.2
, return [offset, value]
For the LEFT eye returns a table of keyframe offsets and respective floating window params.
Value at particular offset includes the left, right, top and bottom floating window values
GetStereoRightFloatingWindowParams()
Return: {keyframes...}
For the RIGHT eye -> returns a dict (offset -> dict) of keyframe offsets and respective floating window params.
Value at particular offset includes the left, right, top and bottom floating window values
Note
Before16.2
, return [offset, value]
For the RIGHT eye returns a table of keyframe offsets and respective floating window params.
Value at particular offset includes the left, right, top and bottom floating window values.
Maker Related
GetMarkers()
Return: {markers...}
Returns a dict (frameId -> {information}) of all markers and dicts with their information.
{
96.0:
{
'color': 'Green',
'duration': 1.0,
'note': '',
'name': 'Marker 1',
'customData': ''
},
# ...
}
In the above example - there is one 'Green' marker at offset 96 (position of the marker)
Note
Before 16.2
, return list [markers...]
Returns a list of all markers and their information.
GetMarkerByCustomData(customData)
Return: {markers...}
Returns marker {information} for the first matching marker with specified customData.
GetMarkerCustomData(frameId)
Return: string
Returns customData string for the marker at given frameId position.
UpdateMarkerCustomData(frameId, customData)
Return: Bool
Updates customData (string) for the marker at given frameId position.
CustomData is not exposed via UI and is useful for scripting developer to attach any user specific data to markers.
AddMarker(frameId, color, name, note, duration,customData)
Return: Bool
Creates a new marker at given frameId position and with given marker information.
customData
is optional and helps to attach user specific data to the marker.
DeleteMarkersByColor(color)
Return: Bool
Delete all markers of the specified color from the timeline item. "All" as argument deletes all color markers.
DeleteMarkerAtFrame(frameNum)
Return: Bool
Delete marker at frame number from the timeline item.
DeleteMarkerByCustomData(customData)
Return: Bool
Delete first matching marker with specified customData.
Flag Related
AddFlag(color)
Return: Bool
Adds a flag with given color (text).
GetFlagList()
Return: [colors...]
Returns a list of flag colors assigned to the item.
Note
Old version GetFlags()
Deprecated
ClearFlags(color)
Return: Bool
Clears the flag of specified color from an item. If "All" argument is provided, all flags will be cleared.
Clip Color Related
GetClipColor()
Return: string
Returns an item color as a string.
SetClipColor(colorName)
Return: Bool
Sets color of an item based on the colorName (string).
ClearClipColor()
Return: Bool
Clears clip color of an item.
Version Related
AddVersion(versionName, versionType)
Return: Bool
Adds a new Version associated with the timeline item. versionType:
- 0 - local
- 1 - remote.
DeleteVersionByName(versionName, versionType)
Return: Bool
Deletes Version by provided name. versionType:
- 0 - local
- 1 - remote.
LoadVersionByName(versionName, versionType)
Return: Bool
Loads Version by provided name and sets it as active Version. versionType:
- 0 - local
- 1 - remote.
RenameVersionByName(oldName, newName, versionType)
Return: Bool
Renames Version by provided name with new given name. versionType:
- 0 - local
- 1 - remote.
GetVersionNameList(versionType)
Return: [names...]
Returns a list of version names by provided versionType:
- 0 - local
- 1 - remote.
Note
Old version GetVersionNames(versionType)
Deprecated
Take Related
AddTake(mediaPoolItem, startFrame, endFrame)
Return: Bool
Adds a new take to take selector. It will initialise this timeline item as take selector if it's not already one.
Arguments startFrame and endFrame are optional, and if not specified the entire clip will be added.
GetSelectedTakeIndex()
Return: int
Returns the index of currently selected take, or 0 if the clip is not a take selector.
GetTakesCount()
Return: int
Returns the number of takes in take selector, or 0 if the clip is not a take selector.
GetTakeByIndex(idx)
Return: map
Returns a map with take info for specified index, with keys:
- "mediaPoolItem"
- "startFrame"
- "endFrame"
DeleteTakeByIndex(idx)
Return: Bool
Deletes a take by index, 1 <= idx <= number of takes.
SelectTakeByIndex(idx)
Return: Bool
Selects a take by index, 1 <= idx <= number of takes.
FinalizeTake()
Return: Bool
Finalizes take selection.
Fusion Related
GetFusionCompCount()
Return: int
Returns the number of Fusion compositions associated with the timeline item.
GetFusionCompByIndex(compIndex)
Return: fusionComp
Returns Fusion composition object based on given index.
1 <= compIndex <= timelineItem.GetFusionCompCount()
GetFusionCompNameList()
Return: [names...]
Returns a list of Fusion composition names associated with the timeline item.
Note
Old version GetFusionCompNames()
Deprecated
GetFusionCompByName(compName)
Return: fusionComp
Returns Fusion composition object based on given name.
AddFusionComp()
Return: fusionComp
Adds a new Fusion composition associated with the timeline item.
ImportFusionComp(path)
Return: fusionComp
Imports Fusion composition from given file path by creating and adding a new composition for the item.
ExportFusionComp(path, compIndex)
Return: fusionComp
Exports Fusion composition based on given index into provided file name path.
DeleteFusionCompByName(compName)
Return: Bool
Deletes Fusion composition by provided name.
LoadFusionCompByName(compName)
Return: fusionComp
Loads Fusion composition by provided name and sets it as active composition.
RenameFusionCompByName(oldName, newName)
Return: Bool
Renames Fusion composition by provided name with new given name.