Database

class Database
property read_only

The database read only status.

Type

bool, read-only

property active_model

The active model.

Type

Model

Raises

ReadOnlyError -- If Database is in read only mode.

property active_material_group

The active material group.

Type

MaterialGroup

Raises

ReadOnlyError -- If Database is in read only mode.

property active_texture_group

The active texture group.

Type

TextureGroup

Raises

ReadOnlyError -- If Database is in read only mode.

property active_background_group

The active background group.

Type

BackgroundGroup

Raises

ReadOnlyError -- If Database is in read only mode.

property active_environment_group

The active environment group.

Type

EnvironmentGroup

Raises

ReadOnlyError -- If Database is in read only mode.

property active_overlay_group

The active overlay group.

Type

OverlayGroup

Raises

ReadOnlyError -- If Database is in read only mode.

property active_postprocess_group

The active postprocess group.

Type

PostprocessGroup

Raises

ReadOnlyError -- If Database is in read only mode.

property active_sensor_group

The active sensor group.

Type

SensorGroup

Raises

ReadOnlyError -- If Database is in read only mode.

property active_material

The active material.

Type

Material or None

Raises

ReadOnlyError -- If Database is in read only mode.

property active_background

The active background.

Type

Background or None

Raises

ReadOnlyError -- If Database is in read only mode.

property active_environment

The active environment.

Type

Environment or None

Raises

ReadOnlyError -- If Database is in read only mode.

property active_overlay

The active overlay.

Type

Overlay or None

Raises

ReadOnlyError -- If Database is in read only mode.

property active_postprocess

The active postprocess.

Type

Postprocess or None

Raises

ReadOnlyError -- If Database is in read only mode.

property active_sensor

The active sensor.

Type

Sensor or None

Raises

ReadOnlyError -- If Database is in read only mode.

save()

Save the database.

Returns

True if successful.

Return type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

save_and_clean(save_cache)

Save and clean the database.

Parameters

save_cache (bool) -- Whether to save the cache or not.

Returns

True if successful.

Return type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

save_as(filename, save_cache)

Save the database to another file.

Parameters
  • filename (str) -- The new database filename.

  • save_cache (bool) -- Whether to save the cache or not.

Returns

True if successful.

Return type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

quick_save_as(filename)

Quickly save the database to another file, without any optimization.

Parameters

filename (str) -- The new database filename.

Returns

True if successful.

Return type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

close()

Close the database

Note

The database is not automatically saved. Call save() or save_as() before close() if you want to do so.

find_camera(id)

Find a camera by id.

Parameters

id (str) -- Camera id to find.

Returns

The camera found or None if not found.

Return type

Camera or None

list_cameras(recursive=True)

List the cameras of the database.

Parameters

recursive (bool) -- If True, list all cameras in the database, otherwise only the root cameras are returned.

Returns

The list of cameras in the database.

Return type

list(Camera)

create_camera(group=None)

Create a camera.

Parameters

group (CameraGroup or None) -- Group of the new camera, or None to put the camera at the root of the hierarchy.

Returns

The new camera.

Return type

Camera

Raises

ReadOnlyError -- If Database is in read only mode.

find_camera_group(id)

Find a camera group by id.

Parameters

id (str) -- Camera group id to find.

Returns

The camera group found or None if not found.

Return type

CameraGroup or None

list_camera_groups(recursive=True)

List the camera groups of the database.

Parameters

recursive (bool) -- If True, list all camera groups in the database, otherwise only the root groups are returned.

Returns

The list of camera groups in the database.

Return type

list(CameraGroup)

create_camera_group(name, parent_group=None)

Create a camera group.

Parameters
  • name (str) -- Name of the new group.

  • parent_group (CameraGroup or None) -- Parent group of the new group, or None to put the group at the root of the hierarchy.

Returns

The new group.

Return type

CameraGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_model(id)

Find a model by id.

Parameters

id (str) -- Model id to find.

Returns

The model found or None if not found.

Return type

Model or None

list_models()

List the models of the database.

Returns

The list of models in the database.

Return type

list(Model)

create_material_group(name)

Create a new material group.

Parameters

