Resolve#

class pybmd.resolve.Resolve(resolve_ip: str = '127.0.0.1', auto_start: bool = False)[source]

Bases: object

Resolve class. Init Davinci Resolve Object Base for everything

Init Davinci Resolve Object

Parameters:
  • resolve_ip (str, optional) – davinci resolve ip. Defaults to 127.0.0.1.

  • auto_start (bool, optional) – open davinci automatically if it’s not running, if you want to open davinci manually, change arg to false. Defaults to False.

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.

disable_background_tasks_for_current_resolve_session()

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.

get_burn_in_preset_list()

Returns a list of available data burn in preset names.

get_current_keyboard_preset()

Returns the name of the currently active keyboard preset.

get_current_page()

Returns the page currently displayed in the main window

get_current_project()

Returns the currently loaded Project.

get_current_timeline()

Returns the currently loaded Timeline.

get_effects_list([media_type])

Returns the effects that can be applied to a timeline item or photo.

get_extras_packages()

Returns the Extras Download Manager packages available for this system.

get_fairlight_presets()

Returns a list of Fairlight preset names.

get_gallery()

Returns the Gallery object for the current project.

get_keyboard_preset_list()

Returns a list of available keyboard preset names.

get_keyframe_mode()

Refer to section 'Keyframe Mode information' for details.

get_layout_preset_list()

Returns a list of available UI layout preset names.

get_media_pool()

Returns the MediaPool object for the current project.

get_media_storage()

Returns the MediaStorage object to query and act on media locations.

get_product_name()

Returns product name.

get_project_manager()

Returns the ProjectManager object for currently open database.

get_user_preferences_preset_list()

Returns a list of available user preferences preset names.

get_version()

Returns list of product version fields in [major, minor, patch, build, suffix] format.

get_version_info()

Returns structured version information.

get_version_string()

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.

install_extras_package(name)

Queues installation of the named Extras Package.

is_studio()

Returns whether this is DaVinci Resolve Studio rather than the free version.

is_version_at_least(version_str)

Check if current Resolve version is at least the specified version.

list_incompatible_apis()

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_high_priority(high_priority)

Sets the script execution priority to high or normal.

set_keyframe_mode(key_frame_mode)

Refer to section 'Keyframe Mode information' below for details.

uninstall_extras_package(name)

Queues removal of the named Extras Package.

update_layout_preset(preset_name)

Overwrites preset named 'preset_name' with current UI layout.

validate_dctl(dctl_source)

Validates DCTL source code.

Attributes

fusion

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:

bool

export_layout_preset(preset_name: str, preset_file_path: str) → bool[source]

Exports preset named preset_name to path preset_file_path.

Parameters:
  • preset_name (str)

  • preset_file_path (str)

Returns:

result

Return type:

bool

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:

str

get_media_storage() → MediaStorage[source]

Returns the MediaStorage object to query and act on media locations.

Return type:

MediaStorage

get_product_name() → str[source]

Returns product name.

Returns:

product name

Return type:

str

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:

list

get_version_string() → str[source]

Returns product version in “major.minor.patch[suffix].build” format.

Returns:

product version string

Return type:

str

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:

bool

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:

Tuple[bool, str]

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.

Returns:

List of (api_name, reason) tuples

Return type:

List[Tuple[str, str]]

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.

Parameters:
  • preset_file_path (str)

  • preset_name (str)

Return type:

bool

load_layout_preset(preset_name: str) → bool[source]

Loads UI layout from saved preset named preset_name.

Parameters:

preset_name (str)

Returns:

bool

Return type:

bool

open_page(page_name: str) → bool[source]

Switches to indicated page in DaVinci Resolve.

Parameters:

page_name (str) – Input can be one of (“media”, “cut”, “edit”, “fusion”, “color”, “fairlight”, “deliver”, “photo”). The “photo” page exists since DaVinci Resolve 21.

Returns:

bool

Return type:

bool

quit()[source]

Quits the Resolve App.

save_layout_preset(preset_name: str) → bool[source]

Saves current UI layout as a preset named preset_name.

Parameters:

preset_name (str)

Returns:

bool

Return type:

bool

update_layout_preset(preset_name: str) → bool[source]

Overwrites preset named ‘preset_name’ with current UI layout.

Parameters:

preset_name (str)

Returns:

bool

Return type:

bool

import_render_preset(preset_path: str) → bool[source]

Import a preset from presetPath (string) and set it as current preset for rendering.

Parameters:

preset_path (str) – path of preset file

Returns:

Returns True if successful, False otherwise.

Return type:

bool

