Skip to content

scene

Scene nodes, components, and interaction.

11 functions / 49 types

Modules

Index

FunctionDescription
clear_skyboxRemove the scene’s skybox, so the background is black from the next frame. Cancels a set_skybox load still in progress, which then fails with Cancelled.
cloneClone a scene node with shared render assets and the same parent and local component values. The clone has no project association. Active pointer drags are not copied.
despawnDespawn a scene object and all its descendants.
get_childrenGet the children of a given NodeSchema
get_clockRead the scene’s clock.
get_parentGet the parent of a given scene object if it exists
get_skyboxRead the skybox drawn now, or nothing when there is none. A load in progress is not reported.
set_clockSet the scene’s clock, and answer it as it now is. Each field left out keeps its value.
set_parentSet the parent of a given NodeSchema
set_skyboxDraw one equirectangular image as the scene’s background, and answer the skybox drawn once it has loaded.
spawnSpawn a new blank scene object into the scene
TypeDescription
ArrowA 3D Arrow.
AttributeBasedAppearanceColours a model by one of its attributes, through a named colour ramp.
AttributeRangeNumeric range an attribute-driven color ramp is stretched across.
AttributeValueOne attribute value of a leaf, one arm per attribute type.
BlockModelA block model representation.
BlockModelAppearanceHow a block model is drawn.
BlockModelAttributeRampBlock model colored by a named attribute through a color ramp.
BlockModelColorBlock model drawn in one flat color.
BlockModelGradientBlock model colored by a ramp along a world-space axis.
BlockModelMatCapBlock model shaded with a named matcap texture.
CapsuleA 3D Capsule.
ClockThe scene’s clock at the moment it was read.
CubeA 3D Cube.
DragKindHow a drag moves the shape it is set on.
DragRotationAn axis through a point, which a DragKind.Rotation turns about.
GeometryGeometry
GradientExtentsKindWhether a gradient spans the object or the whole scene.
LeafDescriptionIdentifies a block or point in loaded scene geometry.
LeafInfoPosition, size, and attribute values of one leaf.
LineDashLineDash
LineJoinLineJoin
LineRoundLineRound
LineStyleLineStyle
MeshA triangle mesh representation.
MeshAppearanceHow a mesh is drawn.
MeshAttributeRampMesh colored by its own vertex attributes.
MeshColorMesh drawn in one flat color.
MeshGradientMesh colored by a ramp along a world-space axis.
MeshMatCapMesh shaded with a named matcap texture.
NameA custom label for a node
NoFilterFilter that draws every element.
NodeNode
PointCloudA point cloud representation.
PointCloudAppearanceHow a point cloud is drawn.
PointCloudAttributeRampPoint cloud colored by a named attribute through a color ramp.
PointCloudColorPoint cloud drawn in one flat color.
PointCloudGradientPoint cloud colored by a ramp along a world-space axis.
PointCloudMatCapPoint cloud shaded with a named matcap texture.
PolylineA polyline representation, carried inline rather than by handle.
PolylineAppearancePolylineAppearance
ShapeShape
ShapeAppearanceHow a shape is drawn.
SkyboxThe scene’s skybox.
SphereA 3D Sphere.
TransformA translation, rotation, and scale in the scene.
ValueRangeFilterFilter keeping elements whose attribute falls inside [min, max].
VisibilityWhether an object is drawn.
VisibilityKindWhether an object is drawn, hidden, or follows its parent.
VolumetricFilterWhich elements of a model are drawn.

clear_skybox

def clear_skybox(*, _transaction_id: str | None = None) -> None

Remove the scene’s skybox, so the background is black from the next frame. Cancels a set_skybox load still in progress, which then fails with Cancelled.

Returns None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

clone

def clone(
    *,
    node: types.scene.Node,
    deep: bool | None = None,
    _transaction_id: str | None = None
) -> types.scene.Node

Clone a scene node with shared render assets and the same parent and local component values. The clone has no project association. Active pointer drags are not copied.

Returns Node.

node : Node

Node to clone.

deep optional : bool | None

Include descendant nodes. Defaults to true. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

