### DaVinci Resolve Scripts Installation Paths Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/README.md Indicates the directories where custom scripts should be placed for DaVinci Resolve to recognize and load them. This is essential for extending Resolve's functionality. ```text Windows: C:\ProgramData\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\ ``` ```text MacOS: Macintosh HD/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/ ``` -------------------------------- ### Create DaVinci Resolve Project (Python) Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md This Python script demonstrates the basic steps to initialize the DaVinci Resolve scripting environment, access the Fusion module, and create a new project named 'Hello World'. It serves as a starting point for automating tasks within DaVinci Resolve. ```python #!/usr/bin/env python import DaVinciResolveScript as dvr_script resolve = dvr_script.scriptapp("Resolve") fusion = resolve.Fusion() projectManager = resolve.GetProjectManager() projectManager.CreateProject("Hello World") ``` -------------------------------- ### Project, Timeline, and MediaPool Item Settings Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Details functions for getting and setting properties on Project, Timeline, and MediaPoolItem objects. These functions mirror settings found in Resolve's UI, allowing programmatic access to configuration and clip attributes. ```APIDOC Property Access Functions: Functions: - Project:GetSetting(settingName) - Project:SetSetting(settingName, value) - Timeline:GetSetting(settingName) - Timeline:SetSetting(settingName, value) - MediaPoolItem:GetClipProperty(propertyName) - MediaPoolItem:SetClipProperty(propertyName, value) Description: These functions allow retrieval and modification of properties, analogous to Project Settings and Clip Attributes dialogs. Properties are accessed via string keys (settingName/propertyName). Getting Values: - Call with the specific property key for efficiency. - Call without parameters (or with None/blank key) to get a snapshot of all queryable properties. - Invalid keys return trivial results. - Some properties are read-only (e.g., intrinsic clip properties, context-dependent parameters). Setting Values: - Provide the property key and a valid value. - Check the return value for success. Key-Value Correlation: Keys and values are designed to match parameter names and values in the Resolve UI. ``` -------------------------------- ### Media Pool Item Property and Linking Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for getting and setting clip properties, linking proxy media, linking full resolution media, and unlinking proxy media. ```APIDOC GetClipProperty(propertyName=None) - Returns the property value for the key 'propertyName'. - If no argument is specified, returns a dict of all clip properties. - Returns: string|dict SetClipProperty(propertyName, propertyValue) - Sets the given property to propertyValue (string). - Returns: Bool LinkProxyMedia(proxyMediaFilePath) - Links proxy media located at the path specified by 'proxyMediaFilePath' with the current clip. - 'proxyMediaFilePath' should be an absolute clip path. - Returns: Bool LinkFullResolutionMedia(fullResMediaPath) - Links proxy media to full resolution media files specified via its path. - Returns: Bool UnlinkProxyMedia() - Unlinks any proxy media associated with the clip. - Returns: Bool ``` -------------------------------- ### DaVinci Resolve GalleryStillAlbum API Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Provides methods for interacting with individual GalleryStillAlbum objects. This includes retrieving stills within an album, setting and getting labels for stills, and managing album contents. ```APIDOC GalleryStillAlbum Methods: GetStills() - Returns: [galleryStill] - Description: Returns the list of GalleryStill objects contained within this album. GetLabel(galleryStill) - Parameters: - galleryStill: GalleryStill object. - Returns: string - Description: Returns the label associated with the specified GalleryStill object. SetLabel(galleryStill, label) - Parameters: - galleryStill: GalleryStill object. - label: string. The new label to set for the still. - Returns: Bool - Description: Sets the new label for the specified GalleryStill object. ``` -------------------------------- ### Clip Positioning and Source Information Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Methods for retrieving clip positioning data on the timeline and information about the source media. This includes offsets, start frames, and subframe precision. ```APIDOC GetLeftOffset(subframe_precision) Parameters: subframe_precision: Bool - If True, returns fractional frames; otherwise, returns integer frames. Returns: int/float Description: Returns the maximum extension (offset) of the clip from the left side of the timeline, in frames. GetRightOffset(subframe_precision) Parameters: subframe_precision: Bool - If True, returns fractional frames; otherwise, returns integer frames. Returns: int/float Description: Returns the maximum extension (offset) of the clip from the right side of the timeline, in frames. GetStart(subframe_precision) Parameters: subframe_precision: Bool - If True, returns fractional frames; otherwise, returns integer frames. Returns: int/float Description: Returns the start frame position of the clip on the timeline. GetSourceStartFrame() Returns: int Description: Returns the start frame position of the media pool clip within the timeline clip. GetSourceStartTime() Returns: float Description: Returns the start time position of the media pool clip within the timeline clip. ``` -------------------------------- ### Folder Management Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Operations for managing folders within the media pool, including getting the current folder, setting it, deleting subfolders, and moving folders. ```APIDOC GetCurrentFolder() - Returns the currently selected Folder object. - Returns: Folder SetCurrentFolder(Folder) - Sets the current folder by the given Folder object. - Returns: Bool DeleteFolders([subfolders]) - Deletes specified subfolders in the media pool. - Returns: Bool MoveFolders([folders], targetFolder) - Moves specified folders to the target folder. - Returns: Bool ``` -------------------------------- ### Graph Node Manipulation Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions to interact with nodes within a DaVinci Resolve graph. These include getting node counts, setting and getting LUTs, managing node caching, retrieving node labels and tools, enabling/disabling nodes, and applying grades from external files. ```APIDOC Graph: GetNumNodes() - Returns the number of nodes in the graph. - Returns: int SetLUT(nodeIndex, lutPath) - Sets a LUT on the node specified by nodeIndex. - Parameters: - nodeIndex: The index of the node (1-based, 1 <= nodeIndex <= self.GetNumNodes()). - lutPath: The path to the LUT file. Can be absolute, relative to custom LUT paths, or master LUT path. - Returns: Bool - True if the operation is successful for valid, discovered LUT paths. GetLUT(nodeIndex) - Gets the relative LUT path associated with the node at nodeIndex. - Parameters: - nodeIndex: The index of the node (1-based, 1 <= nodeIndex <= total number of nodes). - Returns: String - The relative path of the LUT. SetNodeCacheMode(nodeIndex, cache_value) - Sets the cache mode for the specified node. - Parameters: - nodeIndex: The index of the node (1-based). - cache_value: The desired cache mode value (refer to 'Cache Mode' section for possible values). - Returns: Bool - True if the cache mode was set successfully. GetNodeCacheMode(nodeIndex) - Retrieves the current cache mode of the specified node. - Parameters: - nodeIndex: The index of the node (1-based). - Returns: cache_value - The current cache mode type of the node. GetNodeLabel(nodeIndex) - Retrieves the label assigned to the node at the given index. - Parameters: - nodeIndex: The index of the node (1-based). - Returns: string - The label of the node. GetToolsInNode(nodeIndex) - Returns a list of tools currently used within the specified node. - Parameters: - nodeIndex: The index of the node (1-based). - Returns: [toolsList] - A list of strings, where each string is the name of a tool. SetNodeEnabled(nodeIndex, isEnabled) - Enables or disables the specified node. - Parameters: - nodeIndex: The index of the node (1-based, 1 <= nodeIndex <= self.GetNumNodes()). - isEnabled: A boolean value to set the node's enabled state (True to enable, False to disable). - Returns: Bool - True if the node's enabled state was successfully changed. ApplyGradeFromDRX(path, gradeMode) - Loads a still from a file path and applies its grade to the current graph. - Parameters: - path: The file path (string) to the grade file (e.g., .drx). - gradeMode: An integer specifying how the grade should be applied: - 0: "No keyframes" - 1: "Source Timecode aligned" - 2: "Start Frames aligned" - Returns: Bool - True if the grade was applied successfully. ApplyArriCdlLut() - Applies ARRI CDL and LUT settings. - Returns: Bool - True if successful, False otherwise. ResetAllGrades() - Resets all grades applied to the graph. - Returns: Bool - True if all grades were reset successfully, False otherwise. ``` -------------------------------- ### Media Pool Item Retrieval Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Function to get the media pool item associated with a timeline item. ```APIDOC GetMediaPoolItem() - Returns the media pool item corresponding to the timeline item, if one exists. - Returns: MediaPoolItem - The media pool item object, or null if none is associated. ``` -------------------------------- ### DaVinci Resolve Scripting API Reference Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Comprehensive documentation for DaVinci Resolve scripting functions, including project operations, media storage, and media pool management. This section groups related functionalities for clarity. ```APIDOC Project and Timeline Operations: GetRenderResolutions(format, codec) - 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". - Returns: [{Resolution}] RefreshLUTList() - Refreshes the list of Look-Up Tables (LUTs). - Returns: Bool GetUniqueId() - Returns a unique identifier for the current project item. - Returns: string InsertAudioToCurrentTrackAtPlayhead(mediaPath, startOffsetInSamples, durationInSamples) - Inserts audio 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. - Returns: Bool LoadBurnInPreset(presetName) - Loads a user-defined data burn-in preset for the project when supplied presetName (string). - Returns true if successful. - Returns: Bool ExportCurrentFrameAsStill(filePath) - Exports the current frame as a still image to the supplied filePath. - filePath must end in a valid export file format. - Returns True if successful, False otherwise. - Returns: Bool GetColorGroupsList() - Returns a list of all color group objects in the timeline. - Returns: [ColorGroups...] AddColorGroup(groupName) - Creates a new ColorGroup. - groupName must be a unique string. - Returns: ColorGroup DeleteColorGroup(colorGroup) - Deletes the given color group and sets associated clips to ungrouped. - Returns: Bool ``` ```APIDOC MediaStorage Operations: MediaStorage.GetMountedVolumeList() - Returns a list of folder paths corresponding to mounted volumes displayed in Resolve’s Media Storage. - Returns: [paths...] MediaStorage.GetSubFolderList(folderPath) - Returns a list of folder paths within the given absolute folder path. - Parameters: - folderPath: The absolute path to the folder. - Returns: [paths...] MediaStorage.GetFileList(folderPath) - Returns a list of media and file listings in the given absolute folder path. - Note: Media listings may be logically consolidated entries. - Parameters: - folderPath: The absolute path to the folder. - Returns: [paths...] MediaStorage.RevealInStorage(path) - Expands and displays the given file/folder path in Resolve’s Media Storage. - Parameters: - path: The file or folder path to reveal. - Returns: Bool MediaStorage.AddItemListToMediaPool(item1, item2, ...) - Adds specified file/folder paths from Media Storage into the current Media Pool folder. - Input is one or more file/folder paths. - Returns a list of the MediaPoolItems created. - Returns: [clips...] MediaStorage.AddItemListToMediaPool([items...]) - Adds specified file/folder paths from Media Storage into the current Media Pool folder. - Input is an array of file/folder paths. - Returns a list of the MediaPoolItems created. - Returns: [clips...] MediaStorage.AddItemListToMediaPool([{itemInfo}, ...]) - Adds a list of itemInfos specified as a dictionary of "media", "startFrame" (int), and "endFrame" (int) from Media Storage into the current Media Pool folder. - Returns a list of the MediaPoolItems created. - Returns: [clips...] MediaStorage.AddClipMattesToMediaPool(MediaPoolItem, [paths], stereoEye) - 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. - Returns: Bool MediaStorage.AddTimelineMattesToMediaPool([paths]) - Adds specified media files as timeline mattes in the current media pool folder. - Returns a list of created MediaPoolItems. - Returns: [MediaPoolItems] ``` ```APIDOC MediaPool Operations: MediaPool.GetRootFolder() - Returns the root Folder object of the Media Pool. - Returns: Folder MediaPool.AddSubFolder(folder, name) - Adds a new subfolder under the specified Folder object with the given name. - Parameters: - folder: The parent Folder object. - name: The name for the new subfolder. - Returns: Folder MediaPool.RefreshFolders() - Updates the folders in collaboration mode. - Returns: Bool MediaPool.CreateEmptyTimeline(name) - Adds a new timeline with the given name. - Parameters: - name: The name for the new timeline. - Returns: Timeline MediaPool.AppendToTimeline(clip1, clip2, ...) - Appends specified MediaPoolItem objects to the current timeline. - Returns the list of appended TimelineItem objects. - Returns: [TimelineItem] MediaPool.AppendToTimeline([clips]) - Appends specified MediaPoolItem objects to the current timeline. - Input is an array of MediaPoolItem objects. - Returns the list of appended TimelineItem objects. - Returns: [TimelineItem] MediaPool.AppendToTimeline([{clipInfo}, ...]) - Appends a list of clipInfos specified as a dictionary. - Each dictionary can contain: "mediaPoolItem", "startFrame" (float/int), "endFrame" (float/int), (optional) "mediaType" (int; 1 - Video only, 2 - Audio only), "trackIndex" (int), and "recordFrame" (float/int). - Returns the list of appended TimelineItem objects. - Returns: [TimelineItem] MediaPool.CreateTimelineFromClips(name, clip1, clip2,...) - Creates a new timeline with the specified name and appends the specified MediaPoolItem objects. - Parameters: - name: The name for the new timeline. - clip1, clip2, ...: MediaPoolItem objects to append. - Returns: Timeline ``` -------------------------------- ### Timeline Management Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md API methods for managing timeline properties, including name, frame range, and start timecode. ```APIDOC GetName() - Returns the timeline name. - Returns: string SetName(timelineName) - Sets the timeline name if timelineName (string) is unique. - Returns: Bool (True if successful) GetStartFrame() - Returns the frame number at the start of the timeline. - Returns: int GetEndFrame() - Returns the frame number at the end of the timeline. - Returns: int SetStartTimecode(timecode) - Sets the start timecode of the timeline to the string 'timecode'. - Returns: Bool (True when successful, false otherwise) GetStartTimecode() - Returns the start timecode for the timeline. - Returns: string GetTrackCount(trackType) - Returns the number of tracks for the given track type ("audio", "video" or "subtitle"). - Returns: int ``` -------------------------------- ### Quick Export Rendering Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for utilizing and initiating Quick Export renders with custom parameters. ```APIDOC GetQuickExportRenderPresets() Retrieves a list of available Quick Export render preset names. Returns: A list of preset names ([preset_name..]). RenderWithQuickExport(preset_name, {param_dict}) Initiates a Quick Export render for the current active timeline using a specified preset and optional parameters. Parameters: preset_name: The name of the Quick Export preset to use, obtained from GetQuickExportRenderPresets (string). param_dict: A dictionary supporting render settings keys like 'TargetDir', 'CustomName', 'VideoQuality', and 'EnableUpload'. 'EnableUpload' activates direct upload for supported web presets (dict). Returns: A dictionary with job status and render time, or an error string if the render failed or was not attempted ({status info} or string). Note: Refer to 'Looking up Render Settings' for detailed information on supported settings keys. ``` -------------------------------- ### Render Mode Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for getting and setting the current render mode (e.g., individual clips vs. single clip). ```APIDOC GetCurrentRenderMode() Returns the current render mode. Returns: An integer representing the render mode: 0 for Individual clips, 1 for Single clip (int). SetCurrentRenderMode(renderMode) Sets the render mode for subsequent rendering operations. Parameters: renderMode: The render mode to set. Use 0 for Individual clips, 1 for Single clip (int). Returns: True if the render mode was set successfully, False otherwise (Bool). ``` -------------------------------- ### Project and Folder Management Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for navigating and managing projects and folders within DaVinci Resolve. Includes listing projects/folders, changing directories, and importing/exporting projects. ```APIDOC GetProjectListInCurrentFolder() - Returns a list of project names in the current folder. - Returns: [project names...] GetFolderListInCurrentFolder() - Returns a list of folder names in the current folder. - Returns: [folder names...] GotoRootFolder() - Opens the root folder in the database. - Returns: Bool GotoParentFolder() - Opens the parent folder of the current folder in the database if the current folder has a parent. - Returns: Bool GetCurrentFolder() - Returns the name of the current folder. - Returns: string OpenFolder(folderName) - Opens the folder with the given name. - Parameters: - folderName: The name of the folder to open (string). - Returns: Bool ImportProject(filePath, projectName=None) - Imports a project from the specified file path. An optional project name can be provided. - Parameters: - filePath: The path to the project file (string). - projectName: The name to assign to the imported project (string, optional). - Returns: Bool (True if successful). ExportProject(projectName, filePath, withStillsAndLUTs=True) - Exports the project to the provided file path. Optionally includes stills and LUTs. - Parameters: - projectName: The name of the project to export (string). - filePath: The destination path for the exported project (string). - withStillsAndLUTs: Whether to include stills and LUTs (boolean, defaults to True). - Returns: Bool (True in case of success). RestoreProject(filePath, projectName=None) - Restores a project from the specified file path. An optional project name can be provided. - Parameters: - filePath: The path to the project file to restore (string). - projectName: The name to assign to the restored project (string, optional). - Returns: Bool (True if successful). ``` -------------------------------- ### Cloud Project Operations Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md APIs for creating, loading, importing, and restoring cloud-based projects in DaVinci Resolve. ```APIDOC CreateCloudProject(cloudSettings) - Creates and returns a new cloud project. - Parameters: - cloudSettings: Configuration details for the cloud project (refer to 'Cloud Projects Settings' subsection for specifics). - Returns: Project. LoadCloudProject(cloudSettings) - Loads and returns a cloud project matching the provided cloud settings. Returns None if no match is found. - Parameters: - cloudSettings: Configuration details for the cloud project (refer to 'Cloud Projects Settings' subsection for specifics). - Returns: Project or None. ImportCloudProject(filePath, cloudSettings) - Imports a cloud project from a file. - Parameters: - filePath: The path to the file to import (string). - cloudSettings: Configuration details for the cloud project (refer to 'Cloud Projects Settings' subsection for specifics). - Returns: Bool (True if import is successful, False otherwise). RestoreCloudProject(folderPath, cloudSettings) - Restores a cloud project from a specified folder path. - Parameters: - folderPath: The path of the folder to restore from (string). - cloudSettings: Configuration details for the cloud project (refer to 'Cloud Projects Settings' subsection for specifics). - Returns: Bool (True if restore is successful, False otherwise). ``` -------------------------------- ### Project Manager Cloud Project Settings Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Details the settings dictionary for managing cloud projects via ProjectManager methods. Covers project name, media path, collaboration status, sync mode, and camera access. Specific settings apply differently to load operations. ```APIDOC ProjectManager Methods (Cloud Projects): Functions: ProjectManager:LoadCloudProject, ProjectManager:CreateCloudProject, ProjectManager:ImportCloudProject, ProjectManager:RestoreCloudProject Description: These functions manage cloud projects and accept a {cloudSettings} dictionary. The dictionary contains keys for project configuration. cloudSettings Dictionary Keys: - resolve.CLOUD_SETTING_PROJECT_NAME: String, ["" by default]. The name of the cloud project. - resolve.CLOUD_SETTING_PROJECT_MEDIA_PATH: String, ["" by default]. The path for project media. - resolve.CLOUD_SETTING_IS_COLLAB: Bool, [False by default]. Indicates if the project is collaborative. - resolve.CLOUD_SETTING_SYNC_MODE: syncMode (see below), [resolve.CLOUD_SYNC_PROXY_ONLY by default]. Defines the synchronization mode. - resolve.CLOUD_SETTING_IS_CAMERA_ACCESS: Bool [False by default]. Indicates camera access permissions. Notes on LoadCloudProject: - Only resolve.CLOUD_SETTING_PROJECT_NAME, resolve.CLOUD_SETTING_PROJECT_MEDIA_PATH, and resolve.CLOUD_SETTING_SYNC_MODE are honored on subsequent loads. - The first load on a system honors all three settings mentioned above. Required Settings: - All four functions require resolve.PROJECT_MEDIA_PATH to be defined. - ProjectManager:LoadCloudProject and ProjectManager:CreateCloudProject also require resolve.PROJECT_NAME to be defined. syncMode Enum: - resolve.CLOUD_SYNC_NONE - resolve.CLOUD_SYNC_PROXY_ONLY - resolve.CLOUD_SYNC_PROXY_AND_ORIG ``` -------------------------------- ### Render Settings Configuration Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for configuring render settings, including format, codec, and specific parameters. ```APIDOC SetRenderSettings({settings}) Applies a dictionary of settings to the current render job configuration. Parameters: settings: A dictionary containing render settings. Refer to 'Looking up render settings' for supported keys (dict). Returns: True if settings were applied successfully, False otherwise (Bool). GetRenderFormats() Retrieves a dictionary mapping available render format names to their file extensions. Returns: A dictionary of format names and extensions ({render formats..}). GetRenderCodecs(renderFormat) Retrieves a dictionary mapping available codec descriptions to their names for a given render format. Parameters: renderFormat: The name of the render format for which to get codecs (string). Returns: A dictionary of codec descriptions and names ({render codecs...}). GetCurrentRenderFormatAndCodec() Returns the currently selected render format and codec. Returns: A dictionary containing the current 'format' and 'codec' (dict). SetCurrentRenderFormatAndCodec(format, codec) Sets the render format and codec to be used for rendering. Parameters: format: The render format to set (string). codec: The render codec to set (string). Returns: True if the format and codec were set successfully, False otherwise (Bool). ``` -------------------------------- ### Timecode Operations Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions to get the current playhead position as a timecode string and to set the playhead position using a provided timecode string. These operations are available across multiple pages in DaVinci Resolve. ```APIDOC GetCurrentTimecode() - Returns a string timecode representation for the current playhead position. - Applicable on Cut, Edit, Color, Fairlight, and Deliver pages. - Returns: string SetCurrentTimecode(timecode) - Sets the current playhead position from an input timecode string. - Applicable on Cut, Edit, Color, Fairlight, and Deliver pages. - Parameters: - timecode: The timecode string to set the playhead position to. - Returns: Bool ``` -------------------------------- ### Project Settings Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for retrieving and modifying project-specific settings. ```APIDOC GetSetting(settingName) Retrieves the value of a specific project setting. Parameters: settingName: The name of the project setting to retrieve (string). Returns: The value of the specified setting (string). Note: Refer to the relevant section for a list of supported setting names. SetSetting(settingName, settingValue) Sets a project setting to a new value. Parameters: settingName: The name of the project setting to modify (string). settingValue: The new value to assign to the setting (string). Returns: True if the setting was updated successfully, False otherwise (Bool). Note: Refer to the relevant section for a list of supported setting names. ``` -------------------------------- ### Flag and Clip Color Operations Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Methods for managing visual indicators on timeline items, including adding, listing, and clearing flags, as well as setting, getting, and clearing the item's clip color. ```APIDOC AddFlag(color) Parameters: color: string - The color of the flag to add (e.g., 'Red', 'Blue'). Returns: Bool Description: Adds a flag with the specified color to the timeline item. GetFlagList() Returns: [colors...] Description: Returns a list of colors representing the flags currently assigned to the item. ClearFlags(color) Parameters: color: string - The color of the flags to clear. Use 'All' to clear all flags. Returns: Bool Description: Clears flags of the specified color from the timeline item. GetClipColor() Returns: string Description: Returns the current color of the timeline item as a string. SetClipColor(colorName) Parameters: colorName: string - The name of the color to set for the item (e.g., 'Green', 'Yellow'). Returns: Bool Description: Sets the color of the timeline item based on the provided color name. ClearClipColor() Returns: Bool Description: Removes any assigned color from the timeline item. ``` -------------------------------- ### Project Object Methods Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Methods available on a Project object in DaVinci Resolve scripting, allowing manipulation of timelines, media pools, galleries, and project settings. ```APIDOC Project.GetMediaPool() - Returns the Media Pool object associated with the project. - Returns: MediaPool. Project.GetTimelineCount() - Returns the total number of timelines present in the project. - Returns: int. Project.GetTimelineByIndex(idx) - Returns the timeline at the specified index. - Parameters: - idx: The index of the timeline (integer, 1 <= idx <= project.GetTimelineCount()). - Returns: Timeline. Project.GetCurrentTimeline() - Returns the timeline that is currently loaded or active in the project. - Returns: Timeline. Project.SetCurrentTimeline(timeline) - Sets the specified timeline as the current timeline for the project. - Parameters: - timeline: The Timeline object to set as current. - Returns: Bool (True if successful). Project.GetGallery() - Returns the Gallery object associated with the project. - Returns: Gallery. Project.GetName() - Returns the name of the project. - Returns: string. Project.SetName(projectName) - Sets the name of the project if the provided name is unique. - Parameters: - projectName: The new name for the project (string). - Returns: Bool. ``` -------------------------------- ### Media Import Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for importing media files and folders into the current media pool folder. Supports importing individual files, sequences, or using clip info dictionaries for detailed import configurations. ```APIDOC ImportMedia([items...]) - Imports specified file/folder paths into the current Media Pool folder. Input is an array of file/folder paths. - Returns: [MediaPoolItems] ImportMedia([{clipInfo}]) - Imports file path(s) into the current Media Pool folder as specified in a list of clipInfo dictionaries. Returns a list of the MediaPoolItems created. - Each clipInfo gets imported as one MediaPoolItem unless 'Show Individual Frames' is turned on. - Example: ImportMedia([{"FilePath":"file_%03d.dpx", "StartIndex":1, "EndIndex":100}]) would import clip "file_[001-100].dpx". - Returns: [MediaPoolItems] ``` -------------------------------- ### DaVinci Resolve Export Types and Subtypes Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Details supported and unsupported export types for DaVinci Resolve, including required subtypes for AAF and EDL exports. Some export types are deprecated starting from version 18.1. The exportSubType parameter is only relevant for specific export types. ```APIDOC DaVinci Resolve Export Types: Supported Export Types and Subtypes: - resolve.EXPORT_AAF: - Requires exportSubType. Valid values: resolve.EXPORT_AAF_NEW, resolve.EXPORT_AAF_EXISTING. - resolve.EXPORT_EDL: - Requires exportSubType. Valid values: resolve.EXPORT_CDL, resolve.EXPORT_SDL, resolve.EXPORT_MISSING_CLIPS, resolve.EXPORT_NONE. - resolve.EXPORT_CDL - resolve.EXPORT_SDL - resolve.EXPORT_MISSING_CLIPS Note: Replace 'resolve.' prefix if using a different Resolve class instance name. Unsupported Export Types (DaVinci Resolve 18.1 onwards): - 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 ``` -------------------------------- ### Media Pool and Clip Management Functions Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Top-level functions for creating stereoscopic media pool items, syncing audio between clips, and managing clip selections. ```APIDOC RightMediaPoolItem(MediaPoolItem1, MediaPoolItem2) --> MediaPoolItem - Takes in two existing media pool items and creates a new 3D stereoscopic media pool entry replacing the input media in the media pool. AutoSyncAudio([MediaPoolItems], {audioSyncSettings}) --> Bool - Syncs audio for specified [MediaPoolItems] (list). - The list must contain a minimum of two MediaPoolItems - at least one video and one audio clip. - Returns True if successful. Refer to 'Audio Sync Settings' section for details. GetSelectedClips() --> [MediaPoolItems] - Returns the current selected MediaPoolItems. SetSelectedClip(MediaPoolItem) --> Bool - Sets the selected MediaPoolItem to the given MediaPoolItem. ``` -------------------------------- ### Render Preset Management Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Functions for managing render presets, including setting, loading, saving, and deleting them. ```APIDOC SetPreset(presetName) Sets a render preset by its given name. Parameters: presetName: The name of the preset to set (string). Returns: True if the preset was set successfully, False otherwise (Bool). GetRenderPresetList() Retrieves a list of all available render presets and their associated information. Returns: A list of render presets ([presets...]). LoadRenderPreset(presetName) Loads a specified render preset, making it the current preset for rendering. Parameters: presetName: The name of the preset to load (string). Returns: True if the preset was loaded successfully, False otherwise (Bool). SaveAsNewRenderPreset(presetName) Creates a new render preset using the current settings, named by the provided name. Parameters: presetName: The name for the new render preset. Must be unique (string). Returns: True if the preset was saved successfully, False otherwise (Bool). DeleteRenderPreset(presetName) Deletes a render preset by its provided name. Parameters: presetName: The name of the render preset to delete (string). Returns: True if the preset was deleted successfully, False otherwise (Bool). ``` -------------------------------- ### ProjectManager Object API Functions Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Manages DaVinci Resolve projects, including creation, loading, saving, closing, and folder operations, as well as project archiving. ```APIDOC ProjectManager: ArchiveProject(projectName: str, filePath: str, isArchiveSrcMedia: bool = True, isArchiveRenderCache: bool = True, isArchiveProxyMedia: bool = False) --> Bool Archives a project to the provided file path with the specified configuration for media archiving. Parameters: projectName: The name of the project to archive. filePath: The destination path for the archive. isArchiveSrcMedia: Whether to archive source media (defaults to True). isArchiveRenderCache: Whether to archive render cache (defaults to True). isArchiveProxyMedia: Whether to archive proxy media (defaults to False). Returns: True if the project was archived successfully. CreateProject(projectName: str) --> Project Creates and returns a new project if the projectName is unique. Parameters: projectName: The name for the new project. Returns: The created Project object, or None if the projectName is not unique. DeleteProject(projectName: str) --> Bool Deletes a project in the current folder if it is not currently loaded. Parameters: projectName: The name of the project to delete. Returns: True if the project was deleted successfully. LoadProject(projectName: str) --> Project Loads and returns the project with the specified name if a match is found. Parameters: projectName: The name of the project to load. Returns: The loaded Project object, or None if no matching project is found. GetCurrentProject() --> Project Returns the currently loaded DaVinci Resolve project. SaveProject() --> Bool Saves the currently loaded project with its own name. Returns: True if the save operation was successful. CloseProject(project: Project) --> Bool Closes the specified project without saving. Parameters: project: The Project object to close. Returns: True if the project was closed successfully. CreateFolder(folderName: str) --> Bool Creates a folder if the folderName is unique. Parameters: folderName: The name of the folder to create. Returns: True if the folder was created successfully. DeleteFolder(folderName: str) --> Bool Deletes the specified folder if it exists. Parameters: folderName: The name of the folder to delete. Returns: True in case of success. ``` -------------------------------- ### Unsupported Project Rendering API Functions Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Details unsupported functions within the Project class related to rendering, emphasizing the shift from indices to unique job IDs. ```APIDOC Project: StartRendering(index1, index2, ...) --> Bool # Please use unique job ids (string) instead of indices. StartRendering([idxs...]) --> Bool # Please use unique job ids (string) instead of indices. DeleteRenderJobByIndex(idx) --> Bool # Please use unique job ids (string) instead of indices. GetRenderJobStatus(idx) --> {status info} # Please use unique job ids (string) instead of indices. ``` -------------------------------- ### DaVinci Resolve Gallery API Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Provides methods for managing gallery albums and stills. This includes operations for retrieving, setting, and creating album names, accessing current and all albums, and managing stills within albums. ```APIDOC Gallery Operations: GetAlbumName(galleryStillAlbum) - Parameters: - galleryStillAlbum: GalleryStillAlbum object. - Returns: string - Description: Returns the name of the specified GalleryStillAlbum object. SetAlbumName(galleryStillAlbum, albumName) - Parameters: - galleryStillAlbum: GalleryStillAlbum object. - albumName: string. The new name for the album. - Returns: Bool - Description: Sets the name of the GalleryStillAlbum object. GetCurrentStillAlbum() - Returns: galleryStillAlbum - Description: Returns the current album as a GalleryStillAlbum object. SetCurrentStillAlbum(galleryStillAlbum) - Parameters: - galleryStillAlbum: GalleryStillAlbum object. The album to set as current. - Returns: Bool - Description: Sets the specified GalleryStillAlbum object as the current album. GetGalleryStillAlbums() - Returns: [galleryStillAlbum] - Description: Returns a list of all gallery Still albums as GalleryStillAlbum objects. GetGalleryPowerGradeAlbums() - Returns: [galleryStillAlbum] - Description: Returns a list of all gallery PowerGrade albums as GalleryStillAlbum objects. CreateGalleryStillAlbum() - Returns: galleryStillAlbum or None - Description: Creates and returns a new Still album (GalleryStillAlbum object), or None if unsuccessful. CreateGalleryPowerGradeAlbum() - Returns: galleryStillAlbum or None - Description: Creates and returns a new PowerGrade album (GalleryStillAlbum object), or None if unsuccessful. ``` -------------------------------- ### Folder Import from DRB Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Imports a folder structure from a specified DaVinci Resolve Project (DRB) file. Optionally searches for source clips if media is inaccessible. ```APIDOC ImportFolderFromFile(filePath, sourceClipsPath="") - Returns true if import from the given DRB filePath is successful, false otherwise. - sourceClipsPath is a string that specifies a filesystem path to search for source clips if the media is inaccessible in their original path, empty by default. - Returns: Bool ``` -------------------------------- ### Resolve Object API Functions Source: https://github.com/thesleepingsage/davinci-resolve-scripting-api/blob/main/DaVinci Resolve Scripting Doc.md Provides access to core DaVinci Resolve application functionalities, including page switching, product information, layout management, and application control. ```APIDOC Resolve: Fusion() --> Fusion Returns the Fusion object. Starting point for Fusion scripts. GetMediaStorage() --> MediaStorage Returns the media storage object to query and act on media locations. GetProjectManager() --> ProjectManager Returns the project manager object for currently open database. OpenPage(pageName: str) --> Bool Switches to indicated page in DaVinci Resolve. Parameters: pageName: The name of the page to switch to. Input can be one of ("media", "cut", "edit", "fusion", "color", "fairlight", "deliver"). Returns: True if the page was switched successfully. GetCurrentPage() --> String Returns the page currently displayed in the main window. Returns: The name of the current page, or None if no page is active. GetProductName() --> string Returns the product name of DaVinci Resolve. GetVersion() --> [version fields] Returns a list of product version fields in [major, minor, patch, build, suffix] format. GetVersionString() --> string Returns the product version in "major.minor.patch[suffix].build" format. LoadLayoutPreset(presetName: str) --> Bool Loads UI layout from a saved preset named 'presetName'. Returns: True if the preset was loaded successfully. UpdateLayoutPreset(presetName: str) --> Bool Overwrites a preset named 'presetName' with the current UI layout. Returns: True if the preset was updated successfully. ExportLayoutPreset(presetName: str, presetFilePath: str) --> Bool Exports a preset named 'presetName' to the specified file path 'presetFilePath'. Returns: True if the preset was exported successfully. DeleteLayoutPreset(presetName: str) --> Bool Deletes a preset named 'presetName'. Returns: True if the preset was deleted successfully. SaveLayoutPreset(presetName: str) --> Bool Saves the current UI layout as a preset named 'presetName'. Returns: True if the layout was saved successfully. ImportLayoutPreset(presetFilePath: str, presetName: str = None) --> Bool Imports a preset from the specified file path 'presetFilePath'. The optional argument 'presetName' specifies how the preset shall be named. If not specified, the preset is named based on the filename. Returns: True if the preset was imported successfully. Quit() --> None Quits the Resolve App. ImportRenderPreset(presetPath: str) --> Bool Imports a render preset from the given path (string) and sets it as the current preset for rendering. Returns: True if the preset was imported successfully. ExportRenderPreset(presetName: str, exportPath: str) --> Bool Exports a render preset to a given path (string) if the presetName (string) exists. Returns: True if the preset was exported successfully. ImportBurnInPreset(presetPath: str) --> Bool Imports a data burn-in preset from a given presetPath (string). Returns: True if the preset was imported successfully. ExportBurnInPreset(presetName: str, exportPath: str) --> Bool Exports a data burn-in preset to a given path (string) if presetName (string) exists. Returns: True if the preset was exported successfully. GetKeyframeMode() --> keyframeMode Returns the currently set keyframe mode (int). Refer to section 'Keyframe Mode information' below for details. SetKeyframeMode(keyframeMode: enum) --> Bool Sets the keyframe mode. Refer to section 'Keyframe Mode information' below for details. Returns: True when 'keyframeMode' is successfully set. ```