AspectLayer

class AspectLayer
property id

The id of the aspect layer.

Type

str, read-only

property name

The name of the aspect layer.

Type

str

Raises

ReadOnlyError -- If Database is in read only mode.

property group

The group of this aspect layer or None if the aspect layer is at the root of the hierarchy.

Type

AspectLayerGroup or None

Raises

ReadOnlyError -- If Database is in read only mode.

property visible

The aspect layer visibility.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property locked

The aspect layer locking status.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property active

The active status of the aspect layer.

Type

bool, read-only

duplicate()

Duplicate this aspect layer.

Returns

The duplicated aspect layer.

Return type

AspectLayer

Raises

ReadOnlyError -- If Database is in read only mode.

remove()

Delete this aspect layer.

Raises
assign_material(surface, material, uvset=0)

Assign a Material to the given Surface into the current AspectLayer.

Parameters
  • surface (Surface) -- Surface on which to assign the material.

  • material (Material) -- Material to assign.

  • uvset (int) -- UV set to use for this material assignment.

Raises

ReadOnlyError -- If Database is in read only mode.

replace_material_assignment(surface, material, uvset=0)

Replace the material assignment on the given Surface with the Material while keeping the uv transformation in the current AspectLayer.

Parameters
  • surface (Surface) -- Surface on which to replace the material assignment.

  • material (Material) -- Material to reassign.

  • uvset (int) -- UV set to use for this material assignment.

Raises

ReadOnlyError -- If Database is in read only mode.

material_assignment_uvset(surface)

Get the uvset in for the material assignment on the given Surface.

Parameters

surface (Surface) -- Surface on which to get the uvset.

Returns

The uvset.

Return type

int

Raises

ValueError -- If the aspect layer is not applied on this surface.

material_assignment_offset_u(surface)

Get the offset in the U direction of the material assignment on the given Surface, in meters.

Parameters

surface (Surface) -- Surface on which to get the offset in the U direction.

Returns

The offset in the U direction.

Return type

float

Raises

ValueError -- If the aspect layer is not applied on this surface.

set_material_assignment_offset_u(offset_u, surface)

Set the offset in the U direction of the material assignment on the given Surface, in meters.

Parameters
  • offset_u (float) -- Offset in the U direction to set.

  • surface (Surface) -- Surface on which to set the offset in the U direction.

Raises
material_assignment_offset_v(surface)

Get the offset in the V direction of the material assignment on the given Surface, in meters.

Parameters

surface (Surface) -- Surface on which to get the offset in the V direction.

Returns

The offset in the V direction.

Return type

float

Raises

ValueError -- If the aspect layer is not applied on this surface.

set_material_assignment_offset_v(offset_v, surface)

Set the offset in the V direction of the material assignment on the given Surface, in meters.

Parameters
  • offset_v (float) -- Offset in the V direction to set.

  • surface (Surface) -- Surface on which to set the offset in the V direction.

Raises
material_assignment_rotation(surface)

Get the rotation of the material assignment on the given Surface, in degrees.

Parameters

surface (Surface) -- Surface on which to get the rotation.

Returns

The rotation.

Return type

float

Raises

ValueError -- If the aspect layer is not applied on this surface.

set_material_assignment_rotation(rotation, surface)

Set the rotation of the material assignment on the given Surface, in degrees.

Parameters
  • rotation (float) -- Rotation to set.

  • surface (Surface) -- Surface on which to set the rotation.

Raises
remove_material_assignment(surface)

Remove the material assignment on the given Surface.

Parameters

surface (Surface) -- Surface from which to remove the material.

Raises

ReadOnlyError -- If Database is in read only mode.

material_assignment(surface)

Get the material assignment on the given Surface if it exists. Return None if not.

Parameters

surface (Surface) -- Surface on which to get the material assignment.

Returns

The Material assigned to the given Surface. Returns None if no material is assigned.

Return type

Material or None

material_assignment_per_surface()

Get the map of material assignments per surface.

Returns

The map with Surface as key and the assigned Material as value.

Return type

dict(Surface, Material)

assign_sticker(surface, material, uvset=0)

Assign a Material as a sticker to the given Surface into the current AspectLayer.

Parameters
  • surface (Surface) -- Surface on which to assign the material.

  • material (Material) -- Material to assign as a sticker.

  • uvset (int) -- UV set to use for this sticker assignment.