despawn

def despawn(*, node: types.scene.Node, _transaction_id: str | None = None) -> None

Despawn a scene object and all its descendants.

Returns None.

node : Node

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

get_children

def get_children(
    *,
    node: types.scene.Node,
    _transaction_id: str | None = None
) -> tuple[types.scene.Node, ...]

Get the children of a given NodeSchema

Returns tuple[Node, ...].

node : Node

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

get_clock

def get_clock(*, _transaction_id: str | None = None) -> types.scene.Clock

Read the scene’s clock.

Returns Clock.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

get_parent

def get_parent(
    *,
    node: types.scene.Node,
    _transaction_id: str | None = None
) -> types.scene.Node | None

Get the parent of a given scene object if it exists

Returns Node | None.

node : Node

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

get_skybox

def get_skybox(*, _transaction_id: str | None = None) -> types.scene.Skybox | None

Read the skybox drawn now, or nothing when there is none. A load in progress is not reported.

Returns Skybox | None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_clock

def set_clock(
    *,
    time_utc: str | None = None,
    rate: float | None = None,
    _transaction_id: str | None = None
) -> types.scene.Clock

Set the scene’s clock, and answer it as it now is. Each field left out keeps its value.

The scene has one clock. It starts at the moment the engine starts, held still. Layers with a time axis show the date the clock reads, and the clock moves on by rate seconds for every real second. It stops at the years 0 and 9999. Nothing in the scene moves with the clock; the caller places objects for the moment it reads.

This is scene time, the moment the scene shows. It is separate from the project version being viewed, and setting one never moves the other.

Fails with InvalidArgument without changing anything when time_utc is not an RFC 3339 date and time or rate is not finite.

Returns Clock.

time_utc optional : str | None

An RFC 3339 date and time, such as 2024-06-20T20:51:00Z. Defaults to None.

rate optional : float | None

Seconds of clock time that pass in each real second. 0 holds the clock still, and a negative rate runs it backward. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_parent

def set_parent(
    *,
    node: types.scene.Node,
    parent: types.scene.Node | None = None,
    _transaction_id: str | None = None
) -> None

Set the parent of a given NodeSchema

Returns None.

node : Node

parent optional : Node | None

Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_skybox

def set_skybox(
    *,
    source: str,
    luminance: float | None = None,
    orientation: types.math.Quat | None = None,
    _transaction_id: str | None = None
) -> types.scene.Skybox

Draw one equirectangular image as the scene’s background, and answer the skybox drawn once it has loaded.

The image is twice as wide as it is tall. The pixel at column u and row v, both from 0 to 1 from the top left corner, shows the direction (cos Dec cos RA, cos Dec sin RA, sin Dec) in the image frame, where RA = (0.5 - u) * 360 degrees and Dec = (0.5 - v) * 180 degrees. The image frame is z-up, so a star map in celestial coordinates has right ascension 0h along +x and the north celestial pole along +z. orientation turns the image frame into scene axes.

A pixel’s linear value is drawn at that value times luminance, in cd/m^2, and each camera’s exposure applies to it. PNG, JPEG and WebP pixels are sRGB; Radiance HDR and OpenEXR pixels are linear. The image becomes a cubemap with faces a quarter of its width.

The source can instead be a KTX2 cubemap with its mips, in any texture format the GPU samples, and its faces show the same directions as the cubemap an image becomes. The engine uploads it as it is, so a large sky loads without the work of decoding and converting an image.

The current background stays drawn until the new image is ready. Given the source drawn now, only the luminance and orientation change and nothing is fetched. A later set_skybox or clear_skybox cancels a load still in progress, which then fails with Cancelled.

Fails with InvalidArgument when source is neither an absolute URL nor, outside a browser, an absolute file path, when luminance is negative or not finite, or when orientation is not finite or has zero length; with SourceUnavailable when the image cannot be fetched or read; and with UnsupportedFormat when it is not PNG, JPEG, WebP, Radiance HDR, OpenEXR or KTX2, cannot be decoded, is not twice as wide as it is tall, or is a KTX2 file that is not one cubemap or is in a texture format the GPU cannot sample.

