Skip to content

Instantly share code, notes, and snippets.

@bradcordeiro
Last active February 13, 2024 13:44
Show Gist options
  • Save bradcordeiro/2f00120fad252a1b2bffcb882c9c941b to your computer and use it in GitHub Desktop.
Save bradcordeiro/2f00120fad252a1b2bffcb882c9c941b to your computer and use it in GitHub Desktop.
DaVinci Resolve 18 Javascript API TypeScript Types
/*
Copyright 2022 Brad Cordeiro
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* eslint-disable max-classes-per-file */
declare namespace DaVinciResolve {
type Base64Data = string; /** Property of ThumbnailData type but otherwise undocumented */
type FusionComp = unknown; /** Return or argument type for some TimelineItem methods but otherwise undocumented */
type GalleryStill = unknown; /** Return or argument type for GalleryStillAlbum methods but otherwise undocumented */
type TimelineExportAAFSubType = unknown; /** Probably an enum but undocumented, optional argument for Timeline.Export */
type TimelineExportEDLSubType = unknown; /** Probably an enum but undocumented, optional argument for Timeline.Export */
type TimelineExportSubType = TimelineExportAAFSubType | TimelineExportEDLSubType;
type TimelineExportType = unknown; /** Probably an enum but undocumented, argument for Timeline.Export */
type CallbackName = 'RenderStart' | 'RenderStop';
type PageName = 'media' | 'cut' | 'edit' | 'fusion' | 'color' | 'fairlight' | 'deliver';
type TrackType = 'audio' | 'video' | 'subtitle';
type StillExportFormat = 'dpx' | 'cin' | 'tif' | 'jpg' | 'png' | 'ppm' | 'bmp' | 'xpm';
type ClipColor =
'Apricot' | 'Beige' | 'Blue' | 'Brown' | 'Chocolate' | 'Green' | 'Lime' | 'Navy'
| 'Olive' | 'Orange' | 'Pink' | 'Purple' | 'Tan' | 'Teal' | 'Violet' | 'Yellow';
type MarkerColor =
'Blue' | 'Cocoa' | 'Cream' | 'Cyan' | 'Fuchsia' | 'Green' | 'Lavender' | 'Lemon'
| 'Mint' | 'Pink' | 'Purple' | 'Red' | 'Rose' | 'Sand' | 'Sky' | 'Yellow';
type FlagColor = MarkerColor;
type DataBaseInfo = {
DbType: 'Disk' | 'PostgreSQL'
DbName: string
IpAddress?: string
};
type TakeInfo = {
startFrame: number
endFrame: number
mediaPoolItem: MediaPoolItem
};
type Markers = {
[index:number]: {
color: MarkerColor
duration: number
note: string
name: string
customData: string
}
};
type CDLMap = {
NodeIndex : string,
Slope: string,
Offset: string,
Power: string,
Saturation: string,
};
type ThumbnailData = {
width: number
height: number
format: number
data: Base64Data
};
enum DynamicZoomEaseSetting {
DYNAMIC_ZOOM_EASE_LINEAR = 0,
DYNAMIC_ZOOM_EASE_IN,
DYNAMIC_ZOOM_EASE_OUT,
DYNAMIC_ZOOM_EASE_IN_AND_OUT,
}
enum CompositeModeSetting {
COMPOSITE_NORMAL = 0,
COMPOSITE_ADD,
COMPOSITE_SUBTRACT,
COMPOSITE_DIFF,
COMPOSITE_MULTIPLY,
COMPOSITE_SCREEN,
COMPOSITE_OVERLAY,
COMPOSITE_HARDLIGHT,
COMPOSITE_SOFTLIGHT,
COMPOSITE_DARKEN,
COMPOSITE_LIGHTEN,
COMPOSITE_COLOR_DODGE,
COMPOSITE_COLOR_BURN,
COMPOSITE_EXCLUSION,
COMPOSITE_HUE,
COMPOSITE_SATURATE,
COMPOSITE_COLORIZE,
COMPOSITE_LUMA_MASK,
COMPOSITE_DIVIDE,
COMPOSITE_LINEAR_DODGE,
COMPOSITE_LINEAR_BURN,
COMPOSITE_LINEAR_LIGHT,
COMPOSITE_VIVID_LIGHT,
COMPOSITE_PIN_LIGHT,
COMPOSITE_HARD_MIX,
COMPOSITE_LIGHTER_COLOR,
COMPOSITE_DARKER_COLOR,
COMPOSITE_FOREGROUND,
COMPOSITE_ALPHA,
COMPOSITE_INVERTED_ALPHA,
COMPOSITE_LUM,
COMPOSITE_INVERTED_LUM,
}
enum RetimeProcessSetting {
RETIME_USE_PROJECT = 0,
RETIME_NEAREST,
RETIME_FRAME_BLEND,
RETIME_OPTICAL_FLOW,
}
enum MotionEstimationSetting {
MOTION_EST_USE_PROJECT = 0,
MOTION_EST_STANDARD_FASTER,
MOTION_EST_STANDARD_BETTER,
MOTION_EST_ENHANCED_FASTER,
MOTION_EST_ENHANCED_BETTER,
MOTION_EST_SPEED_WRAP,
}
enum ScalingSetting {
SCALE_USE_PROJECT = 0,
SCALE_CROP,
SCALE_FIT,
SCALE_FILL,
SCALE_STRETCH,
}
enum ResizeFilterSetting {
RESIZE_FILTER_USE_PROJECT = 0,
RESIZE_FILTER_SHARPER,
RESIZE_FILTER_SMOOTHER,
RESIZE_FILTER_BICUBIC,
RESIZE_FILTER_BILINEAR,
RESIZE_FILTER_BESSEL,
RESIZE_FILTER_BOX,
RESIZE_FILTER_CATMULL_ROM,
RESIZE_FILTER_CUBIC,
RESIZE_FILTER_GAUSSIAN,
RESIZE_FILTER_LANCZOS,
RESIZE_FILTER_MITCHELL,
RESIZE_FILTER_NEAREST_NEIGHBOR,
RESIZE_FILTER_QUADRATIC,
RESIZE_FILTER_SINC,
RESIZE_FILTER_LINEAR,
}
enum SuperScaleSetting {
Auto = 0,
NoScaling,
TwoX,
ThreeX,
FourX,
}
type ProjectSetting = { /* Properties are undocumented, these were found through trial and error */
audioCaptureNumChannels: string, // Probably an integer stored as an integer string, e.g. "2"
audioOutputHasTimecode: string, // Probably a boolean stored as an integer string, e.g. "0"
audioPlayoutNumChannels: string,
colorAcesGamutCompressType: string,
colorAcesIDT: string,
colorAcesNodeLUTProcessingSpace: string,
colorAcesODT: string,
colorGalleryStillsLocation: string,
colorGalleryStillsNamingCustomPattern: string,
colorGalleryStillsNamingEnabled: string, // Probably a boolean stored as an integer string, e.g. "0"
colorGalleryStillsNamingPattern: string,
colorGalleryStillsNamingWithStillNumber: string,
colorKeyframeDynamicsEndProfile: string, // Probably a integer stored as an integer string, e.g. "0"
colorKeyframeDynamicsStartProfile: string, // Probably a boolean stored as an integer string, e.g. "0"
colorLuminanceMixerDefaultZero: string, // Probably a boolean stored as an integer string, e.g. "0"
colorScienceMode: string,
colorSpaceInput: string,
colorSpaceInputGamma: string,
colorSpaceOutput: string,
colorSpaceOutputGamma: string,
colorSpaceOutputGamutMapping: string,
colorSpaceOutputGamutSaturationKnee: string, // Probably a float stored as an integer string, e.g. "0.9"
colorSpaceOutputGamutSaturationMax: string, // Probably a float stored as an integer string, e.g. "1.0"
colorSpaceOutputToneLuminanceMax: string, // Probably an integer stored as an integer string, e.g. "100"
colorSpaceOutputToneMapping: string,
colorSpaceTimeline: string,
colorSpaceTimelineGamma: string,
colorUseBGRPixelOrderForDPX: string, // Probably a bool stored as an integer string, e.g. "0"
colorUseContrastSCurve: string, // Probably an integer stored as an integer string, e.g. "1"
colorUseLegacyLogGrades: string, // Probably an enum stored as an integer string, e.g. "2"
colorUseLocalVersionsAsDefault: string, // Probably a boolean stored as an integer string, e.g. "1"
colorUseStereoConvergenceForEffects: string, // Probably a boolean stored as an integer string, e.g. "1"
colorVersion10Name: string,
colorVersion1Name: string,
colorVersion2Name: string,
colorVersion3Name: string,
colorVersion4Name: string,
colorVersion5Name: string,
colorVersion6Name: string,
colorVersion7Name: string,
colorVersion8Name: string,
colorVersion9Name: string,
graphicsWhiteLevel: string, // Probably an integer stored as an integer string, e.g. "100"
hdr10PlusControlsOn: string, // Probably an integer stored as an integer string, e.g. "0"
hdrDolbyControlsOn: string, // Probably a boolean stored as an integer string, e.g. "1"
hdrDolbyMasterDisplay: string,
hdrDolbyVersion: string, // Probably a float stored as a string, e.g. 4.0
hdrMasteringLuminanceMax: string, // Probably an integer stored as an integer string, e.g. "1000"
hdrMasteringOn: string, // Probably a boolean stored as an integer string, e.g. "1"
imageDeinterlaceQuality: string,
imageEnableFieldProcessing: string, // Probably a boolean stored as an integer string, e.g. "1"
imageMotionEstimationMode: string,
imageMotionEstimationRange: string,
imageResizeMode: string,
imageResizingGamma: string,
imageRetimeInterpolation: string,
inputDRT: string,
inputDRTSatRolloffLimit: string, // Probably an integer stored as an integer string, e.g. "10000"
inputDRTSatRolloffStart: string, // Probably an integer stored as an integer string, e.g. "100"
isAutoColorManage: string, // Probably a boolean stored as an integer string, e.g. "1"
limitAudioMeterAlignLevel: string, // Probably a boolean stored as an integer string, e.g. "0"
limitAudioMeterDisplayMode: string,
limitAudioMeterHighLevel: string, // Probably an integer stored as an integer string, e.g. "-5"
limitAudioMeterLoudnessScale: string,
limitAudioMeterLowLevel: string, // Probably an integer stored as an integer string, e.g. "-10"
limitAudioMeterLUFS: string, // Probably an integer stored as an integer string, e.g. "-23"
limitBroadcastSafeLevels: string,
limitBroadcastSafeOn: string, // Probably a boolean stored as an integer string, e.g. "0"
limitSubtitleCaptionDurationSec: string, // Probably an integer stored as a string, e.g. "3"
limitSubtitleCPL: string, // Probably an integer stored as a string, e.g. "60"
outputDRT: string,
outputDRTSatRolloffLimit: string, // Probably an integer stored as a string, e.g. "10000"
outputDRTSatRolloffStart: string, // Probably an integer stored as a string, e.g. "100"
perfAutoRenderCacheAfterTime: string, // Probably an integer stored as a string, e.g. "5"
perfAutoRenderCacheComposite: string, // Probably an enum stored as a string, e.g. "0"
perfAutoRenderCacheEnable: string, // Probably a boolean stored as an integer string, e.g. "1"
perfAutoRenderCacheFuEffect: string, // Probably a boolean stored as an integer string, e.g. "1"
perfAutoRenderCacheTransition: string, // Probably a boolean stored as an integer string, e.g. "0"
perfCacheClipsLocation: string,
perfOptimisedCodec: string,
perfOptimisedMediaOn: string, // Probably a boolean stored as an integer string, e.g. "1"
perfOptimizedResolutionRatio: string,
perfProxyMediaMode: string, // Probably an enum stored as an integer string, e.g. "1"
perfProxyResolutionRatio: string,
perfRenderCacheCodec: string,
perfRenderCacheMode: string, // Probably an enum stored as an integer string, e.g. "0"
rcmPresetMode: string,
separateColorSpaceAndGamma: string, // Probably a boolean stored as an integer string, e.g. "1"
superScale: SuperScaleSetting,
superScaleNoiseReduction: string,
superScaleSharpness: string,
timelineDropFrameTimecode: string, // Probably a boolean stored as an integer string, e.g. "1"
timelineFrameRate: number,
timelineFrameRateMismatchBehavior: string,
timelineInputResMismatchBehavior: string,
timelineInputResMismatchCustomPreset: string,
timelineInputResMismatchUseCustomPreset: string,
timelineInterlaceProcessing: string,
timelineOutputPixelAspectRatio: string,
timelineOutputResMatchTimelineRes: string,
timelineOutputResMismatchBehavior: string,
timelineOutputResMismatchCustomPreset: string,
timelineOutputResMismatchUseCustomPreset: string, // Probably a boolean stored as an integer string, e.g. "1"
timelineOutputResolutionHeight: string, // Probably an integer stored as an integer string, e.g. "1"
timelineOutputResolutionWidth: string, // Probably an integer stored as an integer string, e.g. "1"
timelinePixelAspectRatio: string,
timelinePlaybackFrameRate: string, // Probably an integer stored as an integer string, e.g. "1"
timelineResolutionHeight: string, // Probably an integer stored as an integer string, e.g. "1"
timelineResolutionWidth: string, // Probably an integer stored as an integer string, e.g. "1"
timelineSaveThumbsInProject: string, // Probably a boolean stored as an integer string, e.g. "1"
timelineWorkingLuminance: string, // Probably an integer stored as an integer string, e.g. "1"
timelineWorkingLuminanceMode: string,
useCATransform: string, // Probably a boolean stored as an integer string, e.g. "1"
useColorSpaceAwareGradingTools: string,
useInverseDRT: string, // Probably a boolean stored as an integer string, e.g. "1"
videoCaptureCodec: string,
videoCaptureFormat: string,
videoCaptureIngestHandles: string, // Probably a boolean stored as an integer string, e.g. "1"
videoCaptureLocation: string,
videoCaptureMode: string,
videoDataLevels: string,
videoDataLevelsRetainSubblockAndSuperWhiteData: string // Probably a boolean stored as an integer string, e.g. "1"
videoDeckAdd32Pulldown: string, // Probably a boolean stored as an integer string, e.g. "1"
videoDeckBitDepth: string, // Probably an integer stored as an integer string, e.g. "1"
videoDeckFormat: string,
videoDeckNonAutoEditFrames: string, // Probably a boolean stored as an integer string, e.g. "1"
videoDeckOutputSyncSource: string,
videoDeckPrerollSec: string, // Probably an integer stored as an integer string, e.g. "1"
videoDeckSDIConfiguration: string,
videoDeckUse444SDI: string, // Probably a boolean stored as an integer string, e.g. "1"
videoDeckUseAudoEdit: string, // Probably a boolean stored as an integer string, e.g. "1"
videoDeckUseStereoSDI: string, // Probably a boolean stored as an integer string, e.g. "1"
videoMonitorBitDepth: string, // Probably a boolean stored as an integer string, e.g. "1"
videoMonitorFormat: string,
videoMonitorMatrixOverrideFor422SDI: string,
videoMonitorScaling: string,
videoMonitorSDIConfiguration: string,
videoMonitorUse444SDI: string, // Probably a boolean stored as an integer string, e.g. "1"
videoMonitorUseHDROverHDMI: string, // Probably a boolean stored as an integer string, e.g. "1"
videoMonitorUseLevelA: string, // Probably a boolean stored as an integer string, e.g. "1"
videoMonitorUseMatrixOverrideFor422SDI: string, // Probably a boolean stored as an integer string, e.g. "1"
videoMonitorUseStereoSDI: string, // Probably a boolean stored as an integer string, e.g. "1"
videoPlayoutAudioFramesOffset: string, // Probably a boolean stored as an integer string, e.g. "1"
videoPlayoutBatchHeadDuration: string, // Probably an integer stored as an integer string, e.g. "1"
videoPlayoutBatchTailDuration: string, // Probably an integer stored as an integer string, e.g. "1"
videoPlayoutLTCFramesOffset: string, // Probably an integer stored as an integer string, e.g. "1"
videoPlayoutMode: string,
videoPlayoutShowLTC: string, // Probably a boolean stored as an integer string, e.g. "1"
videoPlayoutShowSourceTimecode: string, // Probably a boolean stored as an integer string, e.g. "1"
};
type RenderSetting = {
AlphaMode: 0 | 1 /* 0 - Premultipled, 1 - Straight. Can only be set if "ExportAlpha" is true. */
AudioBitDepth: number
AudioCodec: string /* (example: "aac") */
AudioSampleRate?: number
ColorSpaceTag: string /* (example: "Same as Project", "AstroDesign") */
CustomName: string
EncodingProfile: string /* (example: "Main10"). Can only be set for H.264 and H.265. */
ExportAlpha: boolean
ExportAudio: boolean
ExportVideo: boolean
FormatHeight: number
FormatWidth: number
FrameRate: number /* examples: 23.976, 24 */
GammaTag: string /* (example: "Same as Project", "ACEScct") */
MarkIn: number
MarkOut: number
MultiPassEncode: boolean /* Can only be set for H.264. */
NetworkOptimization: boolean /* Only supported by QuickTime and MP4 formats. */
PixelAspectRatio?: '16_9' | '4_3' | 'square' | 'cinemascope'
SelectAllFrames: boolean /* when set true, the settings MarkIn and MarkOut are ignored) */
TargetDir: string
UniqueFilenameStyle: 0 | 1 /* 0 - Prefix, 1 - Suffix */
VideoQuality: 0 | number | 'Least' | 'Low' | 'Medium' | 'High' | 'Best'
};
type RenderJob = {
AudioCodec: string
AudioSampleRate: number
VideoFormat: string
IsExportAudio: boolean
ExportAlpha: boolean
FormatHeight: number
FrameRate: string
VideoCodec: string
FormatWidth: number
MarkOut: number
JobId: string
MarkIn: number
TargetDir: string
IsExportVideo: boolean
AudioBitDepth: number
TimelineName: string
OutputFilename: string
PixelAspectRatio: number
RenderMode: string
PresetName: string
RenderJobName: string
};
type TimelineImportOptions = {
timelineName: string // specifies the name of the timeline to be created
importSourceClips: boolean // specifies whether source clips should be imported, True by default
sourceClipsPath: string // specifies a filesystem path to search for source clips if the media is inaccessible in their original path and if "importSourceClips" is True
sourceClipsFolders: MediaPoolFolder[] // List of Media Pool folder objects to search for source clips if the media is not present in current folder and if "importSourceClips" is False
interlaceProcessing: boolean // specifies whether to enable interlace processing on the imported timeline being created. valid only for AAF import
};
type TimelineAAFImportOptions = {
autoImportSourceClipsIntoMediaPool: boolean /* specifies if source clips should be imported into media pool, True by default */
ignoreFileExtensionsWhenMatching: boolean // specifies if file extensions should be ignored when matching, False by default
linkToSourceCameraFiles: boolean // specifies if link to source camera files should be enabled, False by default
useSizingInfo: boolean // specifies if sizing information should be used, False by default
importMultiChannelAudioTracksAsLinkedGroups: boolean // specifies if multi-channel audio tracks should be imported as linked groups, False by default
insertAdditionalTracks: boolean // specifies if additional tracks should be inserted, True by default
insertWithOffset: string // specifies insert with offset value in timecode format - defaults to "00:00:00:00", applicable if "insertAdditionalTracks" is False
sourceClipsPath: string // specifies a filesystem path to search for source clips if the media is inaccessible in their original path and if "ignoreFileExtensionsWhenMatching" is True
sourceClipsFolders: string // list of Media Pool folder objects to search for source clips if the media is not present in current folder
};
type TimelineItemProperties = {
Pan: number /* values from -4.0 * width to 4.0 * width */
Tilt: number /* values from -4.0*height to 4.0*height */
ZoomX: number /* values from 0.0 to 100.0 */
ZoomY: number /* values from 0.0 to 100.0 */
ZoomGang: boolean
RotationAngle: number /* values from -360.0 to 360.0 */
AnchorPointX: number /* values from -4.0*width to 4.0*width */
AnchorPointY: number /* values from -4.0*height to 4.0*height */
Pitch: number /* values from -1.5 to 1.5 */
Yaw: number /* values from -1.5 to 1.5 */
FlipX: boolean /* value for flipping horizontally */
FlipY: boolean /* value for flipping vertically */
CropLeft: number /* values from 0.0 to width */
CropRight: number /* values from 0.0 to width */
CropTop: number /* values from 0.0 to height */
CropBottom: number /* values from 0.0 to height */
CropSoftness: number /* values from -100.0 to 100.0 */
CropRetain: boolean /* value for "Retain Image Position" checkbox */
DynamicZoomEase: DynamicZoomEaseSetting
CompositeMode: CompositeModeSetting
Opacity: number /* value from 0.0 to 100.0 */
Distortion: number /* value from -1.0 to 1.0 */
RetimeProcess: RetimeProcessSetting
MotionEstimation: MotionEstimationSetting
Scaling: ScalingSetting
ResizeFilter: ResizeFilterSetting
};
type MediaPoolItemClipInfo = {
mediaPoolItem: MediaPoolItem,
startFrame: number,
endFrame: number,
mediaType?: 1 | 2 /* 1 - Video only, 2 - Audio only */
};
type MediaPoolItemMetadata = {
'Aspect Ratio Notes': string,
'Camera Aperture': string,
'Camera FPS': string,
'Camera Serial #': string,
'Camera TC Type': string,
'Camera Type': string,
'Frame Rate': string,
'Lens Type': string,
'Mon Color Space': string,
'ND Filter': string,
'PAR Notes': string,
'Shutter Type': string,
'Video Codec': string,
'White Point (Kelvin)': string,
ISO: string,
Shutter: string,
};
type CompoundClipInfo = {
startTimecode: string
name: string
};
type RenderJobStatus = { /* Undocumented, shaped by trial-and-error */
CompletionPercentage: number
JobStatus: 'Ready' | 'Rendering' | 'Cancelled' | 'Complete' | 'Failed',
TimeTakenToRenderInMs?: number
EstimatedTimeRemainingInMs?: number
Error?: string
};
type MediaPoolItemProperties = Partial<{ /* Undocumented, shaped by trial-and-error */
'Alpha mode': string
'Audio Bit Depth': string
'Audio Ch': string
'Audio Codec': string
'Audio Offset': string
'Bit Depth': string
'Camera #': string
'Clip Color': ClipColor
'Clip Name': string
'Data Level': string
'Date Added': string
'Date Created': string
'Date Modified': string
'Drop frame': string
'Enable Deinterlacing': string
'End TC': string
'Field Dominance': string
'File Name': string
'File Path': string
'Good Take': string
'H-FLIP': string
'Input Color Space': string
'Input LUT': string
'Input Sizing Preset': string
'Noise Reduction': string
'Offline Reference': string
'Proxy Media Path': string
'Reel Name': string
'Roll/Card': string
'S3D Sync': string,
'Sample Rate': string
'Slate TC': string
'Start KeyKode': string
'Start TC': string
'Super Scale': 0 | 1 | 2 | 3 | 4, /* 0=Auto, 1=no scaling, and 2, 3 and 4 represent the Super Scale multipliers 2x, 3x and 4x */
'Synced Audio': string
'V-FLIP': string
'Video Codec': string
Angle: string
Comments: string
Description: string
Duration: string
End: string
Flags: FlagColor[]
Format: string
FPS: number,
Frames: string
IDT: string
In: string
Keyword: string
Out: string
PAR: string
Proxy: string
Resolution: string
Scene: string
Sharpness: string
Shot: string
Start: string
Take: string
Type: string
Usage: string
}>;
class MediaPoolItem {
/** Returns the clip name. */
GetName() : string;
/** Returns the metadata value for the key 'metadataType'. If no argument is specified, a dict of all set metadata properties is returned. */
GetMetadata() : MediaPoolItemMetadata;
GetMetadata(metadataType: keyof MediaPoolItemMetadata) : string;
/** Sets the given metadata to metadataValue (string). Returns True if successful. */
SetMetadata(metadataType: keyof MediaPoolItemMetadata, metadataValue: string) : boolean;
SetMetadata(metaData: Partial<MediaPoolItemMetadata>) : boolean;
/** Returns the unique ID for the MediaPoolItem. */
GetMediaId() : string;
/** 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. */
AddMarker(frameId: number, color: MarkerColor, name: string, note: string, duration: number, customData: string) : boolean;
/** Returns a dict (frameId -> {information}) of all markers and dicts with their information. */
GetMarkers() : Markers;
/** Returns marker {information} for the first matching marker with specified customData. */
GetMarkerByCustomData(customData: string) : Markers;
/** 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. */
UpdateMarkerCustomData(frameId: number, customData: string) : boolean;
/** Returns customData string for the marker at given frameId position. */
GetMarkerCustomData(frameId: number) : string;
/** Delete all markers of the specified color from the media pool item. "All" as argument deletes all color markers. */
DeleteMarkersByColor(color: MarkerColor | 'All') : boolean;
/** Delete marker at frame number from the media pool item. */
DeleteMarkerAtFrame(frameNum: number) : boolean;
/** Delete first matching marker with specified customData. */
DeleteMarkerByCustomData(customData: string) : boolean;
/** Adds a flag with given color (string). */
AddFlag(color: FlagColor) : boolean;
/** Returns a list of flag colors assigned to the item. */
GetFlagList() : FlagColor[];
/** Clears the flag of the given color if one exists. An "All" argument is supported and clears all flags. */
ClearFlags(color: FlagColor | 'All') : boolean;
/** Returns the item color as a string. */
GetClipColor() : ClipColor;
/** Sets the item color based on the colorName (string). */
SetClipColor(colorName: ClipColor) : boolean;
/** Clears the item color. */
ClearClipColor() : boolean;
/** Returns the property value for the key 'propertyName'. If no argument is specified, a dict of all clip properties is returned. */
GetClipProperty() : MediaPoolItemProperties;
GetClipProperty(property: keyof MediaPoolItemProperties) : string | number;
/** Sets the given property to propertyValue (string). Check the section below for more information. */
SetClipProperty(propertyName: keyof MediaPoolItemProperties, propertyValue: string) : boolean;
/** Links proxy media located at path specified by arg 'proxyMediaFilePath' with the current clip. 'proxyMediaFilePath' should be absolute clip path. */
LinkProxyMedia(proxyMediaFilePath: string) : boolean;
/** Unlinks any proxy media associated with clip. */
UnlinkProxyMedia() : boolean;
/** Replaces the underlying asset and metadata of MediaPoolItem with the specified absolute clip path. */
ReplaceClip(filePath: string) : boolean;
/** Returns a unique ID for the media pool item. Added in DaVinci Resolve 18 */
GetUniqueId() : string;
}
class TimelineItem {
/** Returns the item name. */
GetName() : string;
/** Returns the item duration. */
GetDuration() : number;
/** Returns the end frame position on the timeline. */
GetEnd() : number;
/** Returns number of Fusion compositions associated with the timeline item. */
GetFusionCompCount() : number;
/** Returns the Fusion composition object based on given index. 1 <= compIndex <= timelineItem.GetFusionCompCount() */
GetFusionCompByIndex(compIndex: number) : FusionComp;
/** Returns a list of Fusion composition names associated with the timeline item. */
GetFusionCompNameList() : string[];
/** Returns the Fusion composition object based on given name. */
GetFusionCompByName(compName: string) : FusionComp;
/** Returns the maximum extension by frame for clip from left side. */
GetLeftOffset() : number;
/** Returns the maximum extension by frame for clip from right side. */
GetRightOffset() : number;
/** Returns the start frame position on the timeline. */
GetStart() : number;
/** Sets the value of property "propertyKey" to value "propertyValue" */
SetProperty(propertyKey: keyof TimelineItemProperties, propertyValue: string | number | boolean) : boolean;
/** returns the value of the specified key if no key is specified, the method returns a dictionary(python) or table(lua) for all supported keys */
GetProperty() : TimelineItemProperties;
GetProperty(propertyKey: keyof TimelineItemProperties) : string | number;
/** 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. */
AddMarker(frameId: number, color: MarkerColor, name: string, note: string, duration: number, customData: string) : boolean;
/** Returns a dict (frameId -> {information}) of all markers and dicts with their information. */
GetMarkers() : Markers;
/** Returns marker {information} for the first matching marker with specified customData. */
GetMarkerByCustomData(customData: string) : Markers;
/** 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. */
UpdateMarkerCustomData(frameId: number, customData: string) : boolean;
/** Returns customData string for the marker at given frameId position. */
GetMarkerCustomData(frameId: number) : string;
/** Delete all markers of the specified color from the timeline item. "All" as argument deletes all color markers. */
DeleteMarkersByColor(color: MarkerColor | 'All') : boolean;
/** Delete marker at frame number from the timeline item. */
DeleteMarkerAtFrame(frameNum: number) : boolean;
/** Delete first matching marker with specified customData. */
DeleteMarkerByCustomData(customData: string) : boolean;
/** Adds a flag with given color (string). */
AddFlag(color: FlagColor) : boolean;
/** Returns a list of flag colors assigned to the item. */
GetFlagList() : FlagColor[];
/** Clear flags of the specified color. An "All" argument is supported to clear all flags. */
ClearFlags(color: FlagColor | 'All') : boolean;
/** Returns the item color as a string. */
GetClipColor() : ClipColor;
/** Sets the item color based on the colorName (string). */
SetClipColor(colorName: ClipColor) : boolean;
/** Clears the item color. */
ClearClipColor() : boolean;
/** Adds a new Fusion composition associated with the timeline item. */
AddFusionComp() : FusionComp;
/** Imports a Fusion composition from given file path by creating and adding a new composition for the item. */
ImportFusionComp(path: string) : FusionComp;
/** Exports the Fusion composition based on given index to the path provided. */
ExportFusionComp(path: string, compIndex: number) : boolean;
/** Deletes the named Fusion composition. */
DeleteFusionCompByName(compName: string) : boolean;
/** Loads the named Fusion composition as the active composition. */
LoadFusionCompByName(compName: string) : FusionComp;
/** Renames the Fusion composition identified by oldName. */
RenameFusionCompByName(oldName: string, newName: string) : boolean;
/** Adds a new color version for a video clipbased on versionType (0 - local, 1 - remote). */
AddVersion(versionName: string, versionType: 0 | 1) : boolean;
/** Returns the current version of the video clip. The returned value will have the keys versionName and versionType (0 - local, 1 - remote). */
GetCurrentVersion() : { versionName: string, versionType: 0 | 1 };
/** Deletes a color version by name and versionType (0 - local, 1 - remote). */
DeleteVersionByName(versionName: string, versionType: 0 | 1) : boolean;
/** Loads a named color version as the active version. versionType: 0 - local, 1 - remote. */
LoadVersionByName(versionName: string, versionType: 0 | 1) : boolean;
/** Renames the color version identified by oldName and versionType (0 - local, 1 - remote). */
RenameVersionByName(oldName: string, newName: string, versionType: 0 | 1) : boolean;
/** Returns a list of all color versions for the given versionType (0 - local, 1 - remote). */
GetVersionNameList(versionType: 0 | 1) : string[];
/** Returns the media pool item corresponding to the timeline item if one exists. */
GetMediaPoolItem() : MediaPoolItem | '';
/** Returns a dict (offset -> value) of keyframe offsets and respective convergence values. */
GetStereoConvergenceValues() : { [index:number]: number };
/** 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. */
GetStereoLeftFloatingWindowParams() : { [index:number]: number };
/** 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. */
GetStereoRightFloatingWindowParams() : { [index:number]: number };
/** Returns the number of nodes in the current graph for the timeline item */
GetNumNodes() : number;
/** Sets LUT on the node mapping the node index provided, 1 <= nodeIndex <= total number of nodes. */
/** The lutPath can be an absolute path, or a relative path (based off custom LUT paths or the master LUT path). */
/** The operation is successful for valid lut paths that Resolve has already discovered (see Project.RefreshLUTList). */
SetLUT(nodeIndex: number, lutPath: string) : boolean;
/** Gets relative LUT path based on the node index provided, 1 <= nodeIndex <= total number of nodes. */
GetLUT(nodeIndex: number) : string;
/** Keys of map are: "NodeIndex", "Slope", "Offset", "Power", "Saturation", where 1 <= NodeIndex <= total number of nodes. */
/** Example python code - SetCDL({"NodeIndex" : "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"}) */
SetCDL(CDLmap: CDLMap) : boolean;
/** Adds mediaPoolItem as a new take. Initializes a take selector for the timeline item if needed. By default, the full clip extents is added. startFrame (int) and endFrame (int) are optional arguments used to specify the extents. */
AddTake(mediaPoolItem: MediaPoolItem, startFrame?: number, endFrame?: number) : boolean;
/** Returns the index of the currently selected take, or 0 if the clip is not a take selector. */
GetSelectedTakeIndex() : number;
/** Returns the number of takes in take selector, or 0 if the clip is not a take selector. */
GetTakesCount() : number;
/** Returns a dict (keys "startFrame", "endFrame" and "mediaPoolItem") with take info for specified index. */
GetTakeByIndex(idx: number) : TakeInfo;
/** Deletes a take by index, 1 <= idx <= number of takes. */
DeleteTakeByIndex(idx: number) : boolean;
/** Selects a take by index, 1 <= idx <= number of takes. */
SelectTakeByIndex(idx: number) : boolean;
/** Finalizes take selection. */
FinalizeTake() : boolean;
/** Copies the current grade to all the items in tgtTimelineItems list. Returns True on success and False if any error occurred. */
CopyGrades(tgtTimelineItems: TimelineItem[]) : boolean;
/** Updates sidecar file for BRAW clips or RMD file for R3D clips. Added in Resolve 18 */
UpdateSidecar() : boolean;
/** Returns a unique ID for the timeline item. Added in Resolve 18 */
GetUniqueId() : string;
}
class Timeline {
/** Returns the timeline name. */
GetName() : string;
/** Sets the timeline name if timelineName (string) is unique. Returns True if successful. */
SetName(timelineName: string) : boolean;
/** Returns the frame number at the start of timeline. */
GetStartFrame() : number;
/** Returns the frame number at the end of timeline. */
GetEndFrame() : number;
/** Set the start timecode of the timeline to the string 'timecode'. Returns true when the change is successful, false otherwise. */
SetStartTimecode(timecode: string) : boolean;
/** Returns the start timecode for the timeline. */
GetStartTimecode() : string;
/** Returns the number of tracks for the given track type ("audio", "video" or "subtitle"). */
GetTrackCount(trackType: TrackType) : number;
/** Returns a list of timeline items on that track (based on trackType and index). 1 <= index <= GetTrackCount(trackType). */
GetItemListInTrack(trackType: TrackType, index: number) : TimelineItem[];
/** 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. */
AddMarker(frameId: number, color: MarkerColor, name: string, note: string, duration: number, customData: string) : boolean;
/** Returns a dict (frameId -> {information}) of all markers and dicts with their information. */
GetMarkers() : Markers;
/** Returns marker {information} for the first matching marker with specified customData. */
GetMarkerByCustomData(customData: string) : Markers;
/** 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. */
UpdateMarkerCustomData(frameId: number, customData: string) : boolean;
/** Returns customData string for the marker at given frameId position. */
GetMarkerCustomData(frameId: number) : string;
/** Deletes all timeline markers of the specified color. An "All" argument is supported and deletes all timeline markers. */
DeleteMarkersByColor(color: MarkerColor) : boolean;
/** Deletes the timeline marker at the given frame number. */
DeleteMarkerAtFrame(frameNum: number) : boolean;
/** Delete first matching marker with specified customData. */
DeleteMarkerByCustomData(customData: string) : boolean;
/** 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: string, gradeMode: 0 | 1 | 2, ...items: TimelineItem[]) : boolean;
ApplyGradeFromDRX(path: string, gradeMode: 0 | 1 | 2, items: TimelineItem[]) : boolean;
/** Returns a string timecode representation for the current playhead position, while on Cut, Edit, Color and Deliver pages. */
GetCurrentTimecode() : string;
/** Sets current playhead position from input timecode for Cut, Edit, Color, Fairlight and Deliver pages. */
SetCurrentTimecode(timecode: string) : boolean;
/** Returns the current video timeline item. */
GetCurrentVideoItem() : TimelineItem;
/** Returns a dict (keys "width", "height", "format" and "data") with data containing raw thumbnail image data (RGB 8-bit image data encoded in base64 format) for current media in the Color Page. An example of how to retrieve and interpret thumbnails is provided in 6_get_current_media_thumbnail.py in the Examples folder. */
GetCurrentClipThumbnailImage() : ThumbnailData;
/** Returns the track name for track indicated by trackType ("audio", "video" or "subtitle") and index. 1 <= trackIndex <= GetTrackCount(trackType). */
GetTrackName(trackType: TrackType, trackIndex: number) : string;
/** Sets the track name (string) for track indicated by trackType ("audio", "video" or "subtitle") and index. 1 <= trackIndex <= GetTrackCount(trackType). */
SetTrackName(trackType: TrackType, trackIndex: number, name: string) : boolean;
/** Duplicates the timeline and returns the created timeline, with the (optional) timelineName, on success. */
DuplicateTimeline(timelineName: string) : Timeline;
/** 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. */
CreateCompoundClip(timelineItems: TimelineItem[], clipInfo: CompoundClipInfo) : TimelineItem;
/** Creates a Fusion clip of input timeline items. It returns the created timeline item. */
CreateFusionClip(timelineItems: TimelineItem[]) : TimelineItem;
/** Imports timeline items from an AAF file and optional importOptions dict into the timeline, with support for the keys: */
ImportIntoTimeline(filePath: string, importOptions: TimelineAAFImportOptions) : boolean;
/** Exports timeline to 'file' as per input type & subtype format. */
Export(file: string, type: TimelineExportType, subtype?: TimelineExportSubType) : boolean;
/** Returns value of timeline setting (indicated by settingName : string). Check the section below for more information. */
GetSetting(settingName: string) : string;
/** Sets timeline setting (indicated by settingName : string) to the value (settingvalue : string). Check the section below for more information. */
SetSetting(settingName: string, settingValue: string) : boolean;
/** Inserts a generator (indicated by generatorName : string) into the timeline. */
InsertGeneratorIntoTimeline(generatorName: string) : TimelineItem;
/** Inserts a Fusion generator (indicated by generatorName : string) into the timeline. */
InsertFusionGeneratorIntoTimeline(generatorName: string) : TimelineItem;
/** Inserts a Fusion composition into the timeline. */
InsertFusionCompositionIntoTimeline() : TimelineItem;
/** Inserts an OFX generator (indicated by generatorName : string) into the timeline. */
InsertOFXGeneratorIntoTimeline(generatorName: string) : TimelineItem;
/** Inserts a title (indicated by titleName : string) into the timeline. */
InsertTitleIntoTimeline(titleName: string) : TimelineItem;
/** Inserts a Fusion title (indicated by titleName : string) into the timeline. */
InsertFusionTitleIntoTimeline(titleName: string) : TimelineItem;
/** Grabs still from the current video clip. Returns a GalleryStill object. */
GrabStill() : GalleryStill;
/** Grabs stills from all the clips of the timeline at 'stillFrameSource' (1 - First frame, 2 - Middle frame). Returns the list of GalleryStill objects. */
GrabAllStills(stillFrameSource: 1 | 2) : GalleryStill;
/** Returns a unique ID for the timeline. Added in Resolve 18 */
GetUniqueId() : string;
}
class MediaStorage {
/** Returns list of folder paths corresponding to mounted volumes displayed in Resolve’s Media Storage. */
GetMountedVolumeList() : string[];
/** Returns list of absolute folder paths in the given absolute folder path. */
GetSubFolderList(folderPath: string) : string[];
/** Returns list of media and file listings in the given absolute folder path. Note that media listings may be logically consolidated entries. */
GetFileList(folderPath: string) : string[];
/** Expands and displays given file/folder path in Resolve’s Media Storage. */
RevealInStorage(path: string) : boolean;
/** Adds specified file/folder paths from Media Storage into current Media Pool folder. Input is one or more file/folder paths. Returns a list of the MediaPoolItems created. */
AddItemListToMediaPool(...items: string[]) : MediaPoolItem[];
AddItemListToMediaPool(items: string[]) : MediaPoolItem[];
/** Adds specified media files as mattes for the specified MediaPoolItem. StereoEye is an optional argument for specifying which eye to add the matte to for stereo clips ("left" or "right"). Returns True if successful. */
AddClipMattesToMediaPool(mediaPoolItem: MediaPoolItem, paths: string[], stereoEye?: 'left' | 'right') : boolean;
/** Adds specified media files as timeline mattes in current media pool folder. Returns a list of created MediaPoolItems. */
AddTimelineMattesToMediaPool(paths: string[]) : MediaPoolItem[];
}
class MediaPoolFolder {
/** Returns a list of clips (items) within the folder. */
GetClipList() : MediaPoolItem[];
/** Returns the media folder name. */
GetName() : string;
/** Returns a list of subfolders in the folder. */
GetSubFolderList() : MediaPoolFolder[];
/** Returns true if folder is stale in collaboration mode, false otherwise */
GetIsFolderStale() : boolean;
/** Returns a unique ID for the media pool folder. Added in Resolve 18 */
GetUniqueId() : string;
}
class MediaPool {
/** Returns root Folder of Media Pool */
GetRootFolder() : MediaPoolFolder;
/** Adds new subfolder under specified Folder object with the given name. */
AddSubFolder(folder: MediaPoolFolder, name: string) : MediaPoolFolder;
/** Updates the folders in collaboration mode */
RefreshFolders() : boolean;
/** Adds new timeline with given name. */
CreateEmptyTimeline(name: string) : Timeline;
/** Appends specified MediaPoolItem objects in the current timeline. Returns the list of appended timelineItems. */
AppendToTimeline(...clip: MediaPoolItem[]) : TimelineItem[];
AppendToTimeline(clips: MediaPoolItem[]) : TimelineItem[];
AppendToTimeline(clipInfos: MediaPoolItemClipInfo[]) : TimelineItem[];
/** Creates new timeline with specified name, and appends the specified MediaPoolItem objects. */
CreateTimelineFromClips(name: string, ...clips: MediaPoolItem[]) : Timeline;
CreateTimelineFromClips(name: string, clips: MediaPoolItem[]) : Timeline;
CreateTimelineFromClips(name: string, clipInfo: MediaPoolItemClipInfo[]) : Timeline;
/** Creates new timeline with specified name, appending the list of clipInfos specified as a dict of "mediaPoolItem", "startFrame" (int), "endFrame" (int). */
/** Creates timeline based on parameters within given file and optional importOptions dict */
ImportTimelineFromFile(filePath: string, importOptions: TimelineImportOptions) : Timeline;
/** Deletes specified timelines in the media pool. */
DeleteTimelines(timelines: Timeline[]) : boolean;
/** Returns currently selected Folder. */
GetCurrentFolder() : MediaPoolFolder;
/** Sets current folder by given Folder. */
SetCurrentFolder(folder: MediaPoolFolder) : boolean;
/** Deletes specified clips or timeline mattes in the media pool */
DeleteClips(clips: MediaPoolItem[]) : boolean;
/** Deletes specified subfolders in the media pool */
DeleteFolders(subfolders: MediaPoolFolder[]) : boolean;
/** Moves specified clips to target folder. */
MoveClips(clips: MediaPoolItem[], targetFolder: MediaPoolFolder) : boolean;
/** Moves specified folders to target folder. */
MoveFolders(folders: MediaPoolFolder[], targetFolder: MediaPoolFolder) : boolean;
/** Get mattes for specified MediaPoolItem, as a list of paths to the matte files. */
GetClipMatteList(mediaPoolItem: MediaPoolItem) : string[];
/** Get mattes in specified Folder, as list of MediaPoolItems. */
GetTimelineMatteList(folder: MediaPoolFolder) : MediaPoolItem[];
/** Delete mattes based on their file paths, for specified MediaPoolItem. Returns True on success. */
DeleteClipMattes(mediaPoolItem: MediaPoolItem, paths: string[]) : boolean;
/** Update the folder location of specified media pool clips with the specified folder path. */
RelinkClips(mediaPoolItem: MediaPoolItem[], folderPath: string) : boolean;
/** Unlink specified media pool clips. */
UnlinkClips(mediaPoolItems: MediaPoolItem[]) : boolean;
/** Imports specified file/folder paths into current Media Pool folder. Input is an array of file/folder paths. Returns a list of the MediaPoolItems created. */
ImportMedia(items: string[]) : MediaPoolItem[];
ImportMedia(clipInfo: MediaPoolItemClipInfo[]) : MediaPoolItem[];
/** Exports metadata of specified clips to 'fileName' in CSV format. If no clips are specified, all clips from media pool will be used. */
ExportMetadata(fileName: string, clips: MediaPoolItem[]) : boolean;
/** Returns a unique ID for the media pool. Added in Resolve 18 */
GetUniqueId() : string;
}
class Project {
/** Returns the Media Pool object. */
GetMediaPool() : MediaPool;
/** Returns the number of timelines currently present in the project. */
GetTimelineCount() : number;
/** Returns timeline at the given index, 1 <= idx <= project.GetTimelineCount() */
GetTimelineByIndex(idx: number) : Timeline;
/** Returns the currently loaded timeline. */
GetCurrentTimeline() : Timeline;
/** Sets given timeline as current timeline for the project. Returns True if successful. */
SetCurrentTimeline(timeline: Timeline) : boolean;
/** Returns the Gallery object. */
GetGallery() : Gallery;
/** Returns project name. */
GetName() : string;
/** Sets project name if given projectname (string) is unique. */
SetName(projectName: string) : boolean;
/** Returns a list of presets and their information. */
GetPresetList() : { Name: string, Width: number, Height: number }[];
/** Sets preset by given presetName (string) into project. */
SetPreset(presetName: string) : boolean;
/** Adds a render job based on current render settings to the render queue. Returns a unique job id (string) for the new render job. */
AddRenderJob() : string;
/** Deletes render job for input job id (string). */
DeleteRenderJob(jobId: string) : boolean;
/** Deletes all render jobs in the queue. */
DeleteAllRenderJobs() : boolean;
/** Returns a list of render jobs and their information. */
GetRenderJobList() : RenderJob[];
/** Returns a list of render presets and their information. */
GetRenderPresetList() : string[];
/** Starts rendering jobs indicated by the input job ids. */
StartRendering(...jobId: string[]) : boolean;
StartRendering(jobIds: string[], isInteractiveMode?: boolean) : boolean;
StartRendering(isInteractiveMode?: boolean) : boolean;
/** Stops any current render processes. */
StopRendering() : void;
/** Returns True if rendering is in progress. */
IsRenderingInProgress() : boolean;
/** Sets a preset as current preset for rendering if presetName (string) exists. */
LoadRenderPreset(presetName: string) : boolean;
/** Creates new render preset by given name if presetName(string) is unique. */
SaveAsNewRenderPreset(presetName: string) : boolean;
/** Sets given settings for rendering. Settings is a dict, with support for the keys: */
SetRenderSettings(settings: Partial<RenderSetting>) : boolean;
/** Returns a dict with job status and completion percentage of the job by given jobId (string). */
GetRenderJobStatus(jobId: string) : RenderJobStatus;
/** Returns value of project setting (indicated by settingName, string). Check the section below for more information. */
GetSetting() : Partial<ProjectSetting>;
GetSetting(settingName: 'superScale') : SuperScaleSetting;
GetSetting(settingName: 'timelineFrameRate') : number;
GetSetting(settingName: keyof ProjectSetting) : string;
/** Sets the project setting (indicated by settingName, string) to the value (settingValue, string). Check the section below for more information. */
SetSetting(settingName: 'superScale', settingValue : SuperScaleSetting) : boolean;
SetSetting(settingName: 'timelineFrameRate', settingValue : number) : boolean;
SetSetting(settingName: keyof ProjectSetting, settingValue: string) : boolean;
/** Returns a dict (format -> file extension) of available render formats. */
GetRenderFormats() : { [index:string]: string };
/** Returns a dict (codec description -> codec name) of available codecs for given render format (string). */
GetRenderCodecs(renderFormat: string) : { [index:string]: string };
/** Returns a dict with currently selected format 'format' and render codec 'codec'. */
GetCurrentRenderFormatAndCodec() : { codec: string, format: string };
/** Sets given render format (string) and render codec (string) as options for rendering. */
SetCurrentRenderFormatAndCodec(format: string, codec: string) : boolean;
/** Returns the render mode: 0 - Individual clips, 1 - Single clip. */
GetCurrentRenderMode() : number;
/** Sets the render mode. Specify renderMode = 0 for Individual clips, 1 for Single clip. */
SetCurrentRenderMode(renderMode: 0 | 1) : boolean;
/** Returns list of resolutions applicable for the given render format (string) and render codec (string). Returns full list of resolutions if no argument is provided. Each element in the list is a dictionary with 2 keys "Width" and "Height". */
GetRenderResolutions(format: string, codec: string) : { Width: number, Height: number }[];
/** Refreshes LUT List */
RefreshLUTList() : boolean;
/** Returns a unique ID for the project item. Added in Resolve 18 */
GetUniqueId() : string;
/** Inserts the media specified by mediaPath (string) with startOffsetInSamples (int) and durationInSamples (int) at the playhead on a selected track on the Fairlight page. Returns True if successful, otherwise False. */
InsertAudioToCurrentTrackAtPlayhead(mediaPath: string, startOffsetInSamples: number, durationInSamples: number) : boolean;
}
class ProjectManager {
/** Archives project to provided file path with the configuration as provided by the optional arguments */
ArchiveProject(
projectName: string,
filePath: string,
isArchiveSrcMedia? : boolean,
isArchiveRenderCache? : boolean,
isArchiveProxyMedia? : boolean,
) : boolean;
/** Creates and returns a project if projectName (string) is unique, and None if it is not. */
CreateProject(projectName: string) : Project;
/** Delete project in the current folder if not currently loaded */
DeleteProject(projectName: string) : boolean;
/** Loads and returns the project with name = projectName (string) if there is a match found, and None if there is no matching Project. */
LoadProject(projectName: string) : Project | null;
/** Returns the currently loaded Resolve project. */
GetCurrentProject() : Project;
/** Saves the currently loaded project with its own name. Returns True if successful. */
SaveProject() : boolean;
/** Closes the specified project without saving. */
CloseProject(project: Project) : boolean;
/** Creates a folder if folderName (string) is unique. */
CreateFolder(folderName: string) : boolean;
/** Deletes the specified folder if it exists. Returns True in case of success. */
DeleteFolder(folderName: string) : boolean;
/** Returns a list of project names in current folder. */
GetProjectListInCurrentFolder() : string[];
/** Returns a list of folder names in current folder. */
GetFolderListInCurrentFolder() : string[];
/** Opens root folder in database. */
GotoRootFolder() : boolean;
/** Opens parent folder of current folder in database if current folder has parent. */
GotoParentFolder() : boolean;
/** Returns the current folder name. */
GetCurrentFolder() : string;
/** Opens folder under given name. */
OpenFolder(folderName: string) : boolean;
/** Imports a project from the file path provided with given project name, if any. Returns True if successful. */
ImportProject(filePath: string, name?: string) : boolean;
/** Exports project to provided file path, including stills and LUTs if withStillsAndLUTs is True (enabled by default). Returns True in case of success. */
ExportProject(projectName: string, filePath: string, withStillsAndLUTs?: boolean) : boolean;
/** Restores a project from the file path provided with given project name, if any. Returns True if successful. */
RestoreProject(filePath: string, name?: string) : boolean;
/** Returns a dictionary (with keys 'DbType', 'DbName' and optional 'IpAddress') corresponding to the current database connection */
GetCurrentDatabase() : DataBaseInfo;
/** Returns a list of dictionary items (with keys 'DbType', 'DbName' and optional 'IpAddress') corresponding to all the databases added to Resolve */
GetDatabaseList() : DataBaseInfo[];
/** Switches current database connection to the database specified by the keys below, and closes any open project. */
SetCurrentDatabase(dbInfo: DataBaseInfo) : boolean;
}
class Gallery {
/** Returns the name of the GalleryStillAlbum object 'galleryStillAlbum'. */
GetAlbumName(galleryStillAlbum: GalleryStillAlbum) : string;
/** Sets the name of the GalleryStillAlbum object 'galleryStillAlbum' to 'albumName'. */
SetAlbumName(galleryStillAlbum: GalleryStillAlbum, albumName: string) : boolean;
/** Returns current album as a GalleryStillAlbum object. */
GetCurrentStillAlbum() : GalleryStillAlbum;
/** Sets current album to GalleryStillAlbum object 'galleryStillAlbum'. */
SetCurrentStillAlbum(galleryStillAlbum: GalleryStillAlbum) : boolean;
/** Returns the gallery albums as a list of GalleryStillAlbum objects. */
GetGalleryStillAlbums() : GalleryStillAlbum[];
}
class GalleryStillAlbum {
/** Returns the list of GalleryStill objects in the album. */
GetStills() : GalleryStill[];
/** Returns the label of the galleryStill. */
GetLabel(galleryStill: GalleryStill) : string;
/** Sets the new 'label' to GalleryStill object 'galleryStill'. */
SetLabel(galleryStill: GalleryStill, label: string) : boolean;
/** Exports list of GalleryStill objects '[galleryStill]' to directory 'folderPath', with filename prefix 'filePrefix', using file format 'format' (supported formats: dpx, cin, tif, jpg, png, ppm, bmp, xpm). */
ExportStills(galleryStills: GalleryStill[], path: string, filePrefix: string, format: StillExportFormat) : boolean;
/** Deletes specified list of GalleryStill objects '[galleryStill]'. */
DeleteStills(galleryStills: GalleryStill[]) : boolean;
}
class Resolve {
EXPORT_AAF: TimelineExportType;
EXPORT_DOLBY_VISION_VER_2_9: TimelineExportType;
EXPORT_DOLBY_VISION_VER_4_0: TimelineExportType;
EXPORT_DOLBY_VISION_VER_5_1: TimelineExportType;
EXPORT_DRT: TimelineExportType;
EXPORT_EDL: TimelineExportType;
EXPORT_FCP_7_XML: TimelineExportType;
EXPORT_FCPXML_1_8: TimelineExportType;
EXPORT_FCPXML_1_9: TimelineExportType;
EXPORT_FCPXML_1_10: TimelineExportType;
EXPORT_HDR_10_PROFILE_A: TimelineExportType;
EXPORT_HDR_10_PROFILE_B: TimelineExportType;
EXPORT_TEXT_CSV: TimelineExportType;
EXPORT_TEXT_TAB: TimelineExportType;
EXPORT_AAF_EXISTING: TimelineExportAAFSubType;
EXPORT_AAF_NEW: TimelineExportAAFSubType;
EXPORT_CDL: TimelineExportEDLSubType;
EXPORT_MISSING_CLIPS: TimelineExportEDLSubType;
EXPORT_NONE: TimelineExportEDLSubType;
EXPORT_SDL: TimelineExportEDLSubType;
/** Returns the Fusion object. Starting point for Fusion scripts. Returns Fusion */
Fusion() : unknown;
/** Returns the media storage object to query and act on media locations. Returns MediaStorage */
GetMediaStorage() : MediaStorage;
/** Returns the project manager object for currently open database. Returns ProjectManager */
GetProjectManager() : ProjectManager;
/** Switches to indicated page in DaVinci Resolve. Input can be one of ("media", "cut", "edit", "fusion", "color", "fairlight", "deliver"). */
OpenPage(pageName: PageName) : boolean;
/** Returns the page currently displayed in the main window. Returned value can be one of ("media", "cut", "edit", "fusion", "color", "fairlight", "deliver", None). */
GetCurrentPage() : PageName;
/** Returns product name. */
GetProductName() : string;
/** Returns list of product version fields in [major, minor, patch, build, suffix] format. */
GetVersion() : string[];
/** Returns product version in "major.minor.patch[suffix].build" format. */
GetVersionString() : string;
/** Loads UI layout from saved preset named 'presetName'. */
LoadLayoutPreset(presetName: string) : boolean;
/** Overwrites preset named 'presetName' with current UI layout. */
UpdateLayoutPreset(presetName: string) : boolean;
/** Exports preset named 'presetName' to path 'presetFilePath'. */
ExportLayoutPreset(presetName: string, presetFilePath: string) : boolean;
/** Deletes preset named 'presetName'. */
DeleteLayoutPreset(presetName: string) : boolean;
/** Saves current UI layout as a preset named 'presetName'. */
SaveLayoutPreset(presetName: string) : boolean;
/** Imports preset from path 'presetFilePath'. The optional argument 'presetName' specifies how the preset shall be named. If not specified, the preset is named based on the filename. */
ImportLayoutPreset(presetFilePath: string, presetName: string) : boolean;
/** */
Quit() : void;
}
}
@bradcordeiro
Copy link
Author

I didn't think to add a license but I'll go with MIT since it seems the most permissive. Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment