Timeline

Yanru MuAbout 4 min

Timeline

GetName()

Return: string

Returns user-defined name of the timeline.

SetName(timelineName)

Return: Bool

Sets timeline name is timelineName (text) is unique.

GetStartFrame()

Return: int

Returns frame number at the start of timeline.

GetEndFrame()

Return: int

Returns frame number at the end of timeline.

GetCurrentTimecode()

Return: string

Returns a string representing a timecode for current position of the timeline, while on Cut, Edit, Color and Deliver page.

GetCurrentVideoItem()

Return: item

Returns current video timeline item.

GetCurrentClipThumbnailImage()

Return: [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 in 6_get_current_media_thumbnail.py in Example folder.

GetTrackCount(trackType)

Return: int

Returns a number of track based on specified track type:

  • "audio"
  • "video"
  • "subtitle"

GetItemListInTrack(trackType, index)

Return: [items...]

Returns an array of Timeline items on the video or audio track (based on trackType) at specified index.

1 <= index <= GetTrackCount(trackType).

Note

Older version GetItemsInTrack(trackType, index) Deprecated

GetTrackName(trackType, trackIndex)

Return: string

Returns the track name for track indicated by trackType ("audio", "video" or "subtitle") and index. 1 <= trackIndex <= GetTrackCount(trackType).

SetTrackName(trackType, trackIndex, name)

Return: Bool

Sets the track name (string) for track indicated by trackType ("audio", "video" or "subtitle") and index. 1 <= trackIndex <= GetTrackCount(trackType).

DuplicateTimeline(timelineName)

Return: timeline

Duplicates the timeline and returns the created timeline, with the (optional) timelineName, on success.

CreateCompoundClip([timelineItems], {clipInfo})

Return: 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])

Return: timelineItem

Creates a Fusion clip of input timeline items. It returns the created timeline item.

Export(fileName, exportType, exportSubtype)

Return: 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

Note

Replace 'resolve.' when using the constants above, if a different Resolve class instance name is used.

ApplyGradeFromDRX(path, gradeMode, item1, item2, ...)

Return: 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])

Return: 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".

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

Deletes all timeline markers of the specified color. An "All" argument is supported and deletes all timeline markers.

DeleteMarkerAtFrame(frameNum)

Return: Bool

Deletes the timeline marker at the given frame number.

DeleteMarkerByCustomData(customData)

Return: Bool

Delete first matching marker with specified customData.

Last update:
Contributors: muyanru