Returns Skybox.

source : str

The absolute URL of the image. An engine running outside a browser also reads an absolute file path or a file: URL from its own disk.

luminance optional : float | None

cd/m^2 drawn for a linear pixel value of 1. Absent, 1. Defaults to None.

orientation optional : Quat | None

The turn from the image frame to scene axes. Absent, the identity. Normalized before use. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

spawn

def spawn(*, _transaction_id: str | None = None) -> types.scene.Node

Spawn a new blank scene object into the scene

Returns Node.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

Arrow

Arrow(*, length: float)

A 3D Arrow.

length : float

Length of the arrow

AttributeBasedAppearance

AttributeBasedAppearance(
    *,
    attribute: str,
    range: types.scene.AttributeRange | None = None,
    ramp: str | None = None
)

Colours a model by one of its attributes, through a named colour ramp.

attribute : str

Name of the attribute driving the color.

range optional : AttributeRange | None

Range the ramp is stretched across. When absent, the attribute’s own range is used. Defaults to None.

ramp optional : str | None

Name of the color ramp. When absent, the viewer’s default is used. Defaults to None.

AttributeRange

AttributeRange(*, min: float, max: float)

Numeric range an attribute-driven color ramp is stretched across.

min : float

Value mapped to the start of the ramp.

max : float

Value mapped to the end of the ramp.

AttributeValue

AttributeValue()

One attribute value of a leaf, one arm per attribute type.

Construct one of the nested classes. Use isinstance to check its type.

AttributeValue.Bool

AttributeValue.Bool(value: bool)

A true/false value.

value : bool

AttributeValue.Int

AttributeValue.Int(value: int)

A whole-number value.

value : int

AttributeValue.Real

AttributeValue.Real(value: float)

A numeric value.

value : float

AttributeValue.Text

AttributeValue.Text(value: str)

A text value.

value : str

AttributeValue.Color

AttributeValue.Color(value: types.color.ColorRgb)

A red/green/blue color.

value : ColorRgb

BlockModel

BlockModel(
    *,
    data: types.RemoteHandle,
    appearance: types.scene.BlockModelAppearance | None = None
)

A block model representation.

data : RemoteHandle

Handle of the stored model, as a hyphenated UUID.

appearance optional : BlockModelAppearance | None

How the block model is drawn. Defaults to None.

BlockModelAppearance

BlockModelAppearance()

How a block model is drawn.

Construct one of the nested classes. Use isinstance to check its type.

BlockModelAppearance.MatCap

BlockModelAppearance.MatCap(value: types.scene.BlockModelMatCap)

Shaded with a named matcap texture.

BlockModelAppearance.Color

BlockModelAppearance.Color(value: types.scene.BlockModelColor)

Drawn in one flat color.

BlockModelAppearance.AttributeRamp

BlockModelAppearance.AttributeRamp(value: types.scene.BlockModelAttributeRamp)

Colored by a named attribute through a color ramp.

BlockModelAppearance.Gradient

BlockModelAppearance.Gradient(value: types.scene.BlockModelGradient)

Colored by a ramp along a world-space axis.

BlockModelAttributeRamp

BlockModelAttributeRamp(
    *,
    appearance: types.scene.AttributeBasedAppearance | None = None,
    filter: types.scene.VolumetricFilter | None = None,
    outline: bool,
    opacity: float | None = None
)

Block model colored by a named attribute through a color ramp.

appearance optional : AttributeBasedAppearance | None

Which attribute drives the color and over what range. Defaults to None.

filter optional : VolumetricFilter | None

Which blocks are drawn. Defaults to None.

outline : bool

Whether block edges are outlined.

opacity optional : float | None

Alpha applied to the whole model, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

BlockModelColor

BlockModelColor(
    *,
    rgb: types.color.ColorRgb,
    filter: types.scene.VolumetricFilter | None = None,
    outline: bool,
    opacity: float | None = None
)

Block model drawn in one flat color.

rgb : ColorRgb

The flat color. Transparency is opacity, not an alpha channel here.