name (str) -- Name of the group.

Returns

The newly created group.

Return type

MaterialGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_material_group(id)

Find a material group by id.

Parameters

id (str) -- Material group id to find.

Returns

The material group found or None if not found.

Return type

MaterialGroup or None

list_material_groups()

List the material groups of the database.

Returns

The list of material groups in the database.

Return type

list(MaterialGroup)

create_texture_group(name)

Create a new texture group.

Parameters

name (str) -- Name of the group.

Returns

The newly created group.

Return type

TextureGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_texture_group(id)

Find a texture group by id.

Parameters

id (str) -- Texture group id to find.

Returns

The texture group found or None if not found.

Return type

TextureGroup or None

list_texture_groups()

List the texture groups of the database.

Returns

The list of texture groups in the database.

Return type

list(TextureGroup)

create_background_group(name)

Create a new background group.

Parameters

name (str) -- Name of the group.

Returns

The newly created group.

Return type

BackgroundGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_background_group(id)

Find a background group by id.

Parameters

id (str) -- Background group id to find.

Returns

The background group found or None if not found.

Return type

BackgroundGroup or None

list_background_groups()

List the background groups of the database.

Returns

The list of background groups in the database.

Return type

list(BackgroundGroup)

create_environment_group(name)

Create a new environment group.

Parameters

name (str) -- Name of the group.

Returns

The newly created group.

Return type

EnvironmentGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_environment_group(id)

Find a environment group by id.

Parameters

id (str) -- Environment group id to find.

Returns

The environment group found or None if not found.

Return type

EnvironmentGroup or None

list_environment_groups()

List the environment groups of the database.

Returns

The list of environment groups in the database.

Return type

list(EnvironmentGroup)

create_overlay_group(name)

Create a new overlay group.

Parameters

name (str) -- Name of the group.

Returns

The newly created group.

Return type

OverlayGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_overlay_group(id)

Find a overlay group by id.

Parameters

id (str) -- Overlay group id to find.

Returns

The overlay group found or None if not found.

Return type

OverlayGroup or None

list_overlay_groups()

List the overlay groups of the database.

Returns

The list of overlay groups in the database.

Return type

list(OverlayGroup)

create_postprocess_group(name)

Create a new postprocess group.

Parameters

name (str) -- Name of the group.

Returns

The newly created group.

Return type

PostprocessGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_postprocess_group(id)

Find a postprocess group by id.

Parameters

id (str) -- Postprocess group id to find.

Returns

The postprocess group found or None if not found.

Return type

PostprocessGroup or None

list_postprocess_groups()

List the postprocess groups of the database.

Returns

The list of postprocess groups in the database.

Return type

list(PostprocessGroup)

create_sensor_group(name)

Create a new sensor group.

Parameters

name (str) -- Name of the group.

Returns

The newly created group.

Return type

SensorGroup

Raises

ReadOnlyError -- If Database is in read only mode.

find_sensor_group(id)

Find a sensor group by id.

Parameters

id (str) -- Sensor group id to find.

Returns

The sensor group found or None if not found.

Return type

SensorGroup or None

list_sensor_groups()

List the sensor groups of the database.

Returns

The list of sensor groups in the database.

Return type

list(SensorGroup)

create_configuration_rule(name)

Create a new configuration rule in the database.

Parameters

name (str) -- Name of the configuration rule.

Returns

The newly created configuration rule.

Return type

ConfigurationRule

Raises

ReadOnlyError -- If Database is in read only mode.

find_configuration_rule(id)

Find a configuration rule by id.

Parameters

id (str) -- Configuration rule id to find.

Returns

The configuration rule found or None if not found.

Return type

ConfigurationRule or None

list_configuration_rules()

List the configuration rules of the database.

Returns

The list of configuration rules in the database.

Return type

list(ConfigurationRule)

export_kdr(filename, products, version=0)

Export the specified products to a KDR file.

Parameters
  • filename (str) -- KDR filename.

  • products (list(Product)) -- Products to export.

  • version (int) -- KDR version: 0 is for latest version, n is for Xn version.

