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.

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.