filter optional : VolumetricFilter | None

Which blocks are drawn. Defaults to None.

outline : bool

Whether block edges are outlined.

opacity optional : float | None

Alpha applied to the whole model, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

BlockModelGradient

BlockModelGradient(
    *,
    axis: types.math.Vec3,
    ramp: str,
    extents: types.scene.GradientExtentsKind,
    filter: types.scene.VolumetricFilter | None = None,
    outline: bool,
    opacity: float | None = None
)

Block model colored by a ramp along a world-space axis.

axis : Vec3

Direction the ramp runs along.

ramp : str

Name of the color ramp.

extents : GradientExtentsKind

Which bounds the ramp is stretched across.

filter optional : VolumetricFilter | None

Which blocks are drawn. Defaults to None.

outline : bool

Whether block edges are outlined.

opacity optional : float | None

Alpha applied to the whole model, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

BlockModelMatCap

BlockModelMatCap(
    *,
    name: str,
    filter: types.scene.VolumetricFilter | None = None,
    outline: bool,
    opacity: float | None = None
)

Block model shaded with a named matcap texture.

name : str

Name of the matcap texture.

filter optional : VolumetricFilter | None

Which blocks are drawn. Defaults to None.

outline : bool

Whether block edges are outlined.

opacity optional : float | None

Alpha applied to the whole model, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

Capsule

Capsule(*, radius: float, length: float)

A 3D Capsule.

radius : float

The radius of the Semi-Sphere.

length : float

The length of the capsule, minus the caps.

Clock

Clock(*, time_utc: str, unix_seconds: float, rate: float)

The scene’s clock at the moment it was read.

time_utc : str

RFC 3339 in UTC, with milliseconds where there are any.

unix_seconds : float

The same moment as seconds since 1970-01-01T00:00:00Z, without leap seconds.

rate : float

Seconds of clock time that pass in each real second.

Cube

Cube(*, half_extents: float)

A 3D Cube.

half_extents : float

The half-extents of the Cube.

DragKind

DragKind()

How a drag moves the shape it is set on.

Construct one of the nested classes. Use isinstance to check its type.

DragKind.TranslationAxis

DragKind.TranslationAxis(value: types.math.Vec3)

Slide along an axis.

value : Vec3

DragKind.TranslationPlane

DragKind.TranslationPlane(value: types.math.Vec3)

Slide in the plane this vector is normal to.

value : Vec3

DragKind.Rotation

DragKind.Rotation(value: types.scene.DragRotation)

Turn about an axis through a point.

value : DragRotation

DragRotation

DragRotation(*, axis: types.math.Vec3, center: types.math.Vec3)

An axis through a point, which a DragKind.Rotation turns about.

axis : Vec3

The axis turned about.

center : Vec3

The point the axis passes through.

Geometry

Geometry()

Geometry

Construct one of the nested classes. Use isinstance to check its type.

Geometry.Sphere

Geometry.Sphere(value: types.scene.Sphere)

A 3D Sphere.

value : Sphere

Geometry.Cube

Geometry.Cube(value: types.scene.Cube)

A 3D Cube.

value : Cube

Geometry.Arrow

Geometry.Arrow(value: types.scene.Arrow)

A 3D Arrow.

value : Arrow

Geometry.Capsule

Geometry.Capsule(value: types.scene.Capsule)

A 3D Capsule.

value : Capsule

GradientExtentsKind

Enum

class GradientExtentsKind(IntEnum)

Whether a gradient spans the object or the whole scene.

Values: LOCAL = 0 Stretch the ramp across the node’s own extents. GLOBAL = 1 Stretch the ramp across the whole scene’s extents.

LOCAL = 0

Stretch the ramp across the node’s own extents.

GLOBAL = 1

Stretch the ramp across the whole scene’s extents.

LeafDescription

LeafDescription(*, detail_level: int, leaf_index: int, region: int, data_id: int)

Identifies a block or point in loaded scene geometry.

detail_level : int

Level of detail the leaf was hit at. 0 is full detail (a single leaf); higher values cover progressively larger groups of leaves while the model loads in.