Returns

The index of the Material assigned as a sticker to the given Surface.

Return type

int

Raises

ReadOnlyError -- If Database is in read only mode.

sticker_count(surface)

Get the count of stickers assigned to the given Surface.

Parameters

surface (Surface) -- Surface on which to get the count of assigned sticker.

Returns

The count of stickers assigned to the given Surface.

Return type

int

sticker_assignment_offset_u(surface, sticker_index)

Get the offset in the U direction of the sticker assignment on the given Surface, in meters.

Parameters
  • surface (Surface) -- Surface on which to get the offset in the U direction.

  • sticker_index (int) -- Index of the sticker assignment for which the offset in the U direction will be returned.

Returns

The offset in the U direction.

Return type

float

Raises
  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

set_sticker_assignment_offset_u(offset_u, surface, sticker_index)

Set the offset in the U direction of the sticker assignment on the given Surface, in meters.

Parameters
  • offset_u (float) -- Offset in the U direction to set.

  • surface (Surface) -- Surface on which to set the offset in the U direction.

  • sticker_index (int) -- Index of the sticker for which the offset in the U direction will be set.

Raises
  • ReadOnlyError -- If Database is in read only mode.

  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

sticker_assignment_offset_v(surface, sticker_index)

Get the offset in the U direction of the sticker assignment on the given Surface, in meters.

Parameters
  • surface (Surface) -- Surface on which to get the offset in the V direction.

  • sticker_index (int) -- Index of the sticker for which the offset in the V direction will be returned.

Returns

The offset in the V direction.

Return type

float

Raises
  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

set_sticker_assignment_offset_v(offset_v, surface, sticker_index)

Set the offset in the V direction of the sticker assignment on the given Surface, in meters.

Parameters
  • offset_v (float) -- Offset in the V direction to set.

  • surface (Surface) -- Surface on which to set the offset in the V direction.

  • sticker_index (int) -- Index of the sticker for which the offset in the V direction will be set.

Raises
  • ReadOnlyError -- If Database is in read only mode.

  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

sticker_assignment_rotation(surface, sticker_index)

Get the rotation of the sticker assignment on the given Surface, in degrees.

Parameters
  • surface (Surface) -- Surface on which to get the rotation.

  • sticker_index (int) -- Index of the sticker for which the rotation will be returned.

Returns

The rotation in degrees.

Return type

float

Raises
  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

set_sticker_assignment_rotation(rotation, surface, sticker_index)

Set the rotation of the sticker assignment on the given Surface, in degrees.

Parameters
  • rotation (float) -- Rotation to set.

  • surface (Surface) -- Surface on which to set the rotation.

  • sticker_index (int) -- Index of the sticker for which the rotation will be set.

Raises
  • ReadOnlyError -- If Database is in read only mode.

  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

remove_sticker_assignment(surface, sticker_index)

Remove the sticker assignment of the given index on the given Surface.

Parameters
  • surface (Surface) -- Surface from which to remove the sticker.

  • sticker_index (int) -- Index of the sticker to be removed.

Raises
  • ReadOnlyError -- If Database is in read only mode.

  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

remove_all_sticker_assignments(surface)

Remove all the sticker assignments on the given Surface.

Parameters

surface (Surface) -- Surface from which to remove all sticker assignments.

Raises

ReadOnlyError -- If Database is in read only mode.

sticker_assignment(surface, sticker_index)

Get the sticker assignment on the given Surface at the given index if it exists. Return None if not.

Parameters
  • surface (Surface) -- Surface on which to get the sticker assignment.

  • sticker_index (int) -- Index of the sticker to be returned.

Returns

The Material assigned as sticker at the given stickerIndex to the given Surface. Returns None if no material is assigned as a sticker with the given stickerIndex.

Return type

Material or None

Raises
  • ValueError -- If the aspect layer is not applied on this surface.

  • ValueError -- If the stickerIndex does not correspond to a sticker assigned to this surface.

all_sticker_assignments(surface)

Get all the sticker assignment on the given Surface as a list if it exists. Return an empty list if not.

Parameters

surface (Surface) -- Surface on which to get the list of sticker assignment.

Returns

The list of Material assigned to the given Surface as a sticker. Returns an empty list if no material is assigned as a sticker.

Return type

list(Material)