Timeline
Timeline
GetName()
返回值:string
Returns user-defined name of the timeline.
SetName(timelineName)
返回值:Bool
Sets timeline name is timelineName (text) is unique.
GetStartFrame()
返回值:int
Returns frame number at the start of timeline.
GetEndFrame()
返回值:int
Returns frame number at the end of timeline.
GetCurrentTimecode()
返回值: string
Returns a string representing a timecode for current position of the timeline, while on Cut, Edit, Color and Deliver page.
GetCurrentVideoItem()
返回值: item
Returns current video timeline item.
GetCurrentClipThumbnailImage()
返回值: [width, height, format, data]
Returns raw thumbnail image data (This image data is encoded in base 64 format and the image format is RGB 8 bit) for the current media in the Color Page in the format of dictionary (in Python) and table (in Lua).
Information return are:
- "width"
- "height"
- "format"
- "data"
Example is provided in6_get_current_media_thumbnail.py
链接 in Example folder.
GetTrackCount(trackType)
返回值:int
Returns a number of track based on specified track type:
- "audio"
- "video"
- "subtitle"
GetItemListInTrack(trackType, index)
返回值:[items...]
Returns an array of Timeline items on the video or audio track (based on trackType) at specified index.
1 <= index <= GetTrackCount(trackType).
注意
旧版本 GetItemsInTrack(trackType, index)
已弃用
GetTrackName(trackType, trackIndex)
返回值: string
Returns the track name for track indicated by trackType ("audio", "video" or "subtitle") and index. 1 <= trackIndex <= GetTrackCount(trackType).
SetTrackName(trackType, trackIndex, name)
返回值: Bool
Sets the track name (string) for track indicated by trackType ("audio", "video" or "subtitle") and index. 1 <= trackIndex <= GetTrackCount(trackType).
DuplicateTimeline(timelineName)
返回值: timeline
Duplicates the timeline and returns the created timeline, with the (optional) timelineName, on success.
CreateCompoundClip([timelineItems], {clipInfo})
返回值: timelineItem
Creates a compound clip of input timeline items with an optional clipInfo map: {"startTimecode" : "00:00:00:00", "name" : "Compound Clip 1"}. It returns the created timeline item.
CreateFusionClip([timelineItems])
返回值: timelineItem
Creates a Fusion clip of input timeline items. It returns the created timeline item.
Export(fileName, exportType, exportSubtype)
返回值: Bool
Exports timeline to 'fileName' as per input exportType & exportSubtype format.
exportType
can be one of the following constants:
- resolve.EXPORT_AAF
- resolve.EXPORT_DRT
- resolve.EXPORT_EDL
- resolve.EXPORT_FCP_7_XML
- resolve.EXPORT_FCPXML_1_3
- resolve.EXPORT_FCPXML_1_4
- resolve.EXPORT_FCPXML_1_5
- resolve.EXPORT_FCPXML_1_6
- resolve.EXPORT_FCPXML_1_7
- resolve.EXPORT_FCPXML_1_8
- resolve.EXPORT_HDR_10_PROFILE_A
- resolve.EXPORT_HDR_10_PROFILE_B
- resolve.EXPORT_TEXT_CSV
- resolve.EXPORT_TEXT_TAB
- resolve.EXPORT_DOLBY_VISION_VER_2_9
- resolve.EXPORT_DOLBY_VISION_VER_4_0
exportSubtype
can be one of the following enums:
- resolve.EXPORT_AAF_NEW
- resolve.EXPORT_AAF_EXISTING
- resolve.EXPORT_CDL
- resolve.EXPORT_SDL
- resolve.EXPORT_MISSING_CLIPS
- resolve.EXPORT_NONE
Please note that exportSubType
is a required parameter for resolve.EXPORT_AAF
and resolve.EXPORT_EDL
.
For rest of the exportType
, exportSubtype
is ignored.
When exportType
is resolve.EXPORT_AAF
, valid exportSubtype
values are:
resolve.EXPORT_AAF_NEW
resolve.EXPORT_AAF_EXISTING
When exportType
is resolve.EXPORT_EDL
, valid exportSubtype
values are:
resolve.EXPORT_CDL
resolve.EXPORT_SDL
resolve.EXPORT_MISSING_CLIPS
resolve.EXPORT_NONE
注
Replace 'resolve.' when using the constants above, if a different Resolve class instance name is used.
ApplyGradeFromDRX(path, gradeMode, item1, item2, ...)
返回值:Bool
Loads a still from given file path (string) and applies grade to Timeline Items with gradeMode (int):
- 0 - "No keyframes"
- 1 - "Source Timecode aligned"
- 2 - "Start Frames aligned".
ApplyGradeFromDRX(path, gradeMode, [items])
返回值:Bool
Loads a still from given file path (string) and applies grade to Timeline Items with gradeMode (int):
- 0 - "No keyframes"
- 1 - "Source Timecode aligned"
- 2 - "Start Frames aligned".
Maker 相关
GetMarkers()
返回值:{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)
注意
在版本16.2
之前,返回值为列表 [markers...]
Returns a list of all markers and their information.
GetMarkerByCustomData(customData)
返回值: {markers...}
Returns marker {information} for the first matching marker with specified customData.
GetMarkerCustomData(frameId)
返回值: string
Returns customData string for the marker at given frameId position.
UpdateMarkerCustomData(frameId, customData)
返回值: 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)
返回值: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)
返回值: Bool
Deletes all timeline markers of the specified color. An "All" argument is supported and deletes all timeline markers.
DeleteMarkerAtFrame(frameNum)
返回值: Bool
Deletes the timeline marker at the given frame number.
DeleteMarkerByCustomData(customData)
返回值: Bool
Delete first matching marker with specified customData.