leaf_index : int

Index of the leaf within its level of detail.

region : int

The region of the model containing the leaf.

data_id : int

The loaded model data containing the leaf.

LeafInfo

LeafInfo(
    *,
    bounds: types.math.Aabb | None = None,
    attributes: dict[str, types.scene.AttributeValue] = <factory>,
    missing_attributes: tuple[str, ...] = ()
)

Position, size, and attribute values of one leaf.

Unloaded values are listed in missing_attributes and can be queried again after loading.

bounds optional : Aabb | None

The leaf’s box in the model’s local coordinates, absent until its geometry has loaded. Defaults to None.

attributes : dict[str, AttributeValue]

Attribute values by name.

missing_attributes optional : tuple[str, ...]

Attributes whose values haven’t loaded yet. Defaults to ().

LineDash

LineDash(*, gap_scale: float, line_scale: float)

LineDash

gap_scale : float

Gap length in multiples of the line width.

line_scale : float

Dash length in multiples of the line width.

LineJoin

LineJoin()

LineJoin

Construct one of the nested classes. Use isinstance to check its type.

LineJoin.None_

LineJoin.None_()

LineJoin.None_

LineJoin.Miter

LineJoin.Miter()

LineJoin.Miter

LineJoin.Bevel

LineJoin.Bevel()

LineJoin.Bevel

LineJoin.Round

LineJoin.Round(value: types.scene.LineRound)

LineJoin.Round

value : LineRound

LineRound

LineRound(*, resolution: int)

LineRound

resolution : int

LineStyle

LineStyle()

LineStyle

Construct one of the nested classes. Use isinstance to check its type.

LineStyle.Solid

LineStyle.Solid()

LineStyle.Solid

LineStyle.Dotted

LineStyle.Dotted()

LineStyle.Dotted

LineStyle.Dashed

LineStyle.Dashed(value: types.scene.LineDash)

LineStyle.Dashed

value : LineDash

Mesh

Mesh(
    *,
    data: types.RemoteHandle,
    appearance: types.scene.MeshAppearance | None = None
)

A triangle mesh representation.

data : RemoteHandle

Handle of the stored model, as a hyphenated UUID.

appearance optional : MeshAppearance | None

How the mesh is drawn. Defaults to None.

MeshAppearance

MeshAppearance()

How a mesh is drawn.

Construct one of the nested classes. Use isinstance to check its type.

MeshAppearance.MatCap

MeshAppearance.MatCap(value: types.scene.MeshMatCap)

Shaded with a named matcap texture.

value : MeshMatCap

MeshAppearance.Color

MeshAppearance.Color(value: types.scene.MeshColor)

Drawn in one flat color.

value : MeshColor

MeshAppearance.AttributeRamp

MeshAppearance.AttributeRamp(value: types.scene.MeshAttributeRamp)

Colored by the mesh’s own vertex attributes.

MeshAppearance.Gradient

MeshAppearance.Gradient(value: types.scene.MeshGradient)

Colored by a ramp along a world-space axis.

value : MeshGradient

MeshAttributeRamp

MeshAttributeRamp()

Mesh colored by its own vertex attributes.

MeshColor

MeshColor(*, rgba: types.color.ColorRgba)

Mesh drawn in one flat color.

rgba : ColorRgba

The flat color.

MeshGradient

MeshGradient(
    *,
    axis: types.math.Vec3,
    ramp: str,
    extents: types.scene.GradientExtentsKind
)

Mesh colored by a ramp along a world-space axis.

axis : Vec3

Direction the ramp runs along.

ramp : str

Name of the color ramp.

extents : GradientExtentsKind

Which bounds the ramp is stretched across.

MeshMatCap

MeshMatCap(*, name: str)

Mesh shaded with a named matcap texture.

name : str

Name of the matcap texture.

Name

Name(*, name: str)

A custom label for a node

name : str

Name of the node

NoFilter

NoFilter()

Filter that draws every element.

Node

Node(*, id: int)

Node

id : int

PointCloud

