VisibilityLayer

class VisibilityLayer
property id

The id of the layer.

Type

str, read-only

property name

The name of the layer.

Type

str

Raises

ReadOnlyError -- If Database is in read only mode.

property visible

The layer visibility.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property inherited_visibility

The inherited layer visibility.

Type

bool, read-only

property locked

The layer lock state.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property inherited_locking

The inherited layer lock state.

Type

bool, read-only

property configured

If the layer is used in configuration or not.

Type

bool, read-only

property active

Visibility layer active state.

Type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

property model

The parent model of this layer.

Type

Model, read-only

property parent_layer

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

Type

VisibilityLayer or None

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

  • ValueError -- If trying to move the layer into one of its children or trying to move the layer to another model or trying to move the layer to itself.

list_child_layers(recursive = True)

List the child visibility layers of this layer.

Parameters

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

Returns

The list of visibility layers of this layer.

Return type

list(VisibilityLayer)

create_visibility_layer(name)

Create a new child visibility layer of this layer.

Parameters

name (str) -- Name of the layer.

Returns

The newly created layer.

Return type

VisibilityLayer

Raises

ReadOnlyError -- If Database is in read only mode.

duplicate()

Duplicate this visibility layer with its children.

Returns

The duplicated layer.

Return type

VisibilityLayer

Raises

ReadOnlyError -- If Database is in read only mode.

remove(force = False)

Delete this visibility layer

Note

By default, only empty layers can be deleted (NotEmptyError is raised otherwise), use force to force deletion of non empty layers.

Parameters

force (bool) -- Force the deletion of the layer even if it contains surfaces.

Raises
list_surfaces()

List the surfaces of this layer.

Returns

The list of surfaces of this layer.

Return type

list(Surface)

import_triangle_mesh(name, positions, normals, uvs)

Import a surface from triangle mesh buffers.

Note

The winding order of triangles is counter-clockwise (OpenGL default).

Parameters
  • name (str) -- Name of the surface.

  • positions (list(float)) -- Vertices position (x, y, z) as floats. Units are meters.

  • normals (list(float)) -- Vertices normals (x, y, z) as floats. It can be empty if no normals are available.

  • uvs (list(float)) -- Vertices UVs (u, v) as floats. It can be empty if no UVs are available.

Returns

The imported surface.

Return type

Surface

Raises
import_indexed_triangle_mesh(name, indices, positions, normals, uvs)

Import a surface from indexed triangle mesh buffers. This is faster than importTriangleMesh

Note

The winding order of triangles is counter-clockwise (OpenGL default).

Parameters
  • name (str) -- Name of the surface.

  • indices (list(int)) -- Indices of vertices in positions, normals and uvs to make triangles.

  • positions (list(float)) -- Vertices position (x, y, z) as floats. Units are meters.

  • normals (list(float)) -- Vertices normals (x, y, z) as floats. It can be empty if no normals are available.

  • uvs (list(float)) -- Vertices UVs (u, v) as floats. It can be empty if no UVs are available.

Returns

The imported surface.

Return type

Surface

Raises