PhotoAlbumItem#

class pybmd.photo_album_item.PhotoAlbumItem(photo_album_item)[source]

Bases: WrapperBase

A photo in a photo album, with its color grades, flags and Fusion compositions.

The photo album counterpart of TimelineItem. Photo albums only support remote color versions, so the version methods take no version type.

Version:

Added in DaVinci Resolve 21.1.2

Methods

__init__(photo_album_item)

add_effect(category, effect_id)

Applies an effect to the photo.

add_flag(color)

Adds a flag with the given color, e.g. "Blue".

add_fusion_comp()

Adds a new Fusion composition to the item.

add_version(version_name)

Adds a new (remote) color version.

assign_to_color_group(color_group)

Assigns the photo to the given color group of the current project.

clear_clip_color()

Clears the item color.

clear_flags([color])

Clears the flags of the given color.

copy_grades(target_photo_album_items)

Copies the current node stack layer grade to the same layer of each target item.

delete_effects(effects)

Removes the given effects from the photo.

delete_fusion_comp_by_name(comp_name)

Deletes the named Fusion composition.

delete_version_by_name(version_name)

Deletes the named color version.

export_frame([export_frame_options])

Exports the photo as a still image.

export_fusion_comp(path, comp_index)

Exports the Fusion composition at comp_index to the given path.

export_lut(export_type, path)

Exports a LUT of the size given by export_type to the given path.

get_clip_color()

Returns the item color, an empty string if none is set.

get_color_group()

Returns the photo's color group, None if it is in none.

get_current_version()

Returns the current color version, {"versionName": str, "versionType": 1}.

get_effects(category)

Returns the effects of the given category ("fusion" or "ofx") applied to the photo.

get_flag_list()

Returns the flag colors assigned to the item.

get_fusion_comp_by_index(comp_index)

Returns the Fusion composition at the given index.

get_fusion_comp_by_name(comp_name)

Returns the Fusion composition with the given name.

get_fusion_comp_count()

Returns the number of Fusion compositions of the item.

get_fusion_comp_name_list()

Returns the names of the item's Fusion compositions.

get_media_pool_item()

Returns the media pool item of the photo, if one exists.

get_name()

Returns the item name.

get_node_graph([layer_index])

Returns the photo's node graph.

get_properties()

Returns all photo properties (source transform, cropping and looks).

get_ratings()

Returns the photo rating in stars, 0 to 5.

get_unique_id()

Returns a unique ID for the photo album item.

get_version_name_list()

Returns the names of all (remote) color versions.

import_fusion_comp(path)

Imports a Fusion composition from the given file path as a new composition of the item.

load_burn_in_preset(preset_name)

Loads the named user data burn-in preset for the photo.

load_fusion_comp_by_name(comp_name)

Loads the named Fusion composition as the active composition.

load_version_by_name(version_name)

Loads the named color version as the active version.

remove_from_color_group()

Removes the photo from its color group.

rename_fusion_comp_by_name(old_name, new_name)

Renames the Fusion composition named old_name.

rename_version_by_name(old_name, new_name)

Renames the color version named old_name.

reset_all_node_colors()

Resets the color of every node in the active version of the photo.

set_cdl(cdl_map)

Sets CDL values on a node.

set_clip_color(color_name)

Sets the item color, e.g. "Orange".

set_name(name)

Sets the item name.

set_properties(properties)

Sets photo properties (source transform, cropping and looks).

set_ratings(stars)

Sets the photo rating in stars, 0 to 5.

get_name() → str[source]

Returns the item name.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

str

set_name(name: str) → bool[source]

Sets the item name.

Parameters:

name (str) – new name

Returns:

True if successful, False otherwise

Return type:

bool

Version:

Added in DaVinci Resolve 21.1.2

get_unique_id() → str[source]

Returns a unique ID for the photo album item.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

str

get_media_pool_item() → MediaPoolItem | None[source]

Returns the media pool item of the photo, if one exists.

Returns:

the media pool item, None if there is none

Return type:

MediaPoolItem | None

Version:

Added in DaVinci Resolve 21.1.2

get_fusion_comp_count() → int[source]

Returns the number of Fusion compositions of the item.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

int

get_fusion_comp_name_list() → List[str][source]

Returns the names of the item’s Fusion compositions.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

List[str]

get_fusion_comp_by_index(comp_index: int) → FusionComp | None[source]

Returns the Fusion composition at the given index.

Parameters:

comp_index (int) – 1 <= comp_index <= get_fusion_comp_count()

Returns:

the Fusion composition, None if there is none

Return type:

FusionComp | None

Version:

Added in DaVinci Resolve 21.1.2

get_fusion_comp_by_name(comp_name: str) → FusionComp | None[source]

Returns the Fusion composition with the given name.

Parameters:

comp_name (str) – composition name

Returns:

the Fusion composition, None if there is none

Return type:

FusionComp | None

Version:

Added in DaVinci Resolve 21.1.2

add_fusion_comp() → FusionComp[source]

Adds a new Fusion composition to the item.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

FusionComp

delete_fusion_comp_by_name(comp_name: str) → bool[source]

Deletes the named Fusion composition.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

comp_name (str)

Return type:

bool

load_fusion_comp_by_name(comp_name: str) → FusionComp[source]

Loads the named Fusion composition as the active composition.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

comp_name (str)

Return type:

FusionComp

rename_fusion_comp_by_name(old_name: str, new_name: str) → bool[source]

Renames the Fusion composition named old_name.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:
  • old_name (str)

  • new_name (str)

Return type:

bool