export_render_preset(preset_name: str, export_path: str) → bool[source]

Export a preset to a given path (string) if presetName(string) exists.

Parameters:
  • preset_name (str) – export preset name

  • export_path (str) – export path

Returns:

Returns True if successful, False otherwise.

Return type:

bool

import_burn_in_preset(preset_path: str) → bool[source]

Import a data burn in preset from a given presetPath (string)

Parameters:

preset_path (str) – path of preset

Returns:

Returns True if successful, False otherwise.

Return type:

bool

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.

Parameters:
  • preset_name (str) – name of export preset

  • export_path (str) – path to export

Returns:

Returns True if successful, False otherwise.

Return type:

bool

get_keyframe_mode() → int[source]

Refer to section ‘Keyframe Mode information’ for details.

Returns:

currently set keyframe mode

Return type:

int

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:

bool

get_fairlight_presets() → list[source]

Returns a list of Fairlight preset names.

Returns:

List of Fairlight preset names available in the system.

Return type:

list

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:

bool

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:

bool

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:

bool

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:

bool

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:
  • preset_file_path (str) – path of the preset file

  • preset_name (str, optional) – how the preset shall be named. If not specified, the preset is named based on the file base name.

Returns:

Returns True if successful, False otherwise.

Return type:

bool

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:
  • preset_name (str) – name of the user preferences preset

  • export_path (str) – path to export to

Returns:

Returns True if successful, False otherwise.

Return type:

bool

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:

str

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:

bool

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:

bool

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:
  • preset_file_path (str) – path of the preset file

  • preset_name (str, optional) – how the preset shall be named. If not specified, the preset is named based on the file base name.

Returns:

Returns True if successful, False otherwise.

Return type:

bool

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:
  • preset_name (str) – name of the keyboard preset

  • export_path (str) – path to export to

Returns:

Returns True if successful, False otherwise.

Return type:

bool

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:
  • input_path (str) – path of the DCTL file to encrypt

  • options (EncryptDCTLOptions | dict, optional) – encryption options. Defaults to None, which uses the input filename, no expiry and the user’s home folder.

Returns:

Returns True if successful, False otherwise.

Return type:

bool

Raises:

APIVersionError – If Resolve version < 21.1.0

Version:

Added in DaVinci Resolve 21.1.0

get_effects_list(media_type: Literal['video', 'photo', 'audio'] | None = None) → List[EffectInfo][source]

Returns the effects that can be applied to a timeline item or photo.

Pass an entry’s category and id to TimelineItem.add_effect or PhotoAlbumItem.add_effect.

Parameters:

media_type (str, optional) – “video”, “photo” or “audio” restricts the list to effects for that media type. DaVinci Resolve defaults to “video”.

Returns:

the available effects

Return type:

List[EffectInfo]

Raises:

APIVersionError – If Resolve version < 21.1.2

Version:

Added in DaVinci Resolve 21.1.2

is_studio() → bool[source]

Returns whether this is DaVinci Resolve Studio rather than the free version.

Returns:

True for DaVinci Resolve Studio

Return type:

bool

set_high_priority(high_priority: bool) → bool[source]

Sets the script execution priority to high or normal.

Parameters:

high_priority (bool) – True for high priority, False for normal

Returns:

Returns True if successful, False otherwise.

Return type:

bool

get_extras_packages() → List[ExtrasPackageInfo][source]

Returns the Extras Download Manager packages available for this system.

These are optional packages (mostly AI models) required by Studio and AI scripting functions. Poll this method for status and progress after calling install_extras_package().

Returns:

the available packages and their install state

Return type:

List[ExtrasPackageInfo]

Raises:

APIVersionError – If Resolve version < 21.2

Version:

Added in DaVinci Resolve 21.2

install_extras_package(name: str) → bool[source]

Queues installation of the named Extras Package.

The name must match the name field of an ExtrasPackageInfo entry returned by get_extras_packages() (e.g. 'AI Slate ID'). Poll get_extras_packages() for status and progress.

Parameters:

name (str) – display name / identifier of the package to install

Returns:

True if the install was queued successfully

Return type:

bool

Raises:

APIVersionError – If Resolve version < 21.2

Version:

Added in DaVinci Resolve 21.2

uninstall_extras_package(name: str) → bool[source]

Queues removal of the named Extras Package. Cancels an in-progress download.

Parameters:

name (str) – display name / identifier of the package to remove

Returns:

True if the removal was queued successfully

Return type:

bool

Raises:

APIVersionError – If Resolve version < 21.2

Version:

Added in DaVinci Resolve 21.2