### Python Example: Create a New Project in DaVinci Resolve Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md This Python script demonstrates how to connect to the DaVinci Resolve application and create a new project named 'Hello World'. It initializes the Resolve and Fusion objects and uses the Project Manager to create the project. This serves as a basic starting point for scripting interactions with 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") ``` -------------------------------- ### DaVinci Resolve Scripts Installation Path - Windows Source: https://github.com/thesleepingsage/dvr-docs/blob/main/README.md Indicates the default installation directory for DaVinci Resolve scripts on Windows operating systems. Scripts placed in this directory will be accessible within DaVinci Resolve's Fusion page. ```Plaintext C:\ProgramData\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\ ``` -------------------------------- ### DaVinci Resolve Scripts Installation Path - MacOS Source: https://github.com/thesleepingsage/dvr-docs/blob/main/README.md Indicates the default installation directory for DaVinci Resolve scripts on macOS operating systems. Scripts placed in this directory will be accessible within DaVinci Resolve's Fusion page. ```Plaintext Macintosh HD/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/ ``` -------------------------------- ### SetRenderSettings API Parameters Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Documents the 'settings' dictionary parameter for the 'SetRenderSettings' method. It lists various keys for controlling render output, including frame range, target directory, file naming, video/audio export options, format dimensions, frame rate, pixel aspect ratio, quality, codecs, color/gamma tags, alpha export, encoding profiles, multi-pass encoding, alpha mode, network optimization, clip start frame, timeline start timecode, and file replacement. ```APIDOC SetRenderSettings({settings}) Parameter: settings (dictionary) Keys: - "SelectAllFrames": Bool (when set True, the settings MarkIn and MarkOut are ignored) - "MarkIn": int - "MarkOut": int - "TargetDir": string - "CustomName": string - "UniqueFilenameStyle": int (0 - Prefix, 1 - Suffix) - "ExportVideo": Bool - "ExportAudio": Bool - "FormatWidth": int - "FormatHeight": int - "FrameRate": float (examples: 23.976, 24) - "PixelAspectRatio": string (for SD resolution: "16_9" or "4_3"; other resolutions: "square" or "cinemascope") - "VideoQuality": - int: 0 (automatic), [1 -> MAX] (input bit rate) - string: ["Least", "Low", "Medium", "High", "Best"] (input quality level) - "AudioCodec": string (example: "aac") - "AudioBitDepth": int - "AudioSampleRate": int - "ColorSpaceTag": string (example: "Same as Project", "AstroDesign") - "GammaTag": string (example: "Same as Project", "ACEScct") - "ExportAlpha": Bool - "EncodingProfile": string (example: "Main10"). Can only be set for H.264 and H.265. - "MultiPassEncode": Bool. Can only be set for H.264. - "AlphaMode": int (0 - Premultiplied, 1 - Straight). Can only be set if "ExportAlpha" is true. - "NetworkOptimization": Bool. Only supported by QuickTime and MP4 formats. - "ClipStartFrame": int - "TimelineStartTimecode": string (example: "01:00:00:00") - "ReplaceExistingFilesInPlace": Bool ``` -------------------------------- ### Import Media with Detailed Clip Info Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Imports media into the current Media Pool folder based on a list of detailed clip information dictionaries. Each dictionary can specify file paths, start index, and end index, allowing for importing sequences or specific ranges. ```APIDOC ImportMedia([{clipInfo}]) --> [MediaPoolItems] clipInfo: list of dictionaries, each containing: "FilePath": string, the file path (e.g., "file_%03d.dpx" for sequences) "StartIndex": int, start index for sequences "EndIndex": int, end index for sequences 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: list of MediaPoolItem objects created ``` -------------------------------- ### Get Clip Matte List Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Retrieves a list of file paths for mattes associated with a specified MediaPoolItem. ```APIDOC GetClipMatteList(MediaPoolItem) --> [paths] MediaPoolItem: MediaPoolItem object to query for mattes Returns: list of strings, paths to the matte files ``` -------------------------------- ### General Timeline Item Properties and Utilities Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Contains various utility methods for copying grades, enabling/disabling clips, updating sidecar files, getting unique IDs, loading burn-in presets, and creating magic masks. ```APIDOC CopyGrades([tgtTimelineItems]) --> Bool Copies the current node stack layer grade to the same layer for each item in tgtTimelineItems. Returns True if successful. ``` ```APIDOC SetClipEnabled(Bool) --> Bool Sets clip enabled based on argument. ``` ```APIDOC GetClipEnabled() --> Bool Gets clip enabled status. ``` ```APIDOC UpdateSidecar() --> Bool Updates sidecar file for BRAW clips or RMD file for R3D clips. ``` ```APIDOC GetUniqueId() --> string Returns a unique ID for the timeline item ``` ```APIDOC LoadBurnInPreset(presetName) --> Bool Loads user defined data burn in preset for clip when supplied presetName (string). Returns true if successful. ``` ```APIDOC CreateMagicMask(mode) --> Bool Returns True if magic mask was created successfully, False otherwise. mode can "F" (forward), "B" (backward), or "BI" (bidirection) ``` -------------------------------- ### Configure DaVinci Resolve Scripting API Environment Variables (Windows) Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md This snippet demonstrates how to set the required environment variables on Windows to ensure your Python installation can find the DaVinci Resolve Scripting API dependencies. It specifies paths for the API, the Fusion scripting DLL, and modifies the PYTHONPATH. ```Batch RESOLVE_SCRIPT_API="%PROGRAMDATA%\\Blackmagic Design\\DaVinci Resolve\\Support\\Developer\\Scripting" RESOLVE_SCRIPT_LIB="C:\\Program Files\\Blackmagic Design\\DaVinci Resolve\\fusionscript.dll" PYTHONPATH="%PYTHONPATH%;%RESOLVE_SCRIPT_API%\\Modules\\" ``` -------------------------------- ### Get Timeline Matte List in Folder Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Retrieves a list of MediaPoolItem objects representing mattes found within a specified media pool folder. ```APIDOC GetTimelineMatteList(Folder) --> [MediaPoolItems] Folder: Folder object to search for mattes Returns: list of MediaPoolItem objects, representing mattes ``` -------------------------------- ### Create Timeline from Detailed Clip Information Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Creates a new timeline with a specified name, appending a list of clip information dictionaries. Each dictionary can specify the media pool item, start frame, end frame, and record frame for precise clip placement. ```APIDOC CreateTimelineFromClips(name, [{clipInfo}]) --> Timeline name: string, the name for the new timeline clipInfo: list of dictionaries, each containing: "mediaPoolItem": MediaPoolItem object "startFrame": float/int, clip start frame "endFrame": float/int, clip end frame "recordFrame": float/int, timeline record frame Returns: Timeline object ``` -------------------------------- ### GetCurrentClipThumbnailImage() Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Returns a dictionary (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. ```APIDOC GetCurrentClipThumbnailImage() Returns: {"width": int, "height": int, "format": string, "data": string (base64)} Description: 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. ``` -------------------------------- ### Configure DaVinci Resolve Scripting API Environment Variables (Linux) Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md This snippet illustrates how to set the essential environment variables on Linux to allow your Python installation to locate the DaVinci Resolve Scripting API dependencies. It defines paths for the API, the Fusion scripting library, and updates the PYTHONPATH. ```Shell RESOLVE_SCRIPT_API="/opt/resolve/Developer/Scripting" RESOLVE_SCRIPT_LIB="/opt/resolve/libs/Fusion/fusionscript.so" PYTHONPATH="$PYTHONPATH:$RESOLVE_SCRIPT_API/Modules/" ``` -------------------------------- ### Configure DaVinci Resolve Scripting API Environment Variables (macOS) Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md This snippet shows how to set the necessary environment variables on macOS to enable your Python installation to locate the DaVinci Resolve Scripting API dependencies. It defines paths for the API, the Fusion scripting library, and updates the PYTHONPATH. ```Shell RESOLVE_SCRIPT_API="/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting" RESOLVE_SCRIPT_LIB="/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so" PYTHONPATH="$PYTHONPATH:$RESOLVE_SCRIPT_API/Modules/" ``` -------------------------------- ### Apply CDL to Timeline Item Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Allows setting CDL parameters (Slope, Offset, Power, Saturation) for a specific node index on the timeline item. Includes a Python example. ```APIDOC SetCDL([CDL map]) --> Bool Keys of map are: "NodeIndex", "Slope", "Offset", "Power", "Saturation", where 1 <= NodeIndex <= total number of nodes. ``` ```Python 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"}) ``` -------------------------------- ### Retrieve Media Pool Item and Stereo Data Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Methods to get the associated media pool item and retrieve stereo convergence and floating window parameters for left and right eyes. ```APIDOC GetMediaPoolItem() --> MediaPoolItem Returns the media pool item corresponding to the timeline item if one exists. ``` ```APIDOC GetStereoConvergenceValues() --> {keyframes...} Returns a dict (offset -> value) of keyframe offsets and respective convergence values. ``` ```APIDOC GetStereoLeftFloatingWindowParams() --> {keyframes...} For the LEFT eye -> returns a dict (offset -> dict) of keyframe offsets and respective floating window params. Value at particular offset includes the left, right, top and bottom floating window values. ``` ```APIDOC GetStereoRightFloatingWindowParams() --> {keyframes...} For the RIGHT eye -> returns a dict (offset -> dict) of keyframe offsets and respective floating window params. Value at particular offset includes the left, right, top and bottom floating window values. ``` -------------------------------- ### Project and Clip Property Management API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Describes the key-value pair interface for managing properties using `Project:GetSetting`, `Project:SetSetting`, `Timeline:GetSetting`, `Timeline:SetSetting`, `MediaPoolItem:GetClipProperty`, and `MediaPoolItem:SetClipProperty`. It explains how to retrieve all properties or specific ones, and how to set values, noting that some properties may be read-only. ```APIDOC Functions: - Project:GetSetting(settingName: str = None) -> value | dict - Project:SetSetting(settingName: str, value: Any) -> bool - Timeline:GetSetting(settingName: str = None) -> value | dict - Timeline:SetSetting(settingName: str, value: Any) -> bool - MediaPoolItem:GetClipProperty(propertyName: str = None) -> value | dict - MediaPoolItem:SetClipProperty(propertyName: str, value: Any) -> bool Usage: - Getting values: Invoke with appropriate property key. Call without parameters (or None/blank key) to get all queryable properties (slower). - Setting values: Invoke with appropriate property key and a valid value. Check return value for success. Notes: - Properties are identified by key (settingName/propertyName) and have a value. - Keys and values correlate with Resolve UI parameter names. - Some properties may be read-only (e.g., intrinsic clip properties, disabled in specific contexts). ``` -------------------------------- ### DaVinci Resolve Scripting API Documentation File Path - Windows Source: https://github.com/thesleepingsage/dvr-docs/blob/main/README.md Specifies the default file path for the DaVinci Resolve Scripting API Documentation on Windows operating systems. This path leads to the README.txt file containing the API documentation. ```Plaintext C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting\README.txt ``` -------------------------------- ### Get Media Pool Unique ID Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Returns a unique identifier for the current media pool. ```APIDOC GetUniqueId() --> string Returns: string, a unique ID for the media pool ``` -------------------------------- ### Project and Item Management API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Methods for managing project-level settings, individual project items, and timeline-related functionalities such as rendering, LUTs, unique IDs, audio insertion, burn-in presets, still exports, and color group management. ```APIDOC Project: GetRenderResolutions(format: string, codec: string) -> list[dict] format: The render format. codec: The render codec. Returns: A list of resolutions applicable for the given render format and codec. Each element is a dictionary with "Width" and "Height" keys. Notes: Returns full list of resolutions if no argument is provided. RefreshLUTList() -> bool Returns: True if successful, otherwise False. Description: Refreshes the LUT List. GetUniqueId() -> string Returns: A unique ID for the project item. Description: Returns a unique ID for the project item. InsertAudioToCurrentTrackAtPlayhead(mediaPath: string, startOffsetInSamples: int, durationInSamples: int) -> bool mediaPath: Path to the media file. startOffsetInSamples: Start offset in samples. durationInSamples: Duration in samples. Returns: True if successful, otherwise False. Description: Inserts the specified media at the playhead on a selected track on the Fairlight page. LoadBurnInPreset(presetName: string) -> bool presetName: The name of the user-defined data burn-in preset. Returns: True if successful, otherwise False. Description: Loads a user-defined data burn-in preset for the project. ExportCurrentFrameAsStill(filePath: string) -> bool filePath: The path to export the still image to. Must end in a valid export file format. Returns: True if successful, False otherwise. Description: Exports the current frame as a still image. GetColorGroupsList() -> list[ColorGroup] Returns: A list of all ColorGroup objects in the timeline. Description: Returns a list of all group objects in the timeline. AddColorGroup(groupName: string) -> ColorGroup groupName: The name for the new ColorGroup. Must be unique. Returns: The newly created ColorGroup object. Description: Creates a new ColorGroup. DeleteColorGroup(colorGroup: ColorGroup) -> bool colorGroup: The ColorGroup object to delete. Returns: True if successful, otherwise False. Description: Deletes the specified color group and sets associated clips to ungrouped. ``` -------------------------------- ### Get Current Media Pool Folder Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Retrieves the currently selected folder in the media pool. ```APIDOC GetCurrentFolder() --> Folder Returns: Folder object, the currently selected folder ``` -------------------------------- ### DaVinci Resolve Scripting API Documentation File Path - MacOS Source: https://github.com/thesleepingsage/dvr-docs/blob/main/README.md Specifies the default file path for the DaVinci Resolve Scripting API Documentation on macOS operating systems. This path leads to the README.txt file containing the API documentation. ```Plaintext Macintosh HD/Library/Application Support/Blackmagic Design/Developer/Scripting/README.txt ``` -------------------------------- ### Media Storage API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Methods for interacting with DaVinci Resolve's Media Storage, including listing mounted volumes, subfolders, files, revealing paths, and adding items to the Media Pool with various options. ```APIDOC MediaStorage: GetMountedVolumeList() -> list[string] Returns: A list of folder paths for mounted volumes displayed in Resolve’s Media Storage. GetSubFolderList(folderPath: string) -> list[string] folderPath: The absolute folder path. Returns: A list of subfolder paths within the given absolute folder path. GetFileList(folderPath: string) -> list[string] folderPath: The absolute folder path. Returns: A list of media and file listings within the given absolute folder path. Note that media listings may be logically consolidated. RevealInStorage(path: string) -> bool path: The file or folder path to reveal. Returns: True if successful, otherwise False. Description: Expands and displays the given file/folder path in Resolve’s Media Storage. AddItemListToMediaPool(*items: string) -> list[MediaPoolItem] items: One or more file/folder paths from Media Storage. Returns: A list of the created MediaPoolItems. Description: Adds specified file/folder paths from Media Storage into the current Media Pool folder. AddItemListToMediaPool(items: list[string]) -> list[MediaPoolItem] items: An array of file/folder paths from Media Storage. Returns: A list of the created MediaPoolItems. Description: Adds specified file/folder paths from Media Storage into the current Media Pool folder. AddItemListToMediaPool(itemInfos: list[dict]) -> list[MediaPoolItem] itemInfos: A list of dictionaries, each with "media" (path), "startFrame" (int), and "endFrame" (int). Returns: A list of the created MediaPoolItems. Description: Adds a list of item information dictionaries from Media Storage into the current Media Pool folder. AddClipMattesToMediaPool(mediaPoolItem: MediaPoolItem, paths: list[string], stereoEye: string = None) -> bool mediaPoolItem: The MediaPoolItem to add mattes to. paths: A list of media file paths to add as mattes. stereoEye: Optional. Specifies which eye to add the matte to for stereo clips ("left" or "right"). Returns: True if successful. Description: Adds specified media files as mattes for a MediaPoolItem. AddTimelineMattesToMediaPool(paths: list[string]) -> list[MediaPoolItem] paths: A list of media file paths to add as timeline mattes. Returns: A list of created MediaPoolItems. Description: Adds specified media files as timeline mattes in the current media pool folder. ``` -------------------------------- ### ProjectManager Cloud Project Settings API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Specifies the `cloudSettings` dictionary parameters used by `ProjectManager` functions such as `LoadCloudProject`, `CreateCloudProject`, `ImportCloudProject`, and `RestoreCloudProject`. It details each key's type, default value, and specific behaviors for `LoadCloudProject` regarding which settings are honored. ```APIDOC ProjectManager Functions (CreateCloudProject, LoadCloudProject, ImportCloudProject, RestoreCloudProject): Takes {cloudSettings} dict with keys: - resolve.CLOUD_SETTING_PROJECT_NAME: String, ["" by default] - resolve.CLOUD_SETTING_PROJECT_MEDIA_PATH: String, ["" by default] - resolve.CLOUD_SETTING_IS_COLLAB: Bool, [False by default] - resolve.CLOUD_SETTING_SYNC_MODE: syncMode (see below), [resolve.CLOUD_SYNC_PROXY_ONLY by default] - resolve.CLOUD_SETTING_IS_CAMERA_ACCESS: Bool [False by default] syncMode (enumerated value): - resolve.CLOUD_SYNC_NONE - resolve.CLOUD_SYNC_PROXY_ONLY - resolve.CLOUD_SYNC_PROXY_AND_ORIG Requirements: - All four functions require resolve.PROJECT_MEDIA_PATH to be defined. - LoadCloudProject and CreateCloudProject also require resolve.PROJECT_NAME to be defined. ``` -------------------------------- ### DaVinci Resolve MediaPool API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Methods for managing media pool items, including stereo media creation, audio synchronization, and selection handling within DaVinci Resolve. ```APIDOC MediaPool: CreateStereoMediaPoolItem(leftMediaPoolItem, rightMediaPoolItem) --> 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 ``` -------------------------------- ### DaVinci Resolve Render and Project Settings API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md A comprehensive set of API functions for interacting with DaVinci Resolve's rendering engine and project-level settings. These functions allow for automation of common tasks like queueing renders, managing export presets, and adjusting project properties. ```APIDOC SetPreset(presetName: string) -> Bool presetName: The name of the preset to set into the project. AddRenderJob() -> string Returns: A unique job ID (string) for the new render job. DeleteRenderJob(jobId: string) -> Bool jobId: The ID of the render job to delete. DeleteAllRenderJobs() -> Bool StopRendering() -> None IsRenderingInProgress() -> Bool Returns: True if rendering is in progress, False otherwise. LoadRenderPreset(presetName: string) -> Bool presetName: The name of the preset to load as the current preset for rendering. SaveAsNewRenderPreset(presetName: string) -> Bool presetName: The unique name for the new render preset. DeleteRenderPreset(presetName: string) -> Bool presetName: The name of the render preset to delete. GetRenderJobList() -> list Returns: A list of render jobs and their information. GetRenderPresetList() -> list Returns: A list of render presets and their information. StartRendering(*jobIds: string) -> Bool jobIds: Variable number of job IDs to render. StartRendering(jobIds: list, isInteractiveMode: bool = False) -> Bool jobIds: A list of job IDs to render. isInteractiveMode: Optional. When set to True, enables error feedback in the UI during rendering. StartRendering(isInteractiveMode: bool = False) -> Bool isInteractiveMode: Optional. When set to True, enables error feedback in the UI during rendering. SetRenderSettings(settings: dict) -> Bool settings: A dictionary of render settings. Refer to "Looking up render settings" for supported keys. GetRenderJobStatus(jobId: string) -> dict jobId: The ID of the render job. Returns: A dictionary with job status and completion percentage. GetQuickExportRenderPresets() -> list Returns: A list of Quick Export render preset names. RenderWithQuickExport(preset_name: string, param_dict: dict) -> dict preset_name: The name of the Quick Export preset, from GetQuickExportRenderPresets. param_dict: A dictionary of render settings. Supports "TargetDir", "CustomName", "VideoQuality", "EnableUpload". "EnableUpload" enables direct upload for web presets. Returns: A dictionary with job status and time taken to render, or an error string. GetSetting(settingName: string) -> string settingName: The name of the project setting. Returns: The value of the project setting. SetSetting(settingName: string, settingValue: string) -> Bool settingName: The name of the project setting. settingValue: The value to set the project setting to. GetRenderFormats() -> dict Returns: A dictionary mapping render format names to file extensions. GetRenderCodecs(renderFormat: string) -> dict renderFormat: The render format name. Returns: A dictionary mapping codec descriptions to codec names for the given format. GetCurrentRenderFormatAndCodec() -> dict Returns: A dictionary containing the currently selected 'format' and 'codec'. SetCurrentRenderFormatAndCodec(format: string, codec: string) -> Bool format: The render format name. codec: The render codec name. GetCurrentRenderMode() -> int Returns: The current render mode (0 for Individual clips, 1 for Single clip). SetCurrentRenderMode(renderMode: int) -> Bool renderMode: The render mode to set (0 for Individual clips, 1 for Single clip). ``` -------------------------------- ### DaVinci Resolve Global Project and Database Management API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Provides global functions for managing projects, folders, and database connections within DaVinci Resolve. This includes operations like listing projects/folders, navigating the file system, importing/exporting/restoring projects, and managing database connections including cloud projects. ```APIDOC GetProjectListInCurrentFolder() --> [project names...] # Returns a list of project names in current folder. GetFolderListInCurrentFolder() --> [folder names...] # Returns a list of folder names in current folder. GotoRootFolder() --> Bool # Opens root folder in database. GotoParentFolder() --> Bool # Opens parent folder of current folder in database if current folder has parent. GetCurrentFolder() --> string # Returns the current folder name. OpenFolder(folderName) --> Bool # Opens folder under given name. ImportProject(filePath, projectName=None) --> Bool # Imports a project from the file path provided with given project name, if any. Returns True if successful. ExportProject(projectName, filePath, withStillsAndLUTs=True) --> Bool # Exports project to provided file path, including stills and LUTs if withStillsAndLUTs is True (enabled by default). Returns True in case of success. RestoreProject(filePath, projectName=None) --> Bool # Restores a project from the file path provided with given project name, if any. Returns True if successful. GetCurrentDatabase() --> {dbInfo} # Returns a dictionary (with keys 'DbType', 'DbName' and optional 'IpAddress') corresponding to the current database connection GetDatabaseList() --> [{dbInfo}] # Returns a list of dictionary items (with keys 'DbType', 'DbName' and optional 'IpAddress') corresponding to all the databases added to Resolve SetCurrentDatabase({dbInfo}) --> Bool # Switches current database connection to the database specified by the keys below, and closes any open project. 'DbType': 'Disk' or 'PostgreSQL' (string) 'DbName': database name (string) 'IpAddress': IP address of the PostgreSQL server (string, optional key - defaults to '127.0.0.1') CreateCloudProject({cloudSettings}) --> Project # Creates and returns a cloud project. '{cloudSettings}': Check 'Cloud Projects Settings' subsection below for more information. LoadCloudProject({cloudSettings}) --> Project # Loads and returns a cloud project with the following cloud settings if there is a match found, and None if there is no matching cloud project. '{cloudSettings}': Check 'Cloud Projects Settings' subsection below for more information. ImportCloudProject(filePath, {cloudSettings}) --> Bool # Returns True if import cloud project is successful; False otherwise 'filePath': String; filePath of file to import '{cloudSettings}': Check 'Cloud Projects Settings' subsection below for more information. RestoreCloudProject(folderPath, {cloudSettings}) --> Bool # Returns True if restore cloud project is successful; False otherwise 'folderPath': String; path of folder to restore '{cloudSettings}': Check 'Cloud Projects Settings' subsection below for more information. ``` -------------------------------- ### Resolve Object API Reference Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md The 'Resolve' object provides core application-level functionalities in DaVinci Resolve, serving as the entry point for scripting. It allows access to other key objects like Fusion and ProjectManager, manages UI layouts, handles rendering presets, and controls application state. ```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) -> Bool # Switches to indicated page in DaVinci Resolve. Input can be one of ("media", "cut", "edit", "fusion", "color", "fairlight", "deliver"). GetCurrentPage() -> String # Returns the page currently displayed in the main window. Returned value can be one of ("media", "cut", "edit", "fusion", "color", "fairlight", "deliver", None). GetProductName() -> string # Returns product name. GetVersion() -> [version fields] # Returns list of product version fields in [major, minor, patch, build, suffix] format. GetVersionString() -> string # Returns product version in "major.minor.patch[suffix].build" format. LoadLayoutPreset(presetName) -> Bool # Loads UI layout from saved preset named 'presetName'. UpdateLayoutPreset(presetName) -> Bool # Overwrites preset named 'presetName' with current UI layout. ExportLayoutPreset(presetName, presetFilePath) -> Bool # Exports preset named 'presetName' to path 'presetFilePath'. DeleteLayoutPreset(presetName) -> Bool # Deletes preset named 'presetName'. SaveLayoutPreset(presetName) -> Bool # Saves current UI layout as a preset named 'presetName'. ImportLayoutPreset(presetFilePath, presetName) -> Bool # 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. Quit() -> None # Quits the Resolve App. ImportRenderPreset(presetPath) -> Bool # Import a preset from presetPath (string) and set it as current preset for rendering. ExportRenderPreset(presetName, exportPath) -> Bool # Export a preset to a given path (string) if presetName(string) exists. ImportBurnInPreset(presetPath) -> Bool # Import a data burn in preset from a given presetPath (string) ExportBurnInPreset(presetName, exportPath) -> Bool # Export a data burn in preset to a given path (string) if presetName (string) exists. GetKeyframeMode() -> keyframeMode # Returns the currently set keyframe mode (int). Refer to section 'Keyframe Mode information' below for details. SetKeyframeMode(keyframeMode) -> Bool # Returns True when 'keyframeMode'(enum) is successfully set. Refer to section 'Keyframe Mode information' below for details. ``` -------------------------------- ### DaVinci Resolve Project Object API Methods Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Defines methods available on the `Project` object in DaVinci Resolve, allowing interaction with project-specific elements such as media pools, timelines, galleries, and project metadata. ```APIDOC Project GetMediaPool() --> MediaPool # Returns the Media Pool object. GetTimelineCount() --> int # Returns the number of timelines currently present in the project. GetTimelineByIndex(idx) --> Timeline # Returns timeline at the given index, 1 <= idx <= project.GetTimelineCount() GetCurrentTimeline() --> Timeline # Returns the currently loaded timeline. SetCurrentTimeline(timeline) --> Bool # Sets given timeline as current timeline for the project. Returns True if successful. GetGallery() --> Gallery # Returns the Gallery object. GetName() --> string # Returns project name. SetName(projectName) --> Bool # Sets project name if given projectName (string) is unique. GetPresetList() --> [presets...] # Returns a list of presets and their information. ``` -------------------------------- ### Media Pool API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Methods for managing the Media Pool, including accessing the root folder, adding subfolders, refreshing folders, creating new timelines, and appending MediaPoolItems to timelines with various input formats. ```APIDOC MediaPool: GetRootFolder() -> Folder Returns: The root Folder object of the Media Pool. Description: Returns the root Folder of Media Pool. AddSubFolder(folder: Folder, name: string) -> Folder folder: The parent Folder object. name: The name for the new subfolder. Returns: The newly created Folder object. Description: Adds a new subfolder under the specified Folder object with the given name. RefreshFolders() -> bool Returns: True if successful, otherwise False. Description: Updates the folders in collaboration mode. CreateEmptyTimeline(name: string) -> Timeline name: The name for the new timeline. Returns: The newly created Timeline object. Description: Adds a new timeline with the given name. AppendToTimeline(*clips: MediaPoolItem) -> list[TimelineItem] clips: One or more MediaPoolItem objects to append. Returns: A list of the appended TimelineItems. Description: Appends specified MediaPoolItem objects to the current timeline. AppendToTimeline(clips: list[MediaPoolItem]) -> list[TimelineItem] clips: A list of MediaPoolItem objects to append. Returns: A list of the appended TimelineItems. Description: Appends specified MediaPoolItem objects to the current timeline. AppendToTimeline(clipInfos: list[dict]) -> list[TimelineItem] clipInfos: A list of dictionaries, each with: mediaPoolItem: The MediaPoolItem object. startFrame: (float/int) The start frame. endFrame: (float/int) The end frame. mediaType: (optional, int) 1 for Video only, 2 for Audio only. trackIndex: (int) The track index. recordFrame: (float/int) The record frame. Returns: A list of the appended TimelineItems. Description: Appends a list of clip information dictionaries to the current timeline. CreateTimelineFromClips(name: string, *clips: MediaPoolItem) -> Timeline name: The name for the new timeline. clips: One or more MediaPoolItem objects to append. Returns: The newly created Timeline object. Description: Creates a new timeline with the specified name and appends the given MediaPoolItem objects. ``` -------------------------------- ### Import Media from Paths Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Imports specified file or folder paths into the current Media Pool folder. This overload accepts a simple list of paths. ```APIDOC ImportMedia([items...]) --> [MediaPoolItems] items: list of strings, file/folder paths to import Returns: list of MediaPoolItem objects created ``` -------------------------------- ### DaVinci Resolve Folder API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Methods for interacting with media folders, including listing clips and subfolders, retrieving folder properties, and managing audio transcriptions within DaVinci Resolve. ```APIDOC Folder: GetClipList() --> [clips...] # Returns a list of clips (items) within the folder. GetName() --> string # Returns the media folder name. GetSubFolderList() --> [folders...] # Returns a list of subfolders in the folder. GetIsFolderStale() --> bool # Returns true if folder is stale in collaboration mode, false otherwise GetUniqueId() --> string # Returns a unique ID for the media pool folder Export(filePath) --> bool # Returns true if export of DRB folder to filePath is successful, false otherwise TranscribeAudio() --> Bool # Transcribes audio of the MediaPoolItems within the folder and nested folders. Returns True if successful; False otherwise ClearTranscription() --> Bool # Clears audio transcription of the MediaPoolItems within the folder and nested folders. Returns True if successful; False otherwise. ``` -------------------------------- ### DaVinci Resolve MediaPoolItem API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md Methods for managing individual media pool items, including retrieving and setting metadata, handling third-party metadata, and managing markers within DaVinci Resolve. ```APIDOC MediaPoolItem: GetName() --> string # Returns the clip name. GetMetadata(metadataType=None) --> string|dict # Returns the metadata value for the key 'metadataType'. # If no argument is specified, a dict of all set metadata properties is returned. SetMetadata(metadataType, metadataValue) --> Bool # Sets the given metadata to metadataValue (string). Returns True if successful. SetMetadata({metadata}) --> Bool # Sets the item metadata with specified 'metadata' dict. Returns True if successful. GetThirdPartyMetadata(metadataType=None) --> string|dict # Returns the third party metadata value for the key 'metadataType'. # If no argument is specified, a dict of all set third party metadata properties is returned. SetThirdPartyMetadata(metadataType, metadataValue) --> Bool # Sets/Add the given third party metadata to metadataValue (string). Returns True if successful. SetThirdPartyMetadata({metadata}) --> Bool # Sets/Add the item third party metadata with specified 'metadata' dict. Returns True if successful. GetMediaId() --> string # Returns the unique ID for the MediaPoolItem. AddMarker(frameId, color, name, note, duration, customData) --> Bool # Creates a new marker at given frameId position and with given marker information. 'customData' is optional and helps to attach user specific data to the marker. GetMarkers() --> {markers...} # Returns a dict (frameId -> {information}) of all markers and dicts with their information. # Example of output format: {96.0: {'color': 'Green', 'duration': 1.0, 'note': '', 'name': 'Marker 1', 'customData': ''}, ...} # In the above example - there is one 'Green' marker at offset 96 (position of the marker) GetMarkerByCustomData(customData) --> {markers...} # Returns marker {information} for the first matching marker with specified customData. UpdateMarkerCustomData(frameId, customData) --> Bool # Updates customData (string) for the marker at given frameId position. CustomData is not exposed via UI and is useful for scripting developer to attach any user specific data to markers. GetMarkerCustomData(frameId) --> string # Returns customData string for the marker at given frameId position. ``` -------------------------------- ### Gallery Still Album Content API Source: https://github.com/thesleepingsage/dvr-docs/blob/main/DaVinci Resolve Scripting Doc.md API methods for managing the contents of a specific GalleryStillAlbum, including retrieving stills and setting/getting labels for individual stills. ```APIDOC GetStills() -> [GalleryStill] Returns: The list of GalleryStill objects in the album. GetLabel(galleryStill: GalleryStill) -> string galleryStill: The GalleryStill object. Returns: The label of the galleryStill. SetLabel(galleryStill: GalleryStill, label: string) -> Bool galleryStill: The GalleryStill object. label: The new label to set. Returns: True if the label is set successfully. ```