Surface

class Surface

Base class: SceneObject

property id

The id of the scene object.

Type

str, read-only

property name

The name of the scene object.

Type

str

Raises

ReadOnlyError -- If Database is in read only mode.

property type

The type of the scene object.

Type

SceneObjectType, read-only

property parent_object

The parent object of this object or None if no parent.

Type

SceneObject or None

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

  • ValueError -- If trying to move the object into one of its children, trying to move the object to another model, trying to move the object to itself or trying to move the object to an object which is not a KinematicNode (that is an Axis, a Null or a Vector ).

property visible

The scene object visibility.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property locked

The scene object lock state.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property selected

Whether the scene object is selected.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property color

The shaper color of the scene object.

Type

ColorRgb

Raises

ReadOnlyError -- If Database is in read only mode.

property translation

The global translation of the scene object, in meters.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property rotation

The global rotation of the scene object, in degrees.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property scale

The global scale of the scene object.

Type

Vector3

Raises
property pivot_to_world_translation

The translation from pivot point to global position, in meters.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property pivot_to_world_rotation

The rotation from pivot point to global orientation, in degrees.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property local_to_pivot_translation

The translation from local point to pivot position, in meters.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property local_to_pivot_rotation

The rotation from local point to pivot orientation, in degrees.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property pivot_to_parent_translation

The translation from pivot point to parent position, in meters

Note

If the object does not have a parent, it returns the global translation.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property pivot_to_parent_rotation

The rotation from pivot point to parent orientation, in degrees

Note

If the object does not have a parent, it returns the global rotation.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property layer

The geometry layer containing this surface.

Type

GeometryLayer

Raises

ReadOnlyError -- If Database is in read only mode.

property symmetry

Whether symmetry is enabled for this layer.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property symmetry_plane_normal

The normal vector of the symmetry plane.

Type

Vector3

Raises

ReadOnlyError -- If Database is in read only mode.

property symmetry_plane_distance

The distance in meters of the symmetry plane from the origin.

Type

float

Raises

ReadOnlyError -- If Database is in read only mode.

property is_merged

Whether the surface is a merged or not.

Type

bool, read-only

property triangle_mesh_indices

Indices of vertices to make triangles in counter-clockwise order.

Type

list(int), read-only

property triangle_mesh_positions

Indexed triangle mesh vertices position (x, y, z) as floats. Units are meters.

Type

list(float), read-only

property triangle_mesh_normals

Indexed triangle mesh vertices normals (x, y, z) as floats or None if the mesh has no normals.

Type

list(float) or None, read-only

property triangle_mesh_uvs

The 32 UV layers of the indexed triangle mesh mesh. Each layer contains UVs (u, v) as floats or None if the mesh has no UV at this layer.

Type

list(list(float) or None), read-only

list_child_objects(recursive=True)

List the child kinematic object of this objects.

Parameters

recursive (bool) -- If True, lists all child objects in this object, otherwise only the direct child objects are returned.

Returns

The list of kinematic object of this node.

Return type

list(SceneObject)

has_tag(tag)

Whether the tag is assigned to the scene object.

Parameters

tag (str) -- Name of the tag.

Returns

Whether the tag is assigned to the scene object.

Return type

bool

list_tags()

List all the tags assigned to the scene object.

Returns

The list of tags assigned to the scene object.

Return type

list(str)

add_tag(tag)

Create a new tag and assign to the scene object.

Parameters

tag (str) -- Name of the tag.

Returns

Whether the tag was added or not.

Return type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

remove_tag(tag)

Remove tag from the scene object.

Parameters

tag (str) -- Name of the tag.

Raises

ReadOnlyError -- If Database is in read only mode.

remove()

Delete this scene object.

Raises

ReadOnlyError -- If Database is in read only mode.

shadow_cast(layer)

Get surface property shadow cast for the lighting layer.

Parameters

layer (LightingLayer) -- The lighting layer.

Returns

The shadow cast property of the surface.

Return type

bool

dressing_mapping_mode(uv_set)

