Resolve#
- class pybmd.resolve.Resolve(resolve_ip: str = '127.0.0.1', auto_start: bool = False)[source]
Bases:
objectResolve class. Init Davinci Resolve Object Base for everything
Init Davinci Resolve Object
- Parameters:
- Raises:
ResolveInitError – davinci resolve init failed.you need to check if davinci resolve is running.
Methods
__init__([resolve_ip, auto_start])Init Davinci Resolve Object
check_api_compatibility(api_name)Check if an API is compatible with current Resolve version.
delete_burn_in_preset(preset_name)Deletes the data burn in preset named preset_name.
delete_keyboard_preset(preset_name)Deletes the keyboard preset named preset_name.
delete_layout_preset(preset_name)Deletes preset named preset_name.
delete_user_preferences_preset(preset_name)Deletes the user preferences preset named preset_name.
Disables all background tasks for the current Resolve session.
encrypt_dctl(input_path[, options])Encrypts the DCTL at input_path and writes it to an output folder.
export_burn_in_preset(preset_name, export_path)Export a data burn in preset to a given path (string) if presetName (string) exists.
export_keyboard_preset(preset_name, export_path)Exports the keyboard preset named preset_name to export_path.
export_layout_preset(preset_name, ...)Exports preset named preset_name to path preset_file_path.
export_render_preset(preset_name, export_path)Export a preset to a given path (string) if presetName(string) exists.
export_user_preferences_preset(preset_name, ...)Exports the user preferences preset named preset_name to export_path.
Returns a list of available data burn in preset names.
Returns the name of the currently active keyboard preset.
Returns the page currently displayed in the main window
Returns the currently loaded Project.
Returns the currently loaded Timeline.
Returns a list of Fairlight preset names.
Returns the Gallery object for the current project.
Returns a list of available keyboard preset names.
Refer to section 'Keyframe Mode information' for details.
Returns a list of available UI layout preset names.
Returns the MediaPool object for the current project.
Returns the MediaStorage object to query and act on media locations.
Returns product name.
Returns the ProjectManager object for currently open database.
Returns a list of available user preferences preset names.
Returns list of product version fields in [major, minor, patch, build, suffix] format.
Returns structured version information.
Returns product version in "major.minor.patch[suffix].build" format.
import_burn_in_preset(preset_path)Import a data burn in preset from a given presetPath (string)
import_keyboard_preset(preset_file_path[, ...])Imports a keyboard preset from preset_file_path.
import_layout_preset(preset_file_path, ...)Imports preset from path 'preset_file_path'.
import_render_preset(preset_path)Import a preset from presetPath (string) and set it as current preset for rendering.
import_user_preferences_preset(preset_file_path)Imports a user preferences preset from preset_file_path.
is_version_at_least(version_str)Check if current Resolve version is at least the specified version.
List all APIs incompatible with current Resolve version.
load_keyboard_preset(preset_name)Loads the keyboard preset named preset_name.
load_layout_preset(preset_name)Loads UI layout from saved preset named preset_name.
load_user_preferences_preset(preset_name)Loads the user preferences preset named preset_name.
open_page(page_name)Switches to indicated page in DaVinci Resolve.
quit()Quits the Resolve App.
save_layout_preset(preset_name)Saves current UI layout as a preset named preset_name.
save_user_preferences_preset(preset_name)Saves the current user preferences as a preset named preset_name.
set_keyframe_mode(key_frame_mode)Refer to section 'Keyframe Mode information' below for details.
update_layout_preset(preset_name)Overwrites preset named 'preset_name' with current UI layout.
validate_dctl(dctl_source)Validates DCTL source code.
Attributes
Returns the Fusion object.
- delete_layout_preset(preset_name: str) bool[source]
Deletes preset named preset_name.
- Parameters:
preset_name (string)
- Returns:
result
- Return type:
- export_layout_preset(preset_name: str, preset_file_path: str) bool[source]
Exports preset named preset_name to path preset_file_path.
- property fusion: Fusion
Returns the Fusion object.
- get_current_page() str[source]
Returns the page currently displayed in the main window
- Returns:
Returned value can be one of (“media”, “cut”, “edit”, “fusion”, “color”, “fairlight”, “deliver”, None).
- Return type:
- get_media_storage() MediaStorage[source]
Returns the MediaStorage object to query and act on media locations.
- Return type:
MediaStorage
- get_project_manager() ProjectManager[source]
Returns the ProjectManager object for currently open database.
- Return type:
ProjectManager
- get_version() list[source]
Returns list of product version fields in [major, minor, patch, build, suffix] format.
- Returns:
list of product version fields
- Return type:
- get_version_string() str[source]
Returns product version in “major.minor.patch[suffix].build” format.
- Returns:
product version string
- Return type:
- get_version_info() Version[source]
Returns structured version information.
- Returns:
Version object with major, minor, patch components
- Return type:
Version
Example
>>> resolve = Resolve() >>> version = resolve.get_version_info() >>> print(f"Running Resolve {version}") Running Resolve 20.2.0 >>> version.major 20
- is_version_at_least(version_str: str) bool[source]
Check if current Resolve version is at least the specified version.
- Parameters:
version_str (str) – Version string like “20.0.0” or “19.1”
- Returns:
True if current version >= specified version
- Return type:
Example
>>> resolve = Resolve() >>> resolve.is_version_at_least("20.0.0") True >>> resolve.is_version_at_least("21.0.0") False
- check_api_compatibility(api_name: str) Tuple[bool, str][source]
Check if an API is compatible with current Resolve version.
- Parameters:
api_name (str) – Full API identifier (e.g., “TimelineItem.set_name”)
- Returns:
Tuple of (is_compatible, status_message)
- Return type:
Example
>>> resolve = Resolve() >>> is_ok, msg = resolve.check_api_compatibility("TimelineItem.set_name") >>> print(f"TimelineItem.set_name: {msg}") TimelineItem.set_name: API available
- list_incompatible_apis() List[Tuple[str, str]][source]
List all APIs incompatible with current Resolve version.
Example
>>> resolve = Resolve() >>> incompatible = resolve.list_incompatible_apis() >>> for api_name, reason in incompatible: ... print(f"❌ {api_name}: {reason}")
- import_layout_preset(preset_file_path: str, preset_name: str) bool[source]
Imports preset from path ‘preset_file_path’. The optional argument ‘preset_name’ specifies how the preset shall be named. If not specified, the preset is named based on the filename.
- load_layout_preset(preset_name: str) bool[source]
Loads UI layout from saved preset named preset_name.
- quit()[source]
Quits the Resolve App.
- save_layout_preset(preset_name: str) bool[source]
Saves current UI layout as a preset named preset_name.
- update_layout_preset(preset_name: str) bool[source]
Overwrites preset named ‘preset_name’ with current UI layout.
- import_render_preset(preset_path: str) bool[source]
Import a preset from presetPath (string) and set it as current preset for rendering.
- export_render_preset(preset_name: str, export_path: str) bool[source]
Export a preset to a given path (string) if presetName(string) exists.
- import_burn_in_preset(preset_path: str) bool[source]
Import a data burn in preset from a given presetPath (string)
- export_burn_in_preset(preset_name: str, export_path: str) bool[source]
Export a data burn in preset to a given path (string) if presetName (string) exists.
- get_keyframe_mode() int[source]
Refer to section ‘Keyframe Mode information’ for details.
- Returns:
currently set keyframe mode
- Return type:
- set_keyframe_mode(key_frame_mode: KeyframeMode) bool[source]
Refer to section ‘Keyframe Mode information’ below for details.
- Parameters:
key_frame_mode (KeyframeModeInformation) – key frame mode
- Returns:
Returns True when ‘keyframeMode’(enum) is successfully set.
- Return type:
- get_fairlight_presets() list[source]
Returns a list of Fairlight preset names.
- Returns:
List of Fairlight preset names available in the system.
- Return type:
- disable_background_tasks_for_current_resolve_session() None[source]
Disables all background tasks for the current Resolve session.
- Raises:
APIVersionError – If Resolve version < 21.0.2
- Return type:
None
- Version:
Added in DaVinci Resolve 21.0.2
- get_layout_preset_list() List[str][source]
Returns a list of available UI layout preset names.
- Returns:
available UI layout preset names
- Return type:
List[str]
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- get_burn_in_preset_list() List[str][source]
Returns a list of available data burn in preset names.
- Returns:
available data burn in preset names
- Return type:
List[str]
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- delete_burn_in_preset(preset_name: str) bool[source]
Deletes the data burn in preset named preset_name.
- Parameters:
preset_name (str) – name of the data burn in preset
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- get_user_preferences_preset_list() List[str][source]
Returns a list of available user preferences preset names.
- Returns:
available user preferences preset names
- Return type:
List[str]
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- load_user_preferences_preset(preset_name: str) bool[source]
Loads the user preferences preset named preset_name.
- Parameters:
preset_name (str) – name of the user preferences preset
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- save_user_preferences_preset(preset_name: str) bool[source]
Saves the current user preferences as a preset named preset_name.
- Parameters:
preset_name (str) – name of the new user preferences preset
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- delete_user_preferences_preset(preset_name: str) bool[source]
Deletes the user preferences preset named preset_name.
- Parameters:
preset_name (str) – name of the user preferences preset
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- import_user_preferences_preset(preset_file_path: str, preset_name: str = '') bool[source]
Imports a user preferences preset from preset_file_path.
- Parameters:
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- export_user_preferences_preset(preset_name: str, export_path: str) bool[source]
Exports the user preferences preset named preset_name to export_path.
- Parameters:
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.0.3
- Version:
Added in DaVinci Resolve 21.0.3
- get_current_project() Project[source]
Returns the currently loaded Project.
Shortcut for
get_project_manager().get_current_project().- Returns:
currently loaded project
- Return type:
Project
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- get_current_timeline() Timeline | None[source]
Returns the currently loaded Timeline.
- Returns:
currently loaded timeline, None if no timeline is open
- Return type:
Timeline | None
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- get_media_pool() MediaPool[source]
Returns the MediaPool object for the current project.
- Returns:
media pool of the current project
- Return type:
MediaPool
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- get_gallery() Gallery[source]
Returns the Gallery object for the current project.
- Returns:
gallery of the current project
- Return type:
Gallery
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- get_keyboard_preset_list() List[str][source]
Returns a list of available keyboard preset names.
- Returns:
available keyboard preset names
- Return type:
List[str]
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- get_current_keyboard_preset() str[source]
Returns the name of the currently active keyboard preset.
- Returns:
name of the active keyboard preset
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- load_keyboard_preset(preset_name: str) bool[source]
Loads the keyboard preset named preset_name.
- Parameters:
preset_name (str) – name of the keyboard preset
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- delete_keyboard_preset(preset_name: str) bool[source]
Deletes the keyboard preset named preset_name.
- Parameters:
preset_name (str) – name of the keyboard preset
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- import_keyboard_preset(preset_file_path: str, preset_name: str = '') bool[source]
Imports a keyboard preset from preset_file_path.
- Parameters:
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- export_keyboard_preset(preset_name: str, export_path: str) bool[source]
Exports the keyboard preset named preset_name to export_path.
- Parameters:
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- validate_dctl(dctl_source: str) str | None[source]
Validates DCTL source code.
Note the inverted return contract: a successful validation returns
None, a failed one returns the error message, e.g."DCTL Error: cannot find main DCTL function.\n".- Parameters:
dctl_source (str) – DCTL source code
- Returns:
None when the DCTL is valid, an error string otherwise
- Return type:
str | None
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0
- encrypt_dctl(input_path: str, options: EncryptDCTLOptions | dict | None = None) bool[source]
Encrypts the DCTL at input_path and writes it to an output folder.
- Parameters:
- Returns:
Returns True if successful, False otherwise.
- Return type:
- Raises:
APIVersionError – If Resolve version < 21.1.0
- Version:
Added in DaVinci Resolve 21.1.0