PointCloud(
    *,
    data: types.RemoteHandle,
    appearance: types.scene.PointCloudAppearance | None = None
)

A point cloud representation.

data : RemoteHandle

Handle of the stored model, as a hyphenated UUID.

appearance optional : PointCloudAppearance | None

How the point cloud is drawn. Defaults to None.

PointCloudAppearance

PointCloudAppearance()

How a point cloud is drawn.

Construct one of the nested classes. Use isinstance to check its type.

PointCloudAppearance.MatCap

PointCloudAppearance.MatCap(value: types.scene.PointCloudMatCap)

Shaded with a named matcap texture.

PointCloudAppearance.Color

PointCloudAppearance.Color(value: types.scene.PointCloudColor)

Drawn in one flat color.

PointCloudAppearance.AttributeRamp

PointCloudAppearance.AttributeRamp(value: types.scene.PointCloudAttributeRamp)

Colored by a named attribute through a color ramp.

PointCloudAppearance.Gradient

PointCloudAppearance.Gradient(value: types.scene.PointCloudGradient)

Colored by a ramp along a world-space axis.

PointCloudAttributeRamp

PointCloudAttributeRamp(
    *,
    point_size: float,
    appearance: types.scene.AttributeBasedAppearance | None = None,
    filter: types.scene.VolumetricFilter | None = None,
    opacity: float | None = None
)

Point cloud colored by a named attribute through a color ramp.

point_size : float

Diameter of a drawn point in world units.

appearance optional : AttributeBasedAppearance | None

Which attribute drives the color and over what range. Defaults to None.

filter optional : VolumetricFilter | None

Which points are drawn. Defaults to None.

opacity optional : float | None

Alpha applied to the whole cloud, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

PointCloudColor

PointCloudColor(
    *,
    point_size: float,
    rgb: types.color.ColorRgb,
    filter: types.scene.VolumetricFilter | None = None,
    opacity: float | None = None
)

Point cloud drawn in one flat color.

point_size : float

Diameter of a drawn point in world units.

rgb : ColorRgb

The flat color. Transparency is opacity, not an alpha channel here.

filter optional : VolumetricFilter | None

Which points are drawn. Defaults to None.

opacity optional : float | None

Alpha applied to the whole cloud, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

PointCloudGradient

PointCloudGradient(
    *,
    point_size: float,
    axis: types.math.Vec3,
    ramp: str,
    extents: types.scene.GradientExtentsKind,
    filter: types.scene.VolumetricFilter | None = None,
    opacity: float | None = None
)

Point cloud colored by a ramp along a world-space axis.

point_size : float

Diameter of a drawn point in world units.

axis : Vec3

Direction the ramp runs along.

ramp : str

Name of the color ramp.

extents : GradientExtentsKind

Which bounds the ramp is stretched across.

filter optional : VolumetricFilter | None

Which points are drawn. Defaults to None.

opacity optional : float | None

Alpha applied to the whole cloud, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

PointCloudMatCap

PointCloudMatCap(
    *,
    point_size: float,
    name: str,
    filter: types.scene.VolumetricFilter | None = None,
    opacity: float | None = None
)

Point cloud shaded with a named matcap texture.

point_size : float

Diameter of a drawn point in world units.

name : str

Name of the matcap texture.

filter optional : VolumetricFilter | None

Which points are drawn. Defaults to None.

opacity optional : float | None

Alpha applied to the whole cloud, 1.0 being fully opaque. When absent, it reads as fully opaque. Defaults to None.

Polyline

Polyline(
    *,
    vertices: tuple[types.math.Vec3, ...] = (),
    appearance: types.scene.PolylineAppearance | None = None
)

A polyline representation, carried inline rather than by handle.

vertices optional : tuple[Vec3, ...]

Polyline vertices in order. A closed polyline repeats its first vertex last. Defaults to ().

appearance optional : PolylineAppearance | None

Defaults to None.

PolylineAppearance