Get the mapping mode for the given dressing.

Note

Available for dressings of any mapping mode.

Parameters

uv_set (int) -- The queryied dressing uv_set.

Returns

The mapping mode for the given dressing.

Return type

MappingMode

dressing_scale_uv(uv_set)

Get if the given uv_set dressing UV is scaled using surface scale.

Note

Only available for EXTRACT, PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters

uv_set (int) -- The queryied dressing uv_set.

Returns

If the given uv_set dressing UV is scaled using surface scale.

Return type

bool

set_dressing_scale_uv(uv_set, value)

Set if the given uv_set dressing UV is scaled using surface scale.

Note

Only available for EXTRACT, PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters
  • uv_set (int) -- The queryied dressing uv_set.

  • value (bool) -- Set true if you want to apply surface scale to uv mapping, false otherwise.

Raises

ReadOnlyError -- If Database is in read only mode.

dressing_local_translation(uv_set)

Get the dressing local translation.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters

uv_set (int) -- The queryied dressing uv_set.

Returns

The dressing local translation.

Return type

Vector3

set_dressing_local_translation(uv_set, value)

Set the dressing local translation.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters
  • uv_set (int) -- The queryied dressing uv_set.

  • value (Vector3) -- The new dressing local translation.

Raises

ReadOnlyError -- If Database is in read only mode.

dressing_local_orientation(uv_set)

Get the dressing local orientation.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters

uv_set (int) -- The queryied dressing uv_set.

Returns

The dressing local orientation.

Return type

Vector3

set_dressing_local_orientation(uv_set, value)

Set the dressing local orientation.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters
  • uv_set (int) -- The queryied dressing uv_set.

  • value (Vector3) -- The new dressing local orientation.

Raises

ReadOnlyError -- If Database is in read only mode.

dressing_size(uv_set)

Get the dressing size.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters

uv_set (int) -- The queryied dressing uv_set.

Returns

The dressing size.

Return type

Vector3

set_dressing_size(uv_set, value)

Set the dressing size.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters
  • uv_set (int) -- The queryied dressing uv_set.

  • value (Vector3) -- The new dressing size.

Raises

ReadOnlyError -- If Database is in read only mode.

dressing_tile(uv_set)

Get the dressing tile.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters

uv_set (int) -- The queryied dressing uv_set.

Returns

The dressing tile.

Return type

Vector3

set_dressing_tile(uv_set, value)

Set the dressing tile.

Note

Only available for PLANAR, CYLINDRICAL, CYLINDRICAL_WITH_CAP, SPHERICAL, BOX, BOX_WITHOUT_CAP and TORUS_MAPPER mapping modes.

Parameters
  • uv_set (int) -- The queryied dressing uv_set.

  • value (Vector3) -- The new dressing tile.

Raises

ReadOnlyError -- If Database is in read only mode.

aabb_min()

Get minimum point of the surface aabb.

Returns

The minimum point of the surface aabb.

Return type

Vector3

aabb_max()

Get maximum point of the surface aab.

Returns

The maximum point of the surface aabb.

Return type

Vector3

set_shadow_cast(layer, value)

Set surface property shadow cast for the lighting layer.

Parameters
  • layer (LightingLayer) -- The lighting layer.

  • value (bool) -- The value to be set for shadow cast property.

Raises

ReadOnlyError -- If Database is in read only mode.

shadow_receive(layer)

Get surface property shadow receive for the lighting layer.

Parameters

layer (LightingLayer) -- The lighting layer.

Returns

The shadow receive property of the surface.

Return type

bool

set_shadow_receive(layer, value)

Set surface property shadow receive for the lighting layer.

Parameters
  • layer (LightingLayer) -- The lighting layer.

  • value (bool) -- The value to be set for shadow receive property.

Raises

ReadOnlyError -- If Database is in read only mode.

duplicate()

Duplicate this surface.

Returns

The duplicated surface.

Return type

Surface

Raises

ReadOnlyError -- If Database is in read only mode.