### Install pydavinci Source: https://pedrolabonia.github.io/pydavinci Install the package using pip within a Python 3.6 environment. ```bash pip install pydavinci ``` -------------------------------- ### Create a compound clip with settings Source: https://pedrolabonia.github.io/pydavinci/timeline Example dictionary structure for the clip_info parameter when creating a compound clip. ```json {"startTimecode" : "00:00:00:00", "name" : "Compound Clip 1"} ``` -------------------------------- ### Example resolution dictionary structure Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Shows the expected structure of the dictionary containing media items grouped by resolution. ```python clips_res = { '1920x1080': [MediaPoolItem1, MediaPoolItem2], '3840x2160': [MediaPoolItem3, MediaPoolItem4], ... } ``` -------------------------------- ### Set Metadata Structure Source: https://pedrolabonia.github.io/pydavinci/mediapoolitem Example structure for the dictionary required by the set_metadata method. ```python meta_dict = { metadata_key: metadata value } ``` -------------------------------- ### Retrieve Render Status Source: https://pedrolabonia.github.io/pydavinci/project Examples of the dictionary structure returned by Project.render_status for active and completed render jobs. ```python {'JobStatus': 'Rendering', 'CompletionPercentage': 92, 'EstimatedTimeRemainingInMs': 1000} ``` ```python {'JobStatus': 'Complete', 'CompletionPercentage': 100, 'TimeTakenToRenderInMs': 25991} ``` -------------------------------- ### Timeline.start_frame Source: https://pedrolabonia.github.io/pydavinci/timeline Retrieves the start frame of the timeline. ```APIDOC ## Timeline.start_frame ### Description Gets the timeline start frame. ### Returns - **int** (int) - Start frame ``` -------------------------------- ### Timeline.name Source: https://pedrolabonia.github.io/pydavinci/timeline Gets or sets the name of the timeline. ```APIDOC ## Timeline.name ### Description Gets or sets the timeline name. ### Parameters - **name** (str) - Required - New timeline name ### Returns - **bool** (str) - True if successful, False otherwise ``` -------------------------------- ### Timeline.items Source: https://pedrolabonia.github.io/pydavinci/timeline Gets TimelineItems from a track. ```APIDOC ## Timeline.items(track_type: str, track_index: int) -> List['TimelineItem'] ### Description Gets TimelineItems from a track. ### Parameters - **track_type** (str) - Required - valid track_type: video, audio, subtitle - **track_index** (int) - Required - track index. Starts at 1 ### Returns - **List[TimelineItem]** (List) - list of items at specified track ``` -------------------------------- ### Timeline.get_track_name Source: https://pedrolabonia.github.io/pydavinci/timeline Gets track name. ```APIDOC ## Timeline.get_track_name(track_type: str, track_index: int) -> str ### Description Gets track name. ### Parameters - **track_type** (str) - Required - valid track_type: video, audio or subtitle - **track_index** (int) - Required - track index. Starts at 1 ### Returns - **str** (str) - track name ``` -------------------------------- ### TimelineItem Writable Properties Source: https://pedrolabonia.github.io/pydavinci/timelineitem Methods to get or set specific TimelineItem properties like color and take index. ```APIDOC ## TimelineItem Writable Properties ### TimelineItem.color - **Description**: Gets or sets the clip color. - **Parameters**: color (str) - Required - The color to be applied. - **Returns**: bool - True if successful, False otherwise. ### TimelineItem.take - **Description**: Gets or sets the current take. - **Parameters**: takeindex (int) - Required - The take index for selection. ``` -------------------------------- ### TimelineItem.get_lut Source: https://pedrolabonia.github.io/pydavinci/timelineitem Gets the LUT name at a specific node index. ```APIDOC ## TimelineItem.get_lut(node_index: int) -> str ### Description Retrieves the LUT name at the specified 'node_index'. ### Parameters - **node_index** (int) - Required - Node index ### Returns - **str** - LUT name (e.g., 'Sony/SLog3SGamut3.CineToLC-709TypeA.cube') ``` -------------------------------- ### Timeline.track_count Source: https://pedrolabonia.github.io/pydavinci/timeline Gets track count on a specific track type. ```APIDOC ## Timeline.track_count(track_type: str) -> int ### Description Gets track count on track_type. ### Parameters - **track_type** (str) - Required - valid track_types: video, audio, subtitle ### Returns - **int** (int) - number of tracks ``` -------------------------------- ### Setting up a media pool folder Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Creates a subfolder in the media pool root and sets it as the active directory for imports. ```python ocf_folder = media_pool.add_subfolder('OCF', media_pool.root_folder) media_pool.set_current_folder(ocf_folder) ``` -------------------------------- ### Project.get_setting Source: https://pedrolabonia.github.io/pydavinci/project Retrieves project settings. ```APIDOC ## Project.get_setting(settingname: Optional[str] = None) -> Any ### Description Retrieves a specific project setting by name, or returns all settings if no name is provided. ### Parameters - **setting** (str) - Required - The name of the setting to retrieve. ### Returns - **Any** - A dictionary containing the setting name and its value. ``` -------------------------------- ### ProjectManager.goto_root_folder Source: https://pedrolabonia.github.io/pydavinci/projectmanager Navigates to the root folder. ```APIDOC ## ProjectManager.goto_root_folder() -> bool ### Description Goes to the root project manager folder. ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### Create and configure timelines Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Generate a timeline from clips and apply custom resolution settings to match the source clips. ```python def generate_premiere_proxies(input_dir, output_dir, proxyfactor): ... render_ids = [] for key in clips_res.keys(): ... media_pool.create_timeline_from_clips( res_folder.name, # (1) res_folder.clips ) timeline = project.timeline timeline.set_setting("useCustomSettings", "1") # (2) timeline.set_setting("timelineResolutionWidth", res_x) timeline.set_setting("timelineResolutionHeight", res_y) ``` -------------------------------- ### Importing pydavinci and initializing objects Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Initializes the Resolve application and core project objects required for media manipulation. ```python from pydavinci import davinci resolve = davinci.Resolve() project = resolve.project project_manager = resolve.project_manager media_pool = resolve.media_pool media_storage = resolve.media_storage ``` -------------------------------- ### Project.render Source: https://pedrolabonia.github.io/pydavinci/project Initiates the rendering process for specified or all jobs. ```APIDOC ## Project.render(job_ids: Optional[List[str]] = None, interactive: bool = True) -> bool ### Description Starts rendering the provided list of job IDs. If no IDs are provided, all jobs in the queue are rendered. ### Parameters - **job_ids** (List[str]) - Optional - List of job IDs to render. Defaults to None (all jobs). - **interactive** (bool) - Optional - Enables error feedback in the UI during rendering. Defaults to True. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### ProjectManager.goto_parent_folder Source: https://pedrolabonia.github.io/pydavinci/projectmanager Navigates to the parent folder. ```APIDOC ## ProjectManager.goto_parent_folder() -> bool ### Description Goes to the parent of the current project manager folder. ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### Project.set_render_format_and_codec Source: https://pedrolabonia.github.io/pydavinci/project Configures the current render format and codec. ```APIDOC ## Project.set_render_format_and_codec(format: str, codec: str) -> bool ### Description Sets the current render format and codec for the project. ### Parameters - **format** (str) - Required - The render format. - **codec** (str) - Required - The render codec. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Importing media and grouping by resolution Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Imports media from a directory and organizes clips into a dictionary keyed by their resolution. ```python def generate_premiere_proxies(input_dir, proxyfactor, output_dir): media_pool.import_media(input_dir) clips_res = defaultdict(list) for media in ocf_folder.clips: clips_res[media.properties['Resolution']].append(media) ``` -------------------------------- ### Project.save_render_preset_as Source: https://pedrolabonia.github.io/pydavinci/project Saves the current render settings as a new preset. ```APIDOC ## Project.save_render_preset_as(preset_name: str) -> bool ### Description Saves the current render configuration as a new preset with the given name. ### Parameters - **preset_name** (str) - Required - The name to save the preset as. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Initialize pydavinci Source: https://pedrolabonia.github.io/pydavinci Import the library and initialize the Resolve object while DaVinci Resolve is running. ```python from pydavinci import davinci resolve = davinci.Resolve() ``` -------------------------------- ### Set render parameters Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Define render format, codec, and output dimensions based on the proxy factor. ```python def generate_premiere_proxies(input_dir, output_dir, proxyfactor): ... render_ids = [] for key in clips_res.keys(): ... project.set_render_format_and_codec("mp4", "H264") render_settings = { # (1) "FormatWidth": (int(res_x) // proxyfactor), # (2) "FormatHeight": (int(res_y) // proxyfactor), "TargetDir": output_dir, } project.set_render_settings(render_settings) ``` -------------------------------- ### Define import options for MediaPool.import_timeline_fromfile Source: https://pedrolabonia.github.io/pydavinci/mediapool Dictionary structure used to configure timeline import settings such as source clip paths and interlace processing. ```python options = { "timelineName": str, # specifies the name of the timeline to be created "importSourceClips": bool, # specifies whether source clips should be imported, True by default "sourceClipsPath": str, # specifies a filesystem path to search for source clips if the media # is inaccessible in their original path and if "importSourceClips" is True "sourceClipsFolders": List[Folder] # to search for source clips if the media is not present in current folder # and if "importSourceClips" is False "interlaceProcessing": bool, # specifies whether to enable interlace processing on the imported # timeline being created. valid only for AAF import } ``` -------------------------------- ### Setting the render preset Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Configures the project to use a specific render preset for proxy generation. ```python def generate_premiere_proxies(input_dir, output_dir, proxyfactor): ... project.set_preset("Proxy_Preset") ``` -------------------------------- ### Project.get_render_codecs Source: https://pedrolabonia.github.io/pydavinci/project Lists available render codecs for a given format. ```APIDOC ## Project.get_render_codecs(render_format: str) -> Dict[Any, Any] ### Description Returns all possible render codecs for the specified format. ### Parameters - **render_format** (str) - Required - The render format to query. ### Returns - **dict** - A dictionary of available render codecs. ``` -------------------------------- ### ProjectManager.load_project Source: https://pedrolabonia.github.io/pydavinci/projectmanager Loads an existing project by name. ```APIDOC ## ProjectManager.load_project(project_name: str) -> Project ### Description Loads the project specified by project_name. ### Parameters - **project_name** (str) - Required - project name ### Returns - **Project** (Project) - The loaded project object ``` -------------------------------- ### Configure ProjectManager Database Source: https://pedrolabonia.github.io/pydavinci/projectmanager Sets the current database configuration for either Disk or PostgreSQL types. ```python ProjectManager.db = { 'DbType': 'Disk', 'DbName': 'Local Database' } ``` ```python ProjectManager.db = { 'DbType': 'PostgreSQL', 'DbName': 'PostgresDB', 'IpAddress': '127.0.0.1' } ``` -------------------------------- ### Project.load_render_preset Source: https://pedrolabonia.github.io/pydavinci/project Loads a saved render preset by name. ```APIDOC ## Project.load_render_preset(preset_name: str) -> bool ### Description Loads the render preset with the specified name. ### Parameters - **preset_name** (str) - Required - The name of the preset to load. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Project Properties Source: https://pedrolabonia.github.io/pydavinci/project Accessors and properties for managing project settings, media, and render configurations. ```APIDOC ## Project Properties ### Description Access various attributes of the current project including settings, media pools, timelines, and render configurations. ### Properties - **settings** (ProjectSettings) - Returns the ProjectSettings interface. - **mediapool** (MediaPool) - Returns the MediaPool object. - **timeline_count** (int) - Returns the total timeline count on the current project. - **name** (str) - Gets or sets the current project name. - **presets** (List[str]) - Returns a list of available project presets. - **render_jobs** (List[str]) - Returns the current list of render jobs. - **render_presets** (List[str]) - Returns the list of available render presets. - **render_formats** (Dict[Any, Any]) - Returns all possible render formats. - **current_render_format_and_codec** (Dict[Any, Any]) - Returns the current render format and codec. - **render_mode** (str) - Gets or sets the current render mode ('single' or 'individual'). - **timeline** (Timeline) - Returns the current Timeline object. ``` -------------------------------- ### Project.add_renderjob Source: https://pedrolabonia.github.io/pydavinci/project Adds the current render settings to the render queue. ```APIDOC ## Project.add_renderjob(block: bool = True) -> str ### Description Adds current render settings to a render job. The block parameter determines if the program waits for the job ID from DaVinci Resolve. ### Parameters - **block** (bool) - Optional - Whether to block until a job ID is returned. Defaults to True. ### Returns - **str** - The render job ID. ``` -------------------------------- ### ProjectManager.create_project Source: https://pedrolabonia.github.io/pydavinci/projectmanager Creates a new project with the specified name. ```APIDOC ## ProjectManager.create_project(project_name: str) -> Project ### Description Creates a project with the provided project name. ### Parameters - **project_name** (str) - Required - project name ### Returns - **Project** (Project) - The created project object ``` -------------------------------- ### MediaPool.import_timeline_fromfile Source: https://pedrolabonia.github.io/pydavinci/mediapool Imports a timeline from a file path with optional configuration. ```APIDOC ## MediaPool.import_timeline_fromfile(path: str, options: Optional[Dict[Any, Any]] = None) -> 'Timeline' ### Description Imports a timeline from `path` with `options`. ### Parameters - **path** (str) - Required - timeline file path - **options** (dict) - Optional - Dict with import options. Defaults to `None`. ### Returns - **Timeline** - created timeline ``` -------------------------------- ### Organize clips by resolution Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Iterate through grouped clips to create subfolders and move clips into them based on their resolution. ```python def generate_premiere_proxies(input_dir, output_dir, proxyfactor): ... render_ids = [] for key in clips_res.keys(): res_x, res_y = key.split("x") # (1) res_folder = media_pool.add_subfolder(key, ocf_folder) clips = clips_res[key] # (2) media_pool.move_clips(clips, res_folder) ``` -------------------------------- ### ProjectManager.import_project Source: https://pedrolabonia.github.io/pydavinci/projectmanager Imports a project file. ```APIDOC ## ProjectManager.import_project(path: str) -> bool ### Description Imports a .drp project located at the specified path. ### Parameters - **path** (str) - Required - path to .drp project ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### ProjectManager.open_folder Source: https://pedrolabonia.github.io/pydavinci/projectmanager Opens a specific folder. ```APIDOC ## ProjectManager.open_folder(folder_name: str) -> bool ### Description Opens the folder named folder_name. ### Parameters - **folder_name** (str) - Required - folder name ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### Project.set_preset Source: https://pedrolabonia.github.io/pydavinci/project Activates a specified render preset by name. ```APIDOC ## Project.set_preset(preset_name: str) -> bool ### Description Activates the render preset with the given name. ### Parameters - **preset_name** (str) - Required - The name of the preset to activate. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Project.set_render_settings Source: https://pedrolabonia.github.io/pydavinci/project Sets the render configuration for the project. ```APIDOC ## Project.set_render_settings(render_settings: Dict[Any, Any]) -> bool ### Description Configures the render settings for the project using a dictionary of parameters. ### Parameters - **render_settings** (dict) - Required - Dictionary containing render configuration keys such as SelectAllFrames, MarkIn, MarkOut, TargetDir, etc. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### MediaStorage.add_timelilne_mattes Source: https://pedrolabonia.github.io/pydavinci/mediastorage Adds timeline mattes into the media pool. ```APIDOC ## MediaStorage.add_timelilne_mattes(paths: List[str]) ### Description Adds timeline mattes into the media pool from the provided paths. ### Parameters - **paths** (Union[List[str], str]) - Required - A list of path strings or a single path string to a timeline matte. ### Returns - **List['MediaPoolItem']** - A list of added timeline matte MediaPoolItems. ``` -------------------------------- ### Project.save Source: https://pedrolabonia.github.io/pydavinci/project Saves the current project. ```APIDOC ## Project.save() -> bool ### Description Persists the current project state. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Project.available_resolutions Source: https://pedrolabonia.github.io/pydavinci/project Retrieves a list of resolutions supported by the current format and codec. ```APIDOC ## Project.available_resolutions(format: Optional[str] = None, codec: Optional[str] = None) -> List[Dict[Any, Any]] ### Description Returns a list of resolutions applicable for the given render format and codec. If no arguments are provided, returns all available resolutions. ### Parameters - **format** (str) - Optional - The render format. - **codec** (str) - Optional - The render codec. ### Returns - **list** - A list of dictionaries containing 'Width' and 'Height' keys. ``` -------------------------------- ### Define Render Settings Dictionary Source: https://pedrolabonia.github.io/pydavinci/project Structure for the dictionary required by Project.set_render_settings to configure export parameters. ```python render_settings = { "SelectAllFrames": bool, # (when set True, the settings MarkIn and MarkOut are ignored) "MarkIn": int, "MarkOut": int, "TargetDir": str, "CustomName": str, "UniqueFilenameStyle": int, # 0 - Prefix, 1 - Suffix. "ExportVideo": bool, "ExportAudio": bool, "FormatWidth": int, "FormatHeight": int, "FrameRate": float, # (examples: 23.976, 24) "PixelAspectRatio": str, # (for SD resolution: "16_9" or "4_3") (other resolutions: "square" or "cinemascope") "VideoQuality": Union[int, str], # possible values for current codec (if applicable): # 0 (int) - will set quality to automatic # [1 -> MAX] (int) - will set input bit rate # ["Least", "Low", "Medium", "High", "Best"] (String) - will set input quality level "AudioCodec": str, # (example: "aac") "AudioBitDepth": int, "AudioSampleRate": int, "ColorSpaceTag" : str, # (example: "Same as Project", "AstroDesign") "GammaTag" : str, # (example: "Same as Project", "ACEScct") "ExportAlpha": bool, "EncodingProfile": str, # (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. ``` -------------------------------- ### Resolve.import_layout Source: https://pedrolabonia.github.io/pydavinci/resolve Imports a layout file from a specified path. ```APIDOC ## Resolve.import_layout(path: str, layout_name: str) -> bool ### Description Import `layout_name` from `path`. ### Parameters - **path** (str) - Required - path to layout file - **layout_name** (str) - Required - name to be imported as ### Returns - **bool** - True if successful, False otherwise ``` -------------------------------- ### MediaPool.create_empty_timeline Source: https://pedrolabonia.github.io/pydavinci/mediapool Creates an empty timeline in the current folder. ```APIDOC ## MediaPool.create_empty_timeline(timeline_name: str) -> 'Timeline' ### Description Creates empty timeline in current folder. ### Parameters - **timeline_name** (str) - Required - timeline name ### Returns - **Timeline** - created timeline ``` -------------------------------- ### Timeline.activate Source: https://pedrolabonia.github.io/pydavinci/timeline Makes this timeline active. ```APIDOC ## Timeline.activate() -> bool ### Description Makes this timeline active. ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### TimelineItem.load_color_version Source: https://pedrolabonia.github.io/pydavinci/timelineitem Loads a color version. ```APIDOC ## TimelineItem.load_color_version(name: str, type: Literal['local', 'remote']) -> bool ### Description Loads a color version from the TimelineItem named 'name'. ### Parameters - **name** (str) - Required - Version name - **type** (Literal['local', 'remote']) - Required - Whether to load a local or remote color version ### Returns - **bool** - True if successful, False otherwise ``` -------------------------------- ### MediaPool.import_media Source: https://pedrolabonia.github.io/pydavinci/mediapool Imports media files from the provided paths into the MediaPool. ```APIDOC ## MediaPool.import_media(paths: List[str]) -> List['MediaPoolItem'] ### Description Import media from the provided list of paths. ### Parameters - **paths** (List[str]) - Required - List of paths containing the media ### Returns - **List[MediaPoolItem]** (List[MediaPoolItem]) - List of imported MediaPoolItems ``` -------------------------------- ### Project.open_timeline Source: https://pedrolabonia.github.io/pydavinci/project Opens a specific timeline. ```APIDOC ## Project.open_timeline(name: str) -> bool ### Description Opens a timeline by its name. ### Parameters - **name** (str) - Required - The name of the timeline to open. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Project.set_setting Source: https://pedrolabonia.github.io/pydavinci/project Updates a specific project setting. ```APIDOC ## Project.set_setting(setting: str, value: Any) -> bool ### Description Updates a specific project setting with a provided value. ### Parameters - **setting** (str) - Required - The name of the setting. - **value** (Any) - Required - The value to assign to the setting. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Resolve.load_layout Source: https://pedrolabonia.github.io/pydavinci/resolve Loads a saved UI layout by its name. ```APIDOC ## Resolve.load_layout(layout_name: str) -> bool ### Description Loads a saved layout named `layout_name`. ### Parameters - **layout_name** (str) - Required - layout name ### Returns - **bool** - True if successful, False otherwise ``` -------------------------------- ### Timeline.get_setting Source: https://pedrolabonia.github.io/pydavinci/timeline Retrieves a specific timeline setting or all settings if no name is provided. ```APIDOC ## Timeline.get_setting(settingname: Optional[str] = None) -> Union[str, int, float, Dict[Any, Any]] ### Description Get timeline setting. If no setting provided, returns a dict with all settings. This function is a fallback if using Timeline.settings doesn't work. ### Parameters - **settingname** (str) - Optional - The name of the setting to retrieve. ### Returns - **Union[str, int, float, Dict[Any, Any]]** - The requested setting value or a dictionary of all settings. ``` -------------------------------- ### Add render jobs to queue Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Add the configured timeline to the render queue and collect the job IDs. ```python def generate_premiere_proxies(input_dir, output_dir, proxyfactor): ... render_ids = [] for key in clips_res.keys(): ... render_id = project.add_renderjob() render_ids.append(render_id) return render_ids ``` -------------------------------- ### MediaPool.move_folders Source: https://pedrolabonia.github.io/pydavinci/mediapool Moves a list of folders to a target folder. ```APIDOC ## MediaPool.move_folders(folders: List['Folder'], target_folder: 'Folder') -> bool ### Description Move the provided list of folders to the specified target folder. ### Parameters - **folders** (List[Folder]) - Required - List of folders to be moved - **target_folder** (Folder) - Required - Target Folder ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### ProjectManager.create_folder Source: https://pedrolabonia.github.io/pydavinci/projectmanager Creates a new folder within the project manager. ```APIDOC ## ProjectManager.create_folder(folder_name: str) -> bool ### Description Creates a project manager folder with the specified name. ### Parameters - **folder_name** (str) - Required - folder name ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### ProjectManager.restore_project Source: https://pedrolabonia.github.io/pydavinci/projectmanager Restores a project from a file path. ```APIDOC ## ProjectManager.restore_project(path: str) -> bool ### Description Restores a project from the provided path. ### Parameters - **path** (str) - Required - project path ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### Resolve.save_layout Source: https://pedrolabonia.github.io/pydavinci/resolve Saves the current UI layout under a specified name. ```APIDOC ## Resolve.save_layout(layout_name: str) -> bool ### Description Saves current layout as `layout_name`. ### Parameters - **layout_name** (str) - Required - layout name ### Returns - **bool** - True if successful, False otherwise ``` -------------------------------- ### Execute render jobs Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Trigger the rendering process for the collected job IDs. ```python job_ids = generate_premiere_proxies( "Path/To/Folder/With/Clips", "Path/To/Output/Folder, proxyfactor=2, ) project.render(job_ids) ``` -------------------------------- ### markers.fetch Source: https://pedrolabonia.github.io/pydavinci/markercollection Updates the internal cache from DaVinci Resolve. ```APIDOC ## markers.fetch ### Description Fetches all markers from DaVinci Resolve and updates the internal cache. ``` -------------------------------- ### MediaStorage.reveal_in_storage Source: https://pedrolabonia.github.io/pydavinci/mediastorage Opens a specific path in the media storage interface. ```APIDOC ## MediaStorage.reveal_in_storage(path: str) ### Description Opens the specified path in the media storage view. ### Parameters - **path** (str) - Required - The path to reveal. ### Returns - **bool** - Returns True if successful. ``` -------------------------------- ### Defining the proxy generation function Source: https://pedrolabonia.github.io/pydavinci/examples/premiereproxies Defines the signature for the proxy generation function accepting input, output, and scaling factors. ```python def generate_premiere_proxies(input_dir, proxyfactor, output_dir): ``` -------------------------------- ### Timeline.settings Source: https://pedrolabonia.github.io/pydavinci/timeline Returns the TimelineSettings interface. Note that Timeline.custom_settings(True) must be called first. ```APIDOC ## Timeline.settings ### Description Returns the `TimelineSettings` interface. `Timeline.custom_settings(True)` must be called first. ``` -------------------------------- ### TimelineItem.take_info Source: https://pedrolabonia.github.io/pydavinci/timelineitem Retrieves information about a specific take. ```APIDOC ## TimelineItem.take_info(takeindex: int = 0) -> Dict[Any, Any] ### Description Gets take info. If no `takeindex` provided, uses current selected take. ### Parameters - **takeindex** (int) - Optional - take index to get info from. Defaults to current take. ### Returns - **Dict[Any, Any]** - Dictionary containing take information. ``` -------------------------------- ### MediaPool.create_timeline_from_clips Source: https://pedrolabonia.github.io/pydavinci/mediapool Creates a new timeline from a list of clips. ```APIDOC ## MediaPool.create_timeline_from_clips(name: str, clips: List['MediaPoolItem']) -> 'Timeline' ### Description Creates timeline `name` from `clips`. ### Parameters - **name** (str) - Required - new timeline name - **clips** (List[MediaPoolItem]) - Required - list of `MediaPoolItem`s to use for creating the timeline ### Returns - **Timeline** - created timeline ``` -------------------------------- ### Timeline.custom_settings Source: https://pedrolabonia.github.io/pydavinci/timeline Allows this timeline to have settings independent from the project settings. ```APIDOC ## Timeline.custom_settings(use: bool) -> bool ### Description Allows this timeline to have settings independent from the project settings. ### Parameters - **use** (bool) - Required - True to use independent settings, False to follow project settings. ``` -------------------------------- ### ProjectManager Attributes Source: https://pedrolabonia.github.io/pydavinci/projectmanager Methods and properties for interacting with the ProjectManager instance. ```APIDOC ## ProjectManager.projects ### Description Returns a list of project names in the current project manager folder. ### Returns - **List[str]** - List of project names. ## ProjectManager.folders ### Description Returns a list of project manager folder names. ### Returns - **List[str]** - List of folder names. ## ProjectManager.folder ### Description Returns the current folder name. ### Returns - **str** - The current folder name. ## ProjectManager.db ### Description Gets or sets the current database configuration. Supports 'Disk' and 'PostgreSQL' types. ### Parameters - **db_info** (dict) - Required - A dictionary containing database connection details. ### Returns - **bool** - True if successful, False otherwise. ## ProjectManager.db_list ### Description Returns a list of all available databases. ### Returns - **List[Dict[str, str]]** - List of database configurations. ``` -------------------------------- ### markers.add Source: https://pedrolabonia.github.io/pydavinci/markercollection Adds a new marker to the collection. ```APIDOC ## markers.add ### Description Adds a marker to the collection at a specific frame. ### Parameters - **frameid** (int) - Required - Frame for marker to be inserted at. - **color** (COLORS) - Required - Marker color. - **name** (str) - Required - Marker name. - **note** (str) - Optional - Marker note. Defaults to ''. - **duration** (int) - Optional - Marker duration. Defaults to 1. - **customdata** (str) - Optional - Custom user data. Defaults to ''. - **overwrite** (bool) - Optional - Set to True to overwrite existing marker at frameid. Defaults to False. ### Returns - **Marker** - The created Marker object if successful. ``` -------------------------------- ### MediaPool.timeline_mattes Source: https://pedrolabonia.github.io/pydavinci/mediapool Retrieves timeline mattes located within a specific folder. ```APIDOC ## MediaPool.timeline_mattes(folder: 'Folder') -> List['MediaPoolItem'] ### Description Gets timeline mattes inside the specified folder. ### Parameters - **folder** (Folder) - Required - Folder to get timeline mattes from ### Returns - **List[MediaPoolItem]** (List[MediaPoolItem]) - List of timeline mattes ``` -------------------------------- ### MediaStorage.addclips_to_mediapool Source: https://pedrolabonia.github.io/pydavinci/mediastorage Adds media clips or folders to the media pool. ```APIDOC ## MediaStorage.addclips_to_mediapool(item: List[str]) ### Description Adds a list of media paths or folders to the media pool. ### Parameters - **item** (List[str]) - Required - A list of media paths or folders to add. ### Returns - **List['MediaPoolItem']** - A list of added MediaPoolItems. ``` -------------------------------- ### Project.close Source: https://pedrolabonia.github.io/pydavinci/project Closes the current project. ```APIDOC ## Project.close() -> bool ### Description Closes the currently active project. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Timeline.create_fusion_clip Source: https://pedrolabonia.github.io/pydavinci/timeline Creates a Fusion clip from a list of timeline items. ```APIDOC ## Timeline.create_fusion_clip(timeline_items) ### Description Creates a Fusion clip using the specified timeline items as input. ### Parameters - **timeline_items** (List['TimelineItem']) - Required - Timeline items to be used as input in the Fusion clip. ### Returns - **TimelineItem** - The resulting fusion clip. ``` -------------------------------- ### Project.refresh_luts Source: https://pedrolabonia.github.io/pydavinci/project Refreshes LUTs. ```APIDOC ## Project.refresh_luts() -> bool ### Description Refreshes the available LUTs in the project. ### Returns - **bool** - Returns True if successful. ``` -------------------------------- ### MediaStorage.add_clip_mattes Source: https://pedrolabonia.github.io/pydavinci/mediastorage Adds clip mattes to a specific MediaPoolItem. ```APIDOC ## MediaStorage.add_clip_mattes(mediapool_item: 'MediaPoolItem', paths: List[str], stereo_eye: str) ### Description Adds clip mattes from the specified paths to a MediaPoolItem. ### Parameters - **mediapool_item** (MediaPoolItem) - Required - The target MediaPoolItem object. - **paths** (Union[List[str], str]) - Required - A list of path strings or a single path string. - **stereo_eye** (str) - Required - The stereo eye configuration. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### TimelineItem.add_take Source: https://pedrolabonia.github.io/pydavinci/timelineitem Adds a MediaPoolItem as a new take to the timeline item. ```APIDOC ## TimelineItem.add_take(mediapool_item: 'MediaPoolItem', startframe: int = 0, endframe: int = 0) -> bool ### Description Adds `mediapool_item` as a new take. Initializes a take selector for the timeline item if needed. By default, the full clip extents is added. ### Parameters - **mediapool_item** (MediaPoolItem) - Required - media pool item to add as take - **startframe** (int) - Optional - start frame for new take. Defaults to 0. - **endframe** (int) - Optional - end frame for new take. Defaults to 0. ### Returns - **bool** - Returns True if successful. ``` -------------------------------- ### Folder.clips Source: https://pedrolabonia.github.io/pydavinci/folder Retrieves a list of all media pool items contained within the folder. ```APIDOC ## Property: Folder.clips ### Description Gets all clips associated with the folder. ### Returns - **List[MediaPoolItem]** - A list of clips contained in the folder. ``` -------------------------------- ### ProjectManager.export_project Source: https://pedrolabonia.github.io/pydavinci/projectmanager Exports a project to a specified path. ```APIDOC ## ProjectManager.export_project(project_name: str, path: str, stills_and_luts: bool = False) -> bool ### Description Exports the specified project to the given path. ### Parameters - **project_name** (str) - Required - project to be exported - **path** (str) - Required - path to export to - **stills_and_luts** (bool) - Optional - whether to export with Stills and LUTs. Defaults to False. ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### Export supported types Source: https://pedrolabonia.github.io/pydavinci/timeline List of supported export types for the Timeline.export method. ```text "AAF" "DRT" "EDL" "FCP_7_XML" "FCPXML_1_3" "FCPXML_1_4" "FCPXML_1_5" "FCPXML_1_6" "FCPXML_1_7" "FCPXML_1_8" "HDR_10_PROFILE_A" "HDR_10_PROFILE_B" "TEXT_CSV" "TEXT_TAB" "DOLBY_VISION_VER_2_9" "DOLBY_VISION_VER_4_0" ``` -------------------------------- ### Resolve.update_layout Source: https://pedrolabonia.github.io/pydavinci/resolve Updates an existing layout with the current configuration. ```APIDOC ## Resolve.update_layout(layout_name: str) -> bool ### Description Updates current layout to `layout_name`. ### Parameters - **layout_name** (str) - Required - layout to be updated ### Returns - **bool** - True if successful, False otherwise ``` -------------------------------- ### markers.all Source: https://pedrolabonia.github.io/pydavinci/markercollection Retrieves a list of all markers currently in the collection. ```APIDOC ## markers.all ### Description Returns a list containing all Marker objects. ### Returns - **List['Marker']** - A list of all markers. ``` -------------------------------- ### Timeline.export Source: https://pedrolabonia.github.io/pydavinci/timeline Exports the timeline to a specified file format. ```APIDOC ## Timeline.export(file_name, export_type, export_subtype=None) ### Description Exports the timeline to a file. Supported types include AAF, DRT, EDL, various FCPXML versions, and text formats. ### Parameters - **file_name** (str) - Required - The destination file path. - **export_type** (str) - Required - The format to export (e.g., "AAF", "EDL", "FCPXML_1_8"). - **export_subtype** (str) - Optional - Specific subtype for the export (e.g., "NONE", "CDL"). ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Folder.name Source: https://pedrolabonia.github.io/pydavinci/folder Retrieves the name of the folder. ```APIDOC ## Property: Folder.name ### Description Gets the name of the folder. ### Returns - **str** - The name of the folder. ``` -------------------------------- ### Timeline.create_compound_clip Source: https://pedrolabonia.github.io/pydavinci/timeline Creates a compound clip using timeline_items. ```APIDOC ## Timeline.create_compound_clip(timeline_items: List['TimelineItem'], clip_info: Optional[Dict[Any, Any]] = None) -> 'TimelineItem' ### Description Creates a compound clip using timeline_items. ### Parameters - **timeline_items** (List) - Required - list of TimelineItems to use - **clip_info** (dict) - Optional - optional compound clip settings. ``` -------------------------------- ### Timeline.insert_fusion_generator Source: https://pedrolabonia.github.io/pydavinci/timeline Inserts a fusion generator into the timeline. ```APIDOC ## Timeline.insert_fusion_generator(generator_name: str) -> 'TimelineItem' ### Description Inserts a fusion generator in the timeline. ### Parameters - **generator_name** (str) - Required - The name of the fusion generator. ### Returns - **TimelineItem** - The inserted fusion generator. ``` -------------------------------- ### MediaPool.add_subfolder Source: https://pedrolabonia.github.io/pydavinci/mediapool Adds a new subfolder into a specified parent folder. ```APIDOC ## MediaPool.add_subfolder(folder_name: str, parent_folder: 'Folder') -> 'Folder' ### Description Adds subfolder `folder_name` into `parent_folder`. ### Parameters - **folder_name** (str) - Required - subfolder name - **parent_folder** (Folder) - Required - parent folder object ### Returns - **Folder** - created subfolder ``` -------------------------------- ### MediaPool.clip_mattes Source: https://pedrolabonia.github.io/pydavinci/mediapool Retrieves the file paths of mattes associated with a specific clip. ```APIDOC ## MediaPool.clip_mattes(clip: 'MediaPoolItem') -> List[str] ### Description Gets paths of clip mattes from the provided clip. ### Parameters - **clip** (MediaPoolItem) - Required - Clip to get mattes from ### Returns - **List[str]** (List[str]) - List of file paths associated with clip's mattes ``` -------------------------------- ### MediaPool.delete_mattes_by_path Source: https://pedrolabonia.github.io/pydavinci/mediapool Deletes specific mattes from a clip based on their file paths. ```APIDOC ## MediaPool.delete_mattes_by_path(clip: 'MediaPoolItem', path: List[str]) -> bool ### Description Delete mattes based on their file paths. ### Parameters - **clip** (MediaPoolItem) - Required - Clip to have mattes deleted - **path** (List[str]) - Required - List of matte paths ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### Timeline.import_aaf_into_timeline Source: https://pedrolabonia.github.io/pydavinci/timeline Imports an AAF file into the current timeline with optional configuration settings. ```APIDOC ## Timeline.import_aaf_into_timeline(file_path, import_options=None) ### Description Imports timeline items from an AAF file into the timeline. Supports various import options such as matching behavior, sizing info, and track insertion settings. ### Parameters - **file_path** (str) - Required - Path to the .aaf file. - **import_options** (dict) - Optional - Configuration dictionary for the import process. ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### MediaStorage.get_subfolders Source: https://pedrolabonia.github.io/pydavinci/mediastorage Retrieves a list of subfolders within a specified path. ```APIDOC ## MediaStorage.get_subfolders(folder_path: str) ### Description Gets a list of subfolders located within the provided folder path. ### Parameters - **folder_path** (str) - Required - The parent folder path to search. ### Returns - **List[str]** - A list of subfolder names. ``` -------------------------------- ### markers.find Source: https://pedrolabonia.github.io/pydavinci/markercollection Finds the first marker matching the provided search string. ```APIDOC ## markers.find ### Description Finds the first marker that matches the needle string in the marker's note, name, or customdata. ### Parameters - **needle** (str) - Required - The search string. ### Returns - **Marker** - The first marker found matching the query. ``` -------------------------------- ### MediaPool.move_clips Source: https://pedrolabonia.github.io/pydavinci/mediapool Moves a list of MediaPoolItem objects to a specified destination folder. ```APIDOC ## MediaPool.move_clips(clips: List['MediaPoolItem'], folder: 'Folder') -> bool ### Description Moves the specified list of clips from the current active folder to the target folder. ### Parameters - **clips** (List[MediaPoolItem]) - Required - List of MediaPoolItems on current folder - **folder** (Folder) - Required - Destination folder ### Returns - **bool** (bool) - True if successful, False otherwise ``` -------------------------------- ### Project.is_rendering Source: https://pedrolabonia.github.io/pydavinci/project Checks if DaVinci Resolve is currently rendering. ```APIDOC ## Project.is_rendering() -> bool ### Description Checks if the application is currently in a rendering state. ### Returns - **bool** - True if rendering, False otherwise. ``` -------------------------------- ### Export supported subtypes Source: https://pedrolabonia.github.io/pydavinci/timeline List of supported export subtypes for the Timeline.export method. ```text "NONE" "AAF_NEW" "AAF_EXISTING" "CDL" "SDL" "MISSING_CLIPS" ``` -------------------------------- ### Timeline.create_compound_clip Source: https://pedrolabonia.github.io/pydavinci/timeline Creates a compound clip from a list of timeline items. ```APIDOC ## Timeline.create_compound_clip(timeline_items, clip_info=None) ### Description Creates a compound clip from the provided list of timeline items. ### Parameters - **timeline_items** (List['TimelineItem']) - Required - List of timeline items to include in the compound clip. - **clip_info** (Dict[Any, Any]) - Optional - Additional clip information. ### Returns - **TimelineItem** - The resulting compound clip. ``` -------------------------------- ### Timeline.create_compound_clip Source: https://pedrolabonia.github.io/pydavinci/timeline Creates a compound clip from a list of timeline items. ```APIDOC ## Timeline.create_compound_clip(timeline_items: List['TimelineItem'], clip_info: Optional[Dict[Any, Any]] = None) -> 'TimelineItem' ### Description Creates a compound clip from the provided list of timeline items with optional clip information. ### Parameters - **timeline_items** (List['TimelineItem']) - Required - List of items to include in the compound clip. - **clip_info** (Dict[Any, Any]) - Optional - Additional information for the clip. ### Returns - **TimelineItem** - The created compound clip. ``` -------------------------------- ### markers.find_all Source: https://pedrolabonia.github.io/pydavinci/markercollection Finds all markers matching the provided search string. ```APIDOC ## markers.find_all ### Description Finds all markers that match the needle string in the marker's note, name, or customdata. ### Parameters - **needle** (str) - Required - The search string. ### Returns - **Optional[List['Marker']]** - A list of matching markers or None if none found. ``` -------------------------------- ### MediaStorage.get_file_list Source: https://pedrolabonia.github.io/pydavinci/mediastorage Retrieves a list of files within a specified path. ```APIDOC ## MediaStorage.get_file_list(folder_path: str) ### Description Gets a list of files located within the provided folder path. ### Parameters - **folder_path** (str) - Required - The parent folder path to search. ### Returns - **List[str]** - A list of files in the parent folder. ``` -------------------------------- ### Project.stop_render Source: https://pedrolabonia.github.io/pydavinci/project Stops all active rendering processes. ```APIDOC ## Project.stop_render() -> None ### Description Immediately stops all rendering operations. ``` -------------------------------- ### markers.get_custom Source: https://pedrolabonia.github.io/pydavinci/markercollection Retrieves custom marker data by the customdata string. ```APIDOC ## markers.get_custom ### Description Gets custom marker data by the customdata identifier. ### Parameters - **customdata** (str) - Required - The custom data string. ### Returns - **Dict[Any, Any]** - A dictionary containing the marker data. ``` -------------------------------- ### Timeline.current_clip_thumbnail Source: https://pedrolabonia.github.io/pydavinci/timeline Returns metadata and raw thumbnail image data for the current media in the Color Page. ```APIDOC ## Timeline.current_clip_thumbnail ### Description Returns a dict with data containing metadata and raw thumbnail image data (RGB 8-bit image data encoded in base64 format) for the current media in the Color Page. ### Returns - **dict** (Dict[Any, Any]) - Dictionary containing keys "width", "height", "format", and "data" ``` -------------------------------- ### MediaPool.set_current_folder Source: https://pedrolabonia.github.io/pydavinci/mediapool Sets the current active folder in the media pool. ```APIDOC ## MediaPool.set_current_folder(folder: 'Folder') -> bool ### Description Sets current mediapool folder. ### Parameters - **folder** (Folder) - Required - desired `Folder` ### Returns - **bool** - `True` if successful, `False` otherwise ``` -------------------------------- ### MediaPool.delete_folders Source: https://pedrolabonia.github.io/pydavinci/mediapool Deletes a list of folders from the media pool. ```APIDOC ## MediaPool.delete_folders(folders: List['Folder']) -> bool ### Description Delete `folders`. ### Parameters - **folders** (List[Folder]) - Required - list of `Folder`s to be deleted ### Returns - **bool** - `True` if successful, `False` otherwise ``` -------------------------------- ### TimelineItem.copy_grade_to Source: https://pedrolabonia.github.io/pydavinci/timelineitem Copies the current grade to a list of timeline items. ```APIDOC ## TimelineItem.copy_grade_to(timeline_items: List['TimelineItem']) -> bool ### Description Copies the current grade to all the items in `timeline_items` list. ### Parameters - **timeline_items** (list) - Required - list with clips for the grade to be applied ### Returns - **bool** - True if successful, False otherwise. ``` -------------------------------- ### Timeline.insert_ofx_generator Source: https://pedrolabonia.github.io/pydavinci/timeline Inserts an OFX generator into the timeline. ```APIDOC ## Timeline.insert_ofx_generator(generator_name: str) -> 'TimelineItem' ### Description Inserts an OFX generator in the timeline. ### Parameters - **generator_name** (str) - Required - The name of the OFX generator. ### Returns - **TimelineItem** - The inserted OFX generator. ```