import_fusion_comp(path: str) → FusionComp[source]

Imports a Fusion composition from the given file path as a new composition of the item.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

path (str)

Return type:

FusionComp

export_fusion_comp(path: str, comp_index: int) → bool[source]

Exports the Fusion composition at comp_index to the given path.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:
Return type:

bool

add_flag(color: str) → bool[source]

Adds a flag with the given color, e.g. “Blue”.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

color (str)

Return type:

bool

get_flag_list() → List[str][source]

Returns the flag colors assigned to the item.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

List[str]

clear_flags(color: str = 'All') → bool[source]

Clears the flags of the given color. “All” clears every flag.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

color (str)

Return type:

bool

get_clip_color() → str[source]

Returns the item color, an empty string if none is set.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

str

set_clip_color(color_name: str) → bool[source]

Sets the item color, e.g. “Orange”.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

color_name (str)

Return type:

bool

clear_clip_color() → bool[source]

Clears the item color.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

bool

get_ratings() → int[source]

Returns the photo rating in stars, 0 to 5.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

int

set_ratings(stars: int) → bool[source]

Sets the photo rating in stars, 0 to 5.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

stars (int)

Return type:

bool

copy_grades(target_photo_album_items: List[PhotoAlbumItem]) → bool[source]

Copies the current node stack layer grade to the same layer of each target item.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

target_photo_album_items (List[PhotoAlbumItem])

Return type:

bool

get_current_version() → Dict[source]

Returns the current color version, {"versionName": str, "versionType": 1}. Photo albums only support remote versions.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

Dict

add_version(version_name: str) → bool[source]

Adds a new (remote) color version.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

version_name (str)

Return type:

bool

get_version_name_list() → List[str][source]

Returns the names of all (remote) color versions.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

List[str]

load_version_by_name(version_name: str) → bool[source]

Loads the named color version as the active version.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

version_name (str)

Return type:

bool

rename_version_by_name(old_name: str, new_name: str) → bool[source]

Renames the color version named old_name.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:
  • old_name (str)

  • new_name (str)

Return type:

bool

delete_version_by_name(version_name: str) → bool[source]

Deletes the named color version.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

version_name (str)

Return type:

bool

set_cdl(cdl_map: CDL_Map | dict) → bool[source]

Sets CDL values on a node.

Parameters:

cdl_map (CDL_Map | dict) – NodeIndex, Slope, Offset, Power and Saturation

Returns:

True if successful, False otherwise

Return type:

bool

Version:

Added in DaVinci Resolve 21.1.2

get_node_graph(layer_index: int | None = None) → Graph[source]

Returns the photo’s node graph.

Parameters:

layer_index (int, optional) – 1 <= layer_index <= the project’s “nodeStackLayers” setting. Returns the first layer when omitted.

Return type:

Graph

Version:

Added in DaVinci Resolve 21.1.2

reset_all_node_colors() → bool[source]

Resets the color of every node in the active version of the photo.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

bool

export_lut(export_type: LUT_Export_Type, path: str) → bool[source]

Exports a LUT of the size given by export_type to the given path.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:
  • export_type (LUT_Export_Type)

  • path (str)

Return type:

bool

get_color_group() → ColorGroup | None[source]

Returns the photo’s color group, None if it is in none.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

ColorGroup | None

assign_to_color_group(color_group: ColorGroup) → bool[source]

Assigns the photo to the given color group of the current project.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

color_group (ColorGroup)

Return type:

bool

remove_from_color_group() → bool[source]

Removes the photo from its color group.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

bool

load_burn_in_preset(preset_name: str) → bool[source]

Loads the named user data burn-in preset for the photo.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

preset_name (str)

Return type:

bool

add_effect(category: str, effect_id: str) → Effect | None[source]

Applies an effect to the photo.

Parameters:
  • category (str) – “fusion” or “ofx”

  • effect_id (str) – effect id, see Resolve.get_effects_list("photo")

Returns:

the applied effect, None on failure

Return type:

Effect | None

Version:

Added in DaVinci Resolve 21.1.2

get_effects(category: str) → List[Effect][source]

Returns the effects of the given category (“fusion” or “ofx”) applied to the photo.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

category (str)

Return type:

List[Effect]

delete_effects(effects: List[Effect]) → bool[source]

Removes the given effects from the photo.

Version:

Added in DaVinci Resolve 21.1.2

Parameters:

effects (List[Effect])

Return type:

bool

export_frame(export_frame_options: ExportFrameOptions | dict | None = None) → ExportFrameResult | dict[source]

Exports the photo as a still image.

Parameters:

export_frame_options (ExportFrameOptions | dict, optional) – output options. Returns a base64 encoded JPEG when omitted. Defaults to None.

Returns:

the export result, an empty dict if nothing was

returned. Use ExportFrameResult.decode_data() for the image bytes.

Return type:

ExportFrameResult | dict

Version:

Added in DaVinci Resolve 21.1.2

get_properties() → Dict[source]

Returns all photo properties (source transform, cropping and looks).

Refer to settings.PhotoAlbumItemProperties for the keys.

Version:

Added in DaVinci Resolve 21.1.2

Return type:

Dict

set_properties(properties: PhotoAlbumItemProperties | dict) → bool[source]

Sets photo properties (source transform, cropping and looks).

DaVinci Resolve validates every key and value first, so either all properties are set or none is.

Parameters:

properties (PhotoAlbumItemProperties | dict) – properties to set

Returns:

True if successful, False otherwise

Return type:

bool

Version:

Added in DaVinci Resolve 21.1.2