PhotoAlbumItem#
- class pybmd.photo_album_item.PhotoAlbumItem(photo_album_item)[source]
Bases:
WrapperBaseA 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".
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.
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.
Returns the item color, an empty string if none is set.
Returns the photo's color group, None if it is in none.
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.
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.
Returns the number of Fusion compositions of the item.
Returns the names of the item's Fusion compositions.
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.
Returns all photo properties (source transform, cropping and looks).
Returns the photo rating in stars, 0 to 5.
Returns a unique ID for the photo album item.
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.
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.
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_unique_id() str[source]
Returns a unique ID for the photo album item.
- Version:
Added in DaVinci Resolve 21.1.2
- Return type:
- 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:
- 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
- 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
- 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
- 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
- add_flag(color: str) bool[source]
Adds a flag with the given color, e.g. “Blue”.
- Version:
Added in DaVinci Resolve 21.1.2
- get_flag_list() List[str][source]
Returns the flag colors assigned to the item.
- Version:
Added in DaVinci Resolve 21.1.2
- 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
- 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:
- set_clip_color(color_name: str) bool[source]
Sets the item color, e.g. “Orange”.
- Version:
Added in DaVinci Resolve 21.1.2
- clear_clip_color() bool[source]
Clears the item color.
- Version:
Added in DaVinci Resolve 21.1.2
- Return type:
- get_ratings() int[source]
Returns the photo rating in stars, 0 to 5.
- Version:
Added in DaVinci Resolve 21.1.2
- Return type:
- set_ratings(stars: int) bool[source]
Sets the photo rating in stars, 0 to 5.
- Version:
Added in DaVinci Resolve 21.1.2
- 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
- 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:
- add_version(version_name: str) bool[source]
Adds a new (remote) color version.
- Version:
Added in DaVinci Resolve 21.1.2
- get_version_name_list() List[str][source]
Returns the names of all (remote) color versions.
- Version:
Added in DaVinci Resolve 21.1.2
- 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
- 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
- delete_version_by_name(version_name: str) bool[source]
Deletes the named color version.
- Version:
Added in DaVinci Resolve 21.1.2
- set_cdl(cdl_map: CDL_Map | dict) bool[source]
Sets CDL values on a node.
- Parameters:
cdl_map (CDL_Map | dict) –
NodeIndex,Slope,Offset,PowerandSaturation- Returns:
True if successful, False otherwise
- Return type:
- 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:
- 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
- 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:
- remove_from_color_group() bool[source]
Removes the photo from its color group.
- Version:
Added in DaVinci Resolve 21.1.2
- Return type:
- 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
- add_effect(category: str, effect_id: str) Effect | None[source]
Applies an effect to the photo.
- Parameters:
- 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
- delete_effects(effects: List[Effect]) bool[source]
Removes the given effects from the photo.
- Version:
Added in DaVinci Resolve 21.1.2
- 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.PhotoAlbumItemPropertiesfor the keys.- Version:
Added in DaVinci Resolve 21.1.2
- Return type:
- 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:
- Version:
Added in DaVinci Resolve 21.1.2