### Python Script Example: Create Project Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt A basic Python script demonstrating how to initialize the DaVinci Resolve scripting API, access the Fusion module, and create a new project named 'Hello World'. This script serves as a starting point for more complex automation tasks. ```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") ``` -------------------------------- ### Develop AutoSubs Frontend (Node.js) Source: https://github.com/tmoroney/auto-subs/blob/main/README.md Steps to run the AutoSubs frontend development server using Node.js. This includes installing dependencies and starting the development process. ```javascript cd AutoSubs-App npm install npm run tauri dev ``` -------------------------------- ### Install AutoSubs on Linux Source: https://github.com/tmoroney/auto-subs/blob/main/README.md Provides commands to download and install the AutoSubs .deb package on Debian-based Linux distributions. Includes steps to resolve potential dependency issues. ```bash wget https://github.com/tmoroney/auto-subs/releases/latest/download/AutoSubs-linux-x86_64.deb sudo apt install ./AutoSubs-linux-x86_64.deb # If you see dependency errors, run: sudo dpkg -i AutoSubs-linux-x86_64.deb && sudo apt -f install ``` -------------------------------- ### DaVinci Resolve Environment Variables Setup Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Environment variables required to set up the DaVinci Resolve scripting API for Python on different operating systems. These variables help the Python installation locate the necessary scripting modules. ```shell Mac OS X: 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/" Windows: 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\" Linux: RESOLVE_SCRIPT_API="/opt/resolve/Developer/Scripting" RESOLVE_SCRIPT_LIB="/opt/resolve/libs/Fusion/fusionscript.so" PYTHONPATH="$PYTHONPATH:$RESOLVE_SCRIPT_API/Modules/" (Note: For standard ISO Linux installations, the path above may need to be modified to refer to /home/resolve instead of /opt/resolve) ``` -------------------------------- ### Develop AutoSubs Backend (Rust) Source: https://github.com/tmoroney/auto-subs/blob/main/README.md Instructions for setting up the development environment for the AutoSubs backend, which is written in Rust. This involves cloning the repository and ensuring the Rust toolchain is installed. ```rust cd AutoSubs-App/src-tauri/ ``` -------------------------------- ### Audio Insertion Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Inserts audio from a specified media path into the current track at the playhead position on the Fairlight page. Requires start offset and duration in samples. ```APIDOC InsertAudioToCurrentTrackAtPlayhead(mediaPath, startOffsetInSamples, durationInSamples) --> Bool # 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. ``` -------------------------------- ### Timeline Navigation and Information Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions to retrieve information about the timeline's duration and start timecode. ```APIDOC GetEndFrame() Returns the frame number at the end of the timeline. Returns: int GetStartTimecode() Returns the start timecode for the timeline. Returns: string ``` -------------------------------- ### DaVinci Resolve Core Functions Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Provides access to core DaVinci Resolve objects and basic application information. These functions are the starting points for scripting within Resolve. ```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. 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. Quit() --> None Quits the Resolve App. ``` -------------------------------- ### Project and Clip Settings API Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Provides functions to get and set project and clip properties. These functions use a key-value pair format, mirroring UI settings. Some properties are read-only. Specific enumerated values and special handling for '2x Enhanced' Super Scale are detailed. ```APIDOC Project:GetSetting(settingName: str = None) Retrieves project settings. Parameters: settingName: The name of the project setting to retrieve. If None, returns all settings. Returns: The value of the specified setting or a dictionary of all settings. Project:SetSetting(settingName: str, value: any) Sets a project setting. Parameters: settingName: The name of the project setting to set. value: The value to set for the setting. Returns: Boolean indicating success or failure. Timeline:GetSetting(settingName: str = None) Retrieves timeline settings. Parameters: settingName: The name of the timeline setting to retrieve. If None, returns all settings. Returns: The value of the specified setting or a dictionary of all settings. Timeline:SetSetting(settingName: str, value: any) Sets a timeline setting. Parameters: settingName: The name of the timeline setting to set. value: The value to set for the setting. Returns: Boolean indicating success or failure. MediaPoolItem:GetClipProperty(propertyName: str = None) Retrieves clip properties. Parameters: propertyName: The name of the clip property to retrieve. If None, returns all properties. Returns: The value of the specified property or a dictionary of all properties. MediaPoolItem:SetClipProperty(propertyName: str, value: any) Sets a clip property. Parameters: propertyName: The name of the clip property to set. value: The value to set for the property. Returns: Boolean indicating success or failure. Project Settings - Enumerated Values: 'superScale': - Value is an integer between 0 and 4. - 0: Auto - 1: No scaling - 2, 3, 4: Super Scale multipliers 2x, 3x, 4x. - For '2x Enhanced': Project:SetSetting('superScale', 2, sharpnessValue, noiseReductionValue) - sharpnessValue: float in [0.0, 1.0] - noiseReductionValue: float in [0.0, 1.0] 'timelineFrameRate': - Value is a string representing available frame rates. - Drop Frame enabled by appending ' DF' (e.g., "29.97 DF"). Clip Properties - Enumerated Values: 'Super Scale': - Value is an integer between 1 and 4. - 1: No scaling - 2, 3, 4: Super Scale multipliers 2x, 3x, 4x. - For '2x Enhanced': MediaPoolItem:SetClipProperty('Super Scale', 2, sharpnessValue, noiseReductionValue) - sharpnessValue: float in [0.0, 1.0] - noiseReductionValue: float in [0.0, 1.0] 'Cloud Sync': - Value is an integer corresponding to enums: - resolve.CLOUD_SYNC_DEFAULT: -1 - resolve.CLOUD_SYNC_DOWNLOAD_IN_QUEUE: 0 - resolve.CLOUD_SYNC_DOWNLOAD_IN_PROGRESS: 1 - resolve.CLOUD_SYNC_DOWNLOAD_SUCCESS: 2 - resolve.CLOUD_SYNC_DOWNLOAD_FAIL: 3 - resolve.CLOUD_SYNC_DOWNLOAD_NOT_FOUND: 4 - resolve.CLOUD_SYNC_UPLOAD_IN_QUEUE: 5 - resolve.CLOUD_SYNC_UPLOAD_IN_PROGRESS: 6 - resolve.CLOUD_SYNC_UPLOAD_SUCCESS: 7 - resolve.CLOUD_SYNC_UPLOAD_FAIL: 8 - resolve.CLOUD_SYNC_UPLOAD_NOT_FOUND: 9 - resolve.CLOUD_SYNC_SUCCESS: 10 ``` -------------------------------- ### Configure DaVinci Resolve Integration for Development Source: https://github.com/tmoroney/auto-subs/blob/main/README.md Guides on how to configure the Lua script for DaVinci Resolve to connect to a locally running development instance of AutoSubs. This involves placing the script in the correct Resolve directory and setting development mode. ```lua -- AutoSubs.lua -- Set this variable to true to enable dev mode local dev_mode = true -- Set this variable to the path where the git repo was cloned local repo_path = "/path/to/your/cloned/repo" -- Windows: %appdata%/Blackmagic Design/DaVinci Resolve/Support/Fusion/Scripts/Utility -- macOS: /Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility ``` -------------------------------- ### Media Pool Folder Operations Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions for interacting with the Media Pool, including getting the root folder, adding subfolders, and refreshing folder structures. ```APIDOC MediaPool: GetRootFolder() --> Folder # Returns root Folder of Media Pool AddSubFolder(folder, name) --> Folder # Adds new subfolder under specified Folder object with the given name. RefreshFolders() --> Bool # Updates the folders in collaboration mode ``` -------------------------------- ### Graph Node and LUT Management API Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt APIs for interacting with graph nodes, including setting and getting LUTs, cache modes, labels, and node enablement. ```APIDOC Graph: GetNumNodes() --> int # Returns the number of nodes in the graph SetLUT(nodeIndex, lutPath) --> Bool # Sets LUT on the node mapping the node index provided, 1 <= nodeIndex <= self.GetNumNodes(). # 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). GetLUT(nodeIndex) --> String # Gets relative LUT path based on the node index provided, 1 <= nodeIndex <= total number of nodes. SetNodeCacheMode(nodeIndex, cache_value) --> Bool # Sets the cache mode type on the node mapping the node index provided. Refer to "Cache Mode" section below to find the possible values of cache_value. GetNodeCacheMode(nodeIndex) --> cache_value # Returns the cache mode type on the node mapping the node index provided. GetNodeLabel(nodeIndex) --> string # Returns the label of the node at nodeIndex. GetToolsInNode(nodeIndex) --> [toolsList] # Returns toolsList (list of strings) of the tools used in the node indicated by given nodeIndex (int). SetNodeEnabled(nodeIndex, isEnabled) --> Bool # Sets the node at the given nodeIndex (int) to isEnabled (bool). # 1 <= nodeIndex <= self.GetNumNodes(). ApplyGradeFromDRX(path, gradeMode) --> Bool # Loads a still from given file path (string) and applies grade to graph with gradeMode (int): 0 - “No keyframes”, 1 - “Source Timecode aligned”, 2 - “Start Frames aligned”. ApplyArriCdlLut() --> Bool # Applies ARRI CDL and LUT. Returns True if successful, False otherwise. ``` -------------------------------- ### Creating a Fusion Cross Dissolve Transition Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/FusionDocs.txt Step-by-step guide to creating a basic cross dissolve Fusion transition. This involves adding a Fusion Composition, a Dissolve tool, applying the Anim Curves modifier for adaptable animation, creating a macro, and saving it as a transition preset. ```APIDOC 1. Add Fusion Composition to Edit page timeline. 2. Add Dissolve tool to Fusion Flow. 3. In Inspector, right-click Background/Foreground control, select 'Modify With > Anim Curves'. 4. (Optional) In Modifiers tab, set Anim Curves 'Curve' to 'Easing' and choose an ease-in type. 5. In Nodes view, right-click Dissolve tool, select 'Macro > Create Macro'. 6. In Macro Editor, ensure Output, Background, and Foreground checkboxes are enabled. 7. (Optional) Enable other controls for Inspector customization. 8. Name the transition and save the macro via File > Save. 9. Restart Resolve. 10. Access the custom transition in the Edit page's Effects Library under Toolbox > Video Transitions > Fusion Transitions. ``` -------------------------------- ### Unsupported Resolve API Functions - Settings Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Highlights unsupported 'GetSetting' and 'SetSetting' functions and their replacements for specific video monitoring and proxy media settings. ```APIDOC Project: GetSetting and SetSetting -> {} Deprecated: settingName videoMonitorUseRec601For422SDI is now replaced with videoMonitorUseMatrixOverrideFor422SDI and videoMonitorMatrixOverrideFor422SDI. Deprecated: settingName perfProxyMediaOn is now replaced with perfProxyMediaMode which takes values 0 - disabled, 1 - when available, 2 - when source not available. ``` -------------------------------- ### Timeline Item Properties and Markers Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Provides methods for interacting with timeline items, including retrieving their names, durations, start and end positions, and managing associated Fusion compositions. It also details functions for setting, getting, adding, updating, and deleting markers with custom data and colors. ```APIDOC TimelineItem: GetName() --> string Returns the item name. GetDuration(subframe_precision) --> int/float Returns the item duration. Returns fractional frames if subframe_precision is True. GetEnd(subframe_precision) --> int/float Returns the end frame position on the timeline. Returns fractional frames if subframe_precision is True. GetSourceEndFrame() --> int Returns the end frame position of the media pool clip in the timeline clip. GetSourceEndTime() --> float Returns the end time position of the media pool clip in the timeline clip. GetFusionCompCount() --> int Returns number of Fusion compositions associated with the timeline item. GetFusionCompByIndex(compIndex) --> fusionComp Returns the Fusion composition object based on given index. 1 <= compIndex <= timelineItem.GetFusionCompCount(). GetFusionCompNameList() --> [names...] Returns a list of Fusion composition names associated with the timeline item. GetFusionCompByName(compName) --> fusionComp Returns the Fusion composition object based on given name. GetLeftOffset(subframe_precision) --> int/float Returns the maximum extension by frame for clip from left side. Returns fractional frames if subframe_precision is True. GetRightOffset(subframe_precision) --> int/float Returns the maximum extension by frame for clip from right side. Returns fractional frames if subframe_precision is True. GetStart(subframe_precision) --> int/float Returns the start frame position on the timeline. Returns fractional frames if subframe_precision is True. GetSourceStartFrame() --> int Returns the start frame position of the media pool clip in the timeline clip. GetSourceStartTime() --> float Returns the start time position of the media pool clip in the timeline clip. SetProperty(propertyKey, propertyValue) --> Bool Sets the value of property "propertyKey" to value "propertyValue". Refer to "Looking up Timeline item properties" for more information. GetProperty(propertyKey) --> int/[key:value] 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. 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: a value of {96.0: {'color': 'Green', 'duration': 1.0, 'note': '', 'name': 'Marker 1', 'customData': ''}, ...} indicates a single green marker at clip offset 96. 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. DeleteMarkersByColor(color) --> Bool Delete all markers of the specified color from the timeline item. "All" as argument deletes all color markers. ``` -------------------------------- ### Render Settings Configuration Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt APIs for configuring render settings, including setting arbitrary settings, retrieving specific settings, and performing quick exports with customizable parameters. ```APIDOC SetRenderSettings(settings: dict) -> bool Sets given settings for rendering. Settings is a dict, with support for the keys: Refer to "Looking up render settings" section for information for supported settings. GetSetting(settingName: str) -> string Returns value of project setting (indicated by settingName, string). Check the section below for more information. SetSetting(settingName: str, settingValue: str) -> bool Sets the project setting (indicated by settingName, string) to the value (settingValue, string). Check the section below for more information. GetQuickExportRenderPresets() -> [preset_name..] Returns a list of Quick Export render presets by name. RenderWithQuickExport(preset_name: str, param_dict: dict) -> {status info} Starts a quick export render for the current active timeline. preset_name from GetQuickExportRenderPresets list. param_dict supports render settings keys "TargetDir", "CustomName", "VideoQuality", and "EnableUpload". "EnableUpload" key enables direct upload for supported web presets. Returns a dict with job status and time taken to render, or an error string if render has failed or not attempted Refer to "Looking up Render Settings" section for information on the above supported settings. ``` -------------------------------- ### Timeline Timecode Setting Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Function to set the start timecode of the timeline. ```APIDOC SetStartTimecode(timecode) Sets the start timecode of the timeline to the provided string 'timecode'. Parameters: timecode (string): The desired start timecode. Returns: Bool - True if the change was successful, False otherwise. ``` -------------------------------- ### Folder and Project Navigation Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Manage project folders and navigate the directory structure. Includes functions to delete folders, list contents, move between folders, and open specific folders. ```APIDOC DeleteFolder(folderName) - Deletes the specified folder if it exists. - Returns: Bool (True on success) 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 (True on success) GotoParentFolder() - Opens the parent folder of the current folder if it exists. - Returns: Bool (True on success) GetCurrentFolder() - Returns the name of the current folder. - Returns: string OpenFolder(folderName) - Opens the folder with the given name. - Returns: Bool (True on success) ``` -------------------------------- ### Retrieving Items from a Track Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Function to get a list of all timeline items present on a specific track. ```APIDOC GetItemListInTrack(trackType, index) Returns a list of timeline items on the specified track. Parameters: trackType (string): The type of track ('audio', 'video', 'subtitle'). index (int): The index of the track (1 <= index <= GetTrackCount(trackType)). Returns: list - A list of timeline items on the track. ``` -------------------------------- ### Project and Preset Management Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions for managing project names and render presets. This includes setting the project name, retrieving lists of available presets, setting a specific preset for use, and creating or deleting custom presets. ```APIDOC SetName(projectName: str) -> bool Sets project name if given projectName (string) is unique. GetPresetList() -> [presets...] Returns a list of presets and their information. SetPreset(presetName: str) -> bool Sets preset by given presetName (string) into project. LoadRenderPreset(presetName: str) -> bool Sets a preset as current preset for rendering if presetName (string) exists. SaveAsNewRenderPreset(presetName: str) -> bool Creates new render preset by given name if presetName(string) is unique. DeleteRenderPreset(presetName: str) -> bool Delete render preset by provided name. ``` -------------------------------- ### Timeline Item Color Management Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions to get, set, and clear the clip color of a timeline item. ```APIDOC GetClipColor() --> string # Returns the item color as a string. SetClipColor(colorName) --> Bool # Sets the item color based on the colorName (string). ClearClipColor() --> Bool # Clears the item color. ``` -------------------------------- ### Render Settings API Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Details the parameters for the SetRenderSettings method, which controls rendering behavior. Options include selecting all frames, specifying mark-in and mark-out points, and defining the target directory for the output. ```APIDOC SetRenderSettings({ "SelectAllFrames": Bool, "MarkIn": int, "MarkOut": int, "TargetDir": string }) Parameters: - SelectAllFrames: If true, MarkIn and MarkOut are ignored. - MarkIn: The starting frame for rendering. - MarkOut: The ending frame for rendering. - TargetDir: The directory where the rendered output will be saved. ``` -------------------------------- ### Node Operations Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Manages nodes within a timeline item's graph, including getting node labels, counts, and setting/getting LUTs. ```APIDOC TimelineItem: GetNumNodes() -> int Returns the number of nodes in the current graph for the timeline item. SetLUT(nodeIndex, lutPath) -> Bool 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). GetLUT(nodeIndex) -> String Gets relative LUT path based on the node index provided, 1 <= nodeIndex <= total number of nodes. GetNodeLabel(nodeIndex) -> string Returns the label of the node at nodeIndex. ``` -------------------------------- ### Resolve Cloud Project Management Settings Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Outlines the settings dictionary and enumerated values for managing cloud projects in Resolve. Covers functions like `LoadCloudProject`, `CreateCloudProject`, `ImportCloudProject`, and `RestoreCloudProject`. ```APIDOC Cloud Projects Settings: Functions: ProjectManager:LoadCloudProject, ProjectManager:CreateCloudProject, ProjectManager:ImportCloudProject, ProjectManager:RestoreCloudProject All functions take a {cloudSettings} dict with the following 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] Note for ProjectManager:LoadCloudProject: - Only honours resolve.CLOUD_SETTING_PROJECT_NAME, resolve.CLOUD_SETTING_PROJECT_MEDIA_PATH and resolve.CLOUD_SETTING_SYNC_MODE on first load. - Subsequent loads honour only resolve.CLOUD_SETTING_PROJECT_NAME. Where syncMode is one of the following values: * 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. - ProjectManager:LoadCloudProject and ProjectManager:CreateCloudProject also require resolve.PROJECT_NAME to be defined. ``` -------------------------------- ### DaVinci Resolve Keyframe Mode Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions to get and set the keyframe mode in DaVinci Resolve. Keyframe mode affects how keyframes are interpolated and displayed. ```APIDOC Resolve: GetKeyframeMode() --> keyframeMode Returns the currently set keyframe mode (int). Refer to section 'Keyframe Mode information' below for details. SetKeyframeMode(keyframeMode: enum) --> Bool Returns True when 'keyframeMode'(enum) is successfully set. Refer to section 'Keyframe Mode information' below for details. ``` -------------------------------- ### DaVinci Resolve Project Manager Functions Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt APIs for managing projects within DaVinci Resolve, including creating, loading, saving, closing, deleting projects, and managing folders. ```APIDOC ProjectManager: ArchiveProject(projectName: str, filePath: str, isArchiveSrcMedia: bool = True, isArchiveRenderCache: bool = True, isArchiveProxyMedia: bool = False) --> Bool Archives project to provided file path with the configuration as provided by the optional arguments. CreateProject(projectName: str) --> Project Creates and returns a project if projectName (string) is unique, and None if it is not. DeleteProject(projectName: str) --> Bool Delete project in the current folder if not currently loaded. LoadProject(projectName: str) --> Project Loads and returns the project with name = projectName (string) if there is a match found, and None if there is no matching Project. GetCurrentProject() --> Project Returns the currently loaded Resolve project. SaveProject() --> Bool Saves the currently loaded project with its own name. Returns True if successful. CloseProject(project: Project) --> Bool Closes the specified project without saving. CreateFolder(folderName: str) --> Bool Creates a folder if folderName (string) is unique. ``` -------------------------------- ### Burn-In Preset Loading Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Loads a user-defined data burn-in preset for the project. ```APIDOC LoadBurnInPreset(presetName) --> Bool # Loads user defined data burn in preset for project when supplied presetName (string). # Returns true if successful. ``` -------------------------------- ### Render Mode Management Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions to get and set the current render mode. The render mode determines whether individual clips or a single clip is processed. ```APIDOC GetCurrentRenderMode() --> int # Returns the render mode: 0 - Individual clips, 1 - Single clip. SetCurrentRenderMode(renderMode) --> Bool # Sets the render mode. Specify renderMode = 0 for Individual clips, 1 for Single clip. ``` -------------------------------- ### Rendering Control and Status Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions to control the rendering process, including starting and stopping rendering, checking if rendering is in progress, and retrieving information about render presets and formats. ```APIDOC StartRendering(jobId1: str, jobId2: ..., ...) -> bool Starts rendering jobs indicated by the input job ids. StartRendering(jobIds: list[str], isInteractiveMode: bool = False) -> bool Starts rendering jobs indicated by the input job ids. The optional "isInteractiveMode", when set, enables error feedback in the UI during rendering. StartRendering(isInteractiveMode: bool = False) -> bool Starts rendering all queued render jobs. The optional "isInteractiveMode", when set, enables error feedback in the UI during rendering. StopRendering() -> None Stops any current render processes. IsRenderingInProgress() -> bool Returns True if rendering is in progress. GetRenderPresetList() -> [presets...] Returns a list of render presets and their information. GetRenderFormats() -> {render formats..} Returns a dict (format -> file extension) of available render formats. GetRenderCodecs(renderFormat: str) -> {render codecs...} Returns a dict (codec description -> codec name) of available codecs for given render format (string). GetCurrentRenderFormatAndCodec() -> {format, codec} Returns a dict with currently selected format 'format' and render codec 'codec'. SetCurrentRenderFormatAndCodec(format: str, codec: str) -> bool Sets given render format (string) and render codec (string) as options for rendering. ``` -------------------------------- ### Clone Auto-Subs Repository Source: https://github.com/tmoroney/auto-subs/blob/main/CONTRIBUTING.md Clones the Auto-Subs repository from GitHub to your local machine. This is the first step after forking the project. ```sh git clone https://github.com/YOUR-USERNAME/auto-subs.git ``` -------------------------------- ### Project Import and Export Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Handle the import and export of projects. Supports exporting with or without associated media files and restoring projects from backups. ```APIDOC ImportProject(filePath, projectName=None) - Imports a project from the specified file path. - projectName: Optional name for the imported project. - Returns: Bool (True on success) ExportProject(projectName, filePath, withStillsAndLUTs=True) - Exports a project to the provided file path. - withStillsAndLUTs: Boolean flag to include stills and LUTs (defaults to True). - Returns: Bool (True on success) RestoreProject(filePath, projectName=None) - Restores a project from the specified file path. - projectName: Optional name for the restored project. - Returns: Bool (True on success) ``` -------------------------------- ### Resolve Audio Sync Settings Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Details the settings dictionary and enumerated values for audio synchronization in Resolve's MediaPool API. Covers the `MediaPool:AutoSyncAudio` function and its parameters. ```APIDOC Audio Sync Settings: Function: MediaPool:AutoSyncAudio Takes in a {audioSyncSettings} dict with the following keys: * resolve.AUDIO_SYNC_MODE: audioSyncMode (see below), [resolve.AUDIO_SYNC_TIMECODE by default] * resolve.AUDIO_SYNC_CHANNEL_NUMBER: channelNumber (see below) [1 by default] * resolve.AUDIO_SYNC_RETAIN_EMBEDDED_AUDIO: Bool, [False by default] * resolve.AUDIO_SYNC_RETAIN_VIDEO_METADATA: Bool, [False by default] Where audioSyncMode can be one of the following: * resolve.AUDIO_SYNC_WAVEFORM * resolve.AUDIO_SYNC_TIMECODE With AUDIO_SYNC_WAVEFORM mode, channelNumber is used to determine channel offset for comparison. channelNumber can be one of the following: * resolve.AUDIO_SYNC_CHANNEL_AUTOMATIC = -1 * resolve.AUDIO_SYNC_CHANNEL_MIX = -2 ``` -------------------------------- ### Timeline Management Functions Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions for managing timeline properties. GetName retrieves the current timeline name, SetName updates the timeline name if it's unique, and GetStartFrame returns the starting frame number of the timeline. ```APIDOC GetName() - Returns the timeline name. - Returns: string SetName(timelineName) - Sets the timeline name if timelineName (string) is unique. - Returns True if successful. - Returns: Bool GetStartFrame() - Returns the frame number at the start of timeline. - Returns: int ``` -------------------------------- ### Media Linking and Replacement Functions Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions for managing media file links and replacements. This includes linking proxy media, linking full-resolution media, unlinking proxy media, replacing the entire clip, and replacing a clip while preserving sub-clip extents. ```APIDOC LinkProxyMedia(proxyMediaFilePath) - Links proxy media located at path specified by arg 'proxyMediaFilePath' with the current clip. - 'proxyMediaFilePath' should be 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 clip. - Returns: Bool ReplaceClip(filePath) - Replaces the underlying asset and metadata of MediaPoolItem with the specified absolute clip path. - Returns: Bool ReplaceClipPreserveSubClip(filePath) - Replaces the underlying asset and metadata of a video or audio clip with the specified absolute clip path, preserving original sub clip extents. - Returns: Bool ``` -------------------------------- ### Voice Isolation Control Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions to manage the voice isolation state of audio tracks. This includes clearing existing marks, getting the current state, and setting a new state with specific parameters for enablement and intensity. ```APIDOC ClearMarkInOut(type="all") --> Bool Clears mark in/out of type "video", "audio" or "all" (default). GetVoiceIsolationState(trackIndex) --> {VoiceIsolationState} Returns the Voice Isolation State as a dict {isEnabled, amount}, of the given track index. SetVoiceIsolationState(trackIndex, {VoiceIsolationState}) --> Bool Sets Voice Isolation state of audio track with given trackIndex (int) to the given VoiceIsolationState of {isEnabled (bool), amount (int)}. amount is in range of [0, 100] and 1 <= trackIndex <= GetTrackCount("audio"). Returns True if successful. ``` -------------------------------- ### Fusion Template Directory Structure Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/FusionDocs.txt Specifies the default locations for Fusion templates on a system, differentiating between all users and specific user installations. It also details the required subfolders for templates to be accessible from the Cut and Edit pages. ```text All users: /var/BlackmagicDesign/DaVinci Resolve/Fusion/Templates/ (or for some installs, /home/resolve/Fusion/Templates/) Specific user: $HOME/.local/share/DaVinciResolve/Fusion/Templates/ Required subdirectories for Cut/Edit page availability: Edit/ Transitions/ Titles/ Generators/ Effects/ ``` -------------------------------- ### Clip Property Management Functions Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Functions for getting and setting clip properties. GetClipProperty can retrieve a specific property by name or return all properties as a dictionary if no name is provided. SetClipProperty updates a specific property with a new value. ```APIDOC GetClipProperty(propertyName=None) - Returns the property value for the key 'propertyName'. - If no argument is specified, a dict of all clip properties is returned. - Returns: string|dict SetClipProperty(propertyName, propertyValue) - Sets the given property to propertyValue (string). - Returns: Bool ``` -------------------------------- ### Gallery Management API Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt APIs for managing gallery albums and stills, including creating, importing, exporting, and deleting. ```APIDOC Gallery: GetAlbumName(galleryStillAlbum) --> string # Returns the name of the GalleryStillAlbum object 'galleryStillAlbum'. SetAlbumName(galleryStillAlbum, albumName) --> Bool # Sets the name of the GalleryStillAlbum object 'galleryStillAlbum' to 'albumName'. GetCurrentStillAlbum() --> galleryStillAlbum # Returns current album as a GalleryStillAlbum object. SetCurrentStillAlbum(galleryStillAlbum) --> Bool # Sets current album to GalleryStillAlbum object 'galleryStillAlbum'. GetGalleryStillAlbums() --> [galleryStillAlbum] # Returns the gallery Still albums as a list of GalleryStillAlbum objects. GetGalleryPowerGradeAlbums() --> [galleryStillAlbum] # Returns the gallery PowerGrade albums as a list of GalleryStillAlbum objects. CreateGalleryStillAlbum() --> galleryStillAlbum # Returns a newly created Still album (GalleryStillAlbum object), or None if not successful. CreateGalleryPowerGradeAlbum() --> galleryStillAlbum # Returns a newly created PowerGrade album (GalleryStillAlbum object), or None if not successful. GalleryStillAlbum: GetStills() --> [galleryStill] # Returns the list of GalleryStill objects in the album. GetLabel(galleryStill) --> string # Returns the label of the galleryStill. SetLabel(galleryStill, label) --> Bool # Sets the new 'label' to GalleryStill object 'galleryStill'. ImportStills([filePaths]) --> Bool # Imports GalleryStill from each filePath in [filePaths] list. True if at least one still is imported successfully. False otherwise. ExportStills([galleryStill], folderPath, filePrefix, format) --> Bool # 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, drx). DeleteStills([galleryStill]) --> Bool # Deletes specified list of GalleryStill objects '[galleryStill]'. ``` -------------------------------- ### Media Storage Volume and Folder Listing Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Retrieves lists of mounted volumes and subfolders within the Media Storage. ```APIDOC MediaStorage: GetMountedVolumeList() --> [paths...] # Returns list of folder paths corresponding to mounted volumes displayed in Resolve’s Media Storage. GetSubFolderList(folderPath) --> [paths...] # Returns list of folder paths in the given absolute folder path. ``` -------------------------------- ### Marker Management Functions Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Provides functions for retrieving, updating, and deleting markers based on custom data, frame ID, or color. Includes operations for getting marker information, updating custom data, and deleting markers by various criteria. ```APIDOC GetMarkerByCustomData(customData) - Returns marker {information} for the first matching marker with specified customData. UpdateMarkerCustomData(frameId, customData) - 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. - Returns: Bool GetMarkerCustomData(frameId) - Returns customData string for the marker at given frameId position. - Returns: string DeleteMarkersByColor(color) - Delete all markers of the specified color from the media pool item. - "All" as argument deletes all color markers. - Returns: Bool DeleteMarkerAtFrame(frameNum) - Delete marker at frame number from the media pool item. - Returns: Bool DeleteMarkerByCustomData(customData) - Delete first matching marker with specified customData. - Returns: Bool ``` -------------------------------- ### Cloud Project Operations Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Interact with cloud-based projects, including creation, loading, importing, and restoring. ```APIDOC CreateCloudProject({cloudSettings}) - Creates and returns a new cloud project. - {cloudSettings}: Dictionary containing settings for the cloud project. - Returns: Project LoadCloudProject({cloudSettings}) - Loads a cloud project matching the provided settings. - {cloudSettings}: Dictionary containing settings for the cloud project. - Returns: Project (or None if no match found) ImportCloudProject(filePath, {cloudSettings}) - Imports a cloud project from the specified file path. - filePath: Path to the file to import (string). - {cloudSettings}: Dictionary containing settings for the cloud project. - Returns: Bool (True if successful, False otherwise) RestoreCloudProject(folderPath, {cloudSettings}) - Restores a cloud project from the specified folder path. - folderPath: Path to the folder to restore from (string). - {cloudSettings}: Dictionary containing settings for the cloud project. - Returns: Bool (True if successful, False otherwise) ``` -------------------------------- ### Scaling Constants Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Specifies how media should be scaled. Options include cropping, fitting, filling, or stretching to match target dimensions. ```APIDOC Scaling: SCALE_USE_PROJECT = 0 SCALE_CROP SCALE_FIT SCALE_FILL SCALE_STRETCH ``` -------------------------------- ### Resolve Grade and Clip Management Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Provides functions for resetting grades and managing color groups within the Resolve timeline. Includes methods to get and set group names, retrieve clips associated with a group, and access pre/post-clip node graphs. ```Python ResetAllGrades() --> Bool ColorGroup: GetName() --> String SetName(groupName) --> Bool GetClipsInTimeline(Timeline=CurrTimeline) --> [TimelineItem] GetPreClipNodeGraph() --> Graph GetPostClipNodeGraph() --> Graph ``` -------------------------------- ### Project Object Methods Source: https://github.com/tmoroney/auto-subs/blob/main/Docs/ResolveDocs.txt Methods available on a Project object for accessing its components and properties. ```APIDOC Project.GetMediaPool() - Returns the Media Pool object associated with the project. - Returns: MediaPool Project.GetTimelineCount() - Returns the total number of timelines in the project. - Returns: int Project.GetTimelineByIndex(idx) - Retrieves a timeline by its index. - idx: The index of the timeline (1 <= idx <= project.GetTimelineCount()). - Returns: Timeline Project.GetCurrentTimeline() - Returns the currently active timeline in the project. - Returns: Timeline Project.SetCurrentTimeline(timeline) - Sets a specified timeline as the current one for the project. - timeline: The Timeline object to set as current. - Returns: Bool (True if successful) Project.GetGallery() - Returns the Gallery object of the project. - Returns: Gallery Project.GetName() - Returns the name of the project. - Returns: string ```