PolylineAppearance(
    *,
    color: types.color.ColorRgba | None = None,
    line_width: float | None = None,
    line_style: types.scene.LineStyle | None = None,
    line_join: types.scene.LineJoin | None = None,
    line_perspective: bool | None = None,
    depth_bias: float | None = None,
    fill_color: types.color.ColorRgba | None = None
)

PolylineAppearance

color optional : ColorRgba | None

Defaults to None.

line_width optional : float | None

Stroke width in pixels when perspective is disabled. It must be positive; the default is 4. Defaults to None.

line_style optional : LineStyle | None

Defaults to None.

line_join optional : LineJoin | None

Defaults to None.

line_perspective optional : bool | None

Whether stroke width decreases with distance. The default is false. Defaults to None.

depth_bias optional : float | None

Depth offset between -1 and 1. Negative values move lines toward the camera. Defaults to None.

fill_color optional : ColorRgba | None

Fill color for a closed planar polyline. Absent means no fill. Defaults to None.

Shape

Shape(
    *,
    geometry: types.scene.Geometry,
    appearance: types.scene.ShapeAppearance
)

Shape

geometry : Geometry

The shape geometry

appearance : ShapeAppearance

The appearance of the shape

ShapeAppearance

ShapeAppearance(
    *,
    color: types.color.ColorRgba | None = None,
    wireframe: bool,
    line_width: float | None = None,
    line_style: types.scene.LineStyle | None = None,
    line_join: types.scene.LineJoin | None = None,
    line_perspective: bool | None = None,
    depth_bias: float | None = None
)

How a shape is drawn.

color optional : ColorRgba | None

The color of the shape. Defaults to None.

wireframe : bool

Whether the engine draws the shape as a solid mesh or as a wireframe.

line_width optional : float | None

Wireframe width in pixels when perspective is disabled. It must be positive; the default is 2. Defaults to None.

line_style optional : LineStyle | None

Defaults to None.

line_join optional : LineJoin | None

Defaults to None.

line_perspective optional : bool | None

Whether wireframe width decreases with distance. The default is false. Defaults to None.

depth_bias optional : float | None

Depth offset between -1 and 1. Negative values move lines toward the camera. Defaults to None.

Skybox

Skybox(*, source: str, luminance: float, orientation: types.math.Quat)

The scene’s skybox.

source : str

The image URL.

luminance : float

cd/m^2 for a linear pixel value of 1.

orientation : Quat

The turn from the image frame to scene axes.

Sphere

Sphere(*, radius: float)

A 3D Sphere.

radius : float

The radius of the Sphere.

Transform

Transform(
    *,
    translation: types.math.Vec3,
    rotation: types.math.Quat,
    scale: types.math.Vec3
)

A translation, rotation, and scale in the scene.

translation : Vec3

Where the shape sits.

rotation : Quat

How the shape is turned.

scale : Vec3

How the shape is stretched along each of its own axes.

ValueRangeFilter

ValueRangeFilter(*, attribute: str, min: float, max: float)

Filter keeping elements whose attribute falls inside [min, max].

attribute : str

Name of the attribute being tested.

min : float

Inclusive lower bound.

max : float

Inclusive upper bound.

Visibility

Visibility(*, kind: types.scene.VisibilityKind)

Whether an object is drawn.

kind : VisibilityKind

The VisibilityKind as an i32 kind.

VisibilityKind

Enum

class VisibilityKind(IntEnum)

Whether an object is drawn, hidden, or follows its parent.

Values: INHERITED = 0 Inherit visibility from the parent node. VISIBLE = 1 Force the node visible. HIDDEN = 2 Force the node hidden.

INHERITED = 0

Inherit visibility from the parent node.

VISIBLE = 1

Force the node visible.

HIDDEN = 2

Force the node hidden.

VolumetricFilter

VolumetricFilter()

Which elements of a model are drawn.

Construct one of the nested classes. Use isinstance to check its type.

VolumetricFilter.None_

VolumetricFilter.None_(value: types.scene.NoFilter)

Every element is drawn.

value : NoFilter

VolumetricFilter.ValueRange

VolumetricFilter.ValueRange(value: types.scene.ValueRangeFilter)

Only elements whose attribute falls inside a numeric range are drawn.