Raises
  • FileNotFoundError -- If the destination directory does not exist.

  • ValueError -- If KDR version is not valid.

  • ValueError -- If some products uses features that are not compatible with specified KDR version.

export_kdc(filename, products, version=0)

Export the specified products to a KDC file.

Parameters
  • filename (str) -- KDC filename.

  • products (list(Product)) -- Products to export.

  • version (int) -- KDR version: 0 is for latest version, n is for Xn version.

Raises
  • FileNotFoundError -- If the destination directory does not exist.

  • ValueError -- If KDR version is not valid.

  • ValueError -- If some products uses features that are not compatible with specified KDR version.

object_has_metadata_key(id, key)

Check if the metadata has a key registered on a specific object.

Parameters
  • id (str) -- Id of an object from the database.

  • key (str) -- Any string.

Returns

True if the key is registered on this object, False otherwise.

Return type

bool

object_metadata_value(id, key)

Get the metadata value associated to the key from the given object.

Parameters
  • id (str) -- Id of an object from the database.

  • key (str) -- Any string.

Returns

The value associated to the key if it is registered or an empty string otherwise.

Return type

str

set_object_metadata_value(id, key, new_value)

Store a metadata value to the given object and key.

Parameters
  • id (str) -- Id of an object from the database.

  • key (str) -- Any string.

  • new_value (str) -- The value to store.

Raises

ReadOnlyError -- If Database is in read only mode.

object_metadata_store(id)

Get all the metadata keys and values from an object.

Parameters

id (str) -- Id of an object from the database.

Returns

A dictionnary of all keys and values associated to the object.

Return type

dict(str, str)

set_object_metadata_store(id, store)

Set the metadata store of an object.

Parameters
  • id (str) -- Id of an object from the database.

  • store (dict(str, str)) -- A dictionnary containing the metadata key and values.

Raises

ReadOnlyError -- If Database is in read only mode.

delete_object_metadata_key(id, key)

Remove a key from the metadata associated to an object.

Parameters
  • id (str) -- Id of an object from the database.

  • key (str) -- Any string.

Raises

ReadOnlyError -- If Database is in read only mode.

delete_object_metadata(id)

Clean the metadata associated to an object.

Parameters

id (str) -- Id of an object from the database.

Raises

ReadOnlyError -- If Database is in read only mode.

list_product_key_animations()

List all the ProductKeyAnimation.

Returns

The list of ProductKeyAnimation in the database.

Return type

list(ProductKeyAnimation)

find_product_key_animation(id)

Find an ProductKeyAnimation by id.

Parameters

id (str) -- ProductKeyAnimation id to find.

Returns

The ProductKeyAnimation found or None if not found.

Return type

ProductKeyAnimation or None

create_camera_bookmark_animation(name)

Create a new CameraBookmarkAnimation in the database.

Parameters

name (str) -- Name of the CameraBookmarkAnimation.

Returns

The newly created CameraBookmarkAnimation.

Return type

CameraBookmarkAnimation

Raises

ReadOnlyError -- If Database is in read only mode.

list_camera_bookmark_animations()

List all the CameraBookmarkAnimation.

Returns

The list of CameraBookmarkAnimation in the database.

Return type

list(CameraBookmarkAnimation)

find_camera_bookmark_animation(id)

Find an CameraBookmarkAnimation by id.

Parameters

id (str) -- CameraBookmarkAnimation id to find.

Returns

The CameraBookmarkAnimation found or None if not found.

Return type

CameraBookmarkAnimation or None

create_camera_bezier_path_animation(name)

Create a new CameraBezierPathAnimation in the database.

Parameters

name (str) -- Name of the CameraBezierPathAnimation.

Returns

The newly created CameraBezierPathAnimation.

Return type

CameraBezierPathAnimation

Raises

ReadOnlyError -- If Database is in read only mode.

list_camera_bezier_path_animations()

List all the CameraBezierPathAnimation.

Returns

The list of CameraBezierPathAnimation in the database.

Return type

list(CameraBezierPathAnimation)

find_camera_bezier_path_animation(id)

Find an CameraBezierPathAnimation by id.

Parameters

id (str) -- CameraBezierPathAnimation id to find.

Returns

The CameraBezierPathAnimation found or None if not found.

Return type

CameraBezierPathAnimation or None

create_configuration_key_animation(name)

Create a new ConfigurationKeyAnimation in the database.

Parameters

name (str) -- Name of the ConfigurationKeyAnimation.

Returns

The newly created ConfigurationKeyAnimation.

Return type

ConfigurationKeyAnimation

Raises

ReadOnlyError -- If Database is in read only mode.

list_configuration_key_animations()

List all the ConfigurationKeyAnimation.

Returns

The list of ConfigurationKeyAnimation in the database.

Return type

list(ConfigurationKeyAnimation)

find_configuration_key_animation(id)

Find an ConfigurationKeyAnimation by id.

Parameters

id (str) -- ConfigurationKeyAnimation id to find.

Returns

The ConfigurationKeyAnimation found or None if not found.

Return type

ConfigurationKeyAnimation or None

create_channels_simple_animation(name)

Create a new ChannelsSimpleAnimation in the database.

Parameters

name (str) -- Name of the ChannelsSimpleAnimation.

Returns

The newly created ChannelsSimpleAnimation.

Return type

ChannelsSimpleAnimation

Raises

ReadOnlyError -- If Database is in read only mode.

create_channels_curve_animation(name)

Create a new ChannelsCurveAnimation in the database.

Parameters

name (str) -- Name of the ChannelsCurveAnimation.

Returns

The newly created ChannelsCurveAnimation.

Return type

ChannelsCurveAnimation

Raises

ReadOnlyError -- If Database is in read only mode.

list_channels_simple_animations()

List all the ChannelsSimpleAnimation.

Returns

The list of ChannelsSimpleAnimation in the database.

Return type

list(ChannelsSimpleAnimation)

list_channels_curve_animations()

List all the ChannelsCurveAnimation.

Returns

The list of ChannelsCurveAnimation in the database.

Return type

list(ChannelsCurveAnimation)

list_surface_baked_animations()

List all the SurfaceBakedAnimation.

Returns

The list of SurfaceBakedAnimation in the database.

Return type

list(SurfaceBakedAnimation)

find_channels_simple_animation(id)

Find an ChannelsSimpleAnimation by id.

Parameters

id (str) -- ChannelsSimpleAnimation id to find.

Returns

The ChannelsSimpleAnimation found or None if not found.

Return type

ChannelsSimpleAnimation or None

find_channels_curve_animation(id)

Find an ChannelsCurveAnimation by id.

Parameters

id (str) -- ChannelsCurveAnimation id to find.

Returns

The ChannelsCurveAnimation found or None if not found.

Return type

ChannelsCurveAnimation or None

find_surface_baked_animation(id)

Find an SurfaceBakedAnimation by id.

Parameters

id (str) -- SurfaceBakedAnimation id to find.

Returns

The SurfaceBakedAnimation found or None if not found.

Return type

SurfaceBakedAnimation or None

list_texture_animations()

List all the TextureAnimation.

Returns

The list of TextureAnimation in the database.

Return type

list(TextureAnimation)

find_texture_animation(id)

Find an TextureAnimation by id.

Parameters

id (str) -- TextureAnimation id to find.

Returns

The ProductKeyAnimaTextureAnimationtion found or None if not found.

Return type

TextureAnimation or None

create_timeline(name)

Create a new Timeline in the database.

Parameters

name (str) -- Name of the Timeline.

Returns

The newly created Timeline.

Return type

Timeline

Raises

ReadOnlyError -- If Database is in read only mode.

list_timelines()

List all the Timeline.

Returns

The list of Timeline in the database.

Return type

list(Timeline)

find_timeline(id)

Find an Timeline by id.

Parameters

id (str) -- Timeline id to find.

Returns

The Timeline found or None if not found.

Return type

Timeline or None

is_r3dc()

Check if the database is a R3DC database.

Returns

Whether the database is a R3DC database or not.

Return type

bool

apply_vcd(vcd)

Apply VCD to the database.

Parameters

vcd (str) -- The VCD to be applied.

Raises

ReadOnlyError -- If Database is in read only mode.