Skip to content

project.object

Create and edit versioned project objects and their components.

7 functions / 42 types

Modules

Index

FunctionDescription
despawnDespawn a project object and all its descendants.
fromSceneFinds the project node associated with a scene node.
getChildrenGet the children of a given ProjectNodeSchema
getParentGet the parent of a given scene object if it exists
setParentSet the parent of a given ProjectNodeSchema
spawnSpawn a new blank project object
toSceneFinds the current scene node associated with a project node.
TypeDescription
ProjectArrowA 3D Arrow.
ProjectAttributeBasedAppearanceColours a model by one of its attributes, through a named colour ramp.
ProjectAttributeRangeNumeric range an attribute-driven color ramp is stretched across.
ProjectBlockModelA point cloud representation.
ProjectBlockModelAppearanceHow a point cloud is drawn.
ProjectBlockModelAttributeRampPoint cloud colored by a named attribute through a color ramp.
ProjectBlockModelColorPoint cloud drawn in one flat color.
ProjectBlockModelGradientPoint cloud colored by a ramp along a world-space axis.
ProjectBlockModelMatCapPoint cloud shaded with a named matcap texture.
ProjectCapsuleA 3D Capsule.
ProjectCubeA 3D Cube.
ProjectGeometry
ProjectGradientExtentsKindWhether a gradient spans the object or the whole scene.
ProjectLineDash
ProjectLineJoin
ProjectLineRound
ProjectLineStyle
ProjectMeshA point cloud representation.
ProjectMeshAppearanceHow a point cloud is drawn.
ProjectMeshAttributeRampPoint cloud colored by a named attribute through a color ramp.
ProjectMeshColorPoint cloud drawn in one flat color.
ProjectMeshGradientPoint cloud colored by a ramp along a world-space axis.
ProjectMeshMatCapPoint cloud shaded with a named matcap texture.
ProjectNameA name for a ProjectNode.
ProjectNoFilterFilter that draws every element.
ProjectNodeThe ID of a ProjectNode.
ProjectPointCloudA point cloud representation.
ProjectPointCloudAppearanceHow a point cloud is drawn.
ProjectPointCloudAttributeRampPoint cloud colored by a named attribute through a color ramp.
ProjectPointCloudColorPoint cloud drawn in one flat color.
ProjectPointCloudGradientPoint cloud colored by a ramp along a world-space axis.
ProjectPointCloudMatCapPoint cloud shaded with a named matcap texture.
ProjectPolyline
ProjectPolylineAppearance
ProjectShape
ProjectShapeAppearanceHow a shape is drawn.
ProjectSphereA 3D Sphere.
ProjectTransformWhere an object sits, how it is turned, and its scale. All parts are double precision.
ProjectValueRangeFilterFilter keeping elements whose attribute falls inside [min, max].
ProjectVisibilityWhether an object is drawn.
ProjectVisibilityKindWhether an object is drawn, hidden, or follows its parent.
ProjectVolumetricFilterWhich elements of a model are drawn.

despawn

despawn(args: { node: ProjectObjectProjectNode }, transactionId?: string): Promise<void>

Despawn a project object and all its descendants.

Returns Promise<void>.

transactionId optional : string

fromScene

fromScene(args: { node: SceneNode }, transactionId?: string): Promise<ProjectObjectProjectNode | undefined>

Finds the project node associated with a scene node.

Returns Promise<ProjectObjectProjectNode | undefined>.

node : SceneNode

transactionId optional : string

getChildren

getChildren(args: { node: ProjectObjectProjectNode }, transactionId?: string): Promise<Array<ProjectObjectProjectNode>>

Get the children of a given ProjectNodeSchema

Returns Promise<Array<ProjectObjectProjectNode>>.

transactionId optional : string

getParent

getParent(args: { node: ProjectObjectProjectNode }, transactionId?: string): Promise<ProjectObjectProjectNode | undefined>

Get the parent of a given scene object if it exists

Returns Promise<ProjectObjectProjectNode | undefined>.

transactionId optional : string

setParent

setParent(args: { node: ProjectObjectProjectNode; parent?: ProjectObjectProjectNode }, transactionId?: string): Promise<void>

Set the parent of a given ProjectNodeSchema

Returns Promise<void>.

parent optional : ProjectObjectProjectNode

transactionId optional : string

spawn

spawn(transactionId?: string): Promise<ProjectObjectProjectNode>

Spawn a new blank project object

Returns: The ID of a ProjectNode.

Returns Promise<ProjectObjectProjectNode>.

transactionId optional : string

toScene

toScene(args: { node: ProjectObjectProjectNode }, transactionId?: string): Promise<SceneNode | undefined>

Finds the current scene node associated with a project node.

Returns Promise<SceneNode | undefined>.

transactionId optional : string

ProjectArrow

A 3D Arrow.

length : number

Length of the arrow

ProjectAttributeBasedAppearance

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

attribute : string

Name of the attribute driving the color.

ramp optional : string

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

range optional : ProjectObjectProjectAttributeRange

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

ProjectAttributeRange

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

max : number

Value mapped to the end of the ramp.

min : number

Value mapped to the start of the ramp.

ProjectBlockModel

A point cloud representation.

appearance optional : ProjectObjectProjectBlockModelAppearance

How the point cloud is drawn.

data : RemoteHandle

Handle of the stored model, as a hyphenated UUID.

ProjectBlockModelAppearance

type ProjectObjectProjectBlockModelAppearance = { kind: "matCap"; value: ProjectObjectProjectBlockModelMatCap } | { kind: "color"; value: ProjectObjectProjectBlockModelColor } | { kind: "attributeRamp"; value: ProjectObjectProjectBlockModelAttributeRamp } | { kind: "gradient"; value: ProjectObjectProjectBlockModelGradient }

How a point cloud is drawn.

ProjectBlockModelAttributeRamp

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

appearance optional : ProjectObjectProjectAttributeBasedAppearance

Which attribute drives the color and over what range.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

outline : boolean

Whether block edges are outlined.

ProjectBlockModelColor

Point cloud drawn in one flat color.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

outline : boolean

Whether block edges are outlined.

rgb : ColorColorRgb

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

ProjectBlockModelGradient

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

axis : MathVec3

Direction the ramp runs along.

extents : ProjectObjectProjectGradientExtentsKind

Which bounds the ramp is stretched across.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

outline : boolean

Whether block edges are outlined.

ramp : string

Name of the color ramp.

ProjectBlockModelMatCap

Point cloud shaded with a named matcap texture.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

name : string

Name of the matcap texture.

opacity optional : number

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

outline : boolean

Whether block edges are outlined.

ProjectCapsule

A 3D Capsule.

length : number

The length of the capsule, minus the caps.

radius : number

The radius of the Semi-Sphere.

ProjectCube

A 3D Cube.

halfExtents : number

The half-extents of the Cube.

ProjectGeometry

type ProjectObjectProjectGeometry = { kind: "sphere"; value: ProjectObjectProjectSphere } | { kind: "cube"; value: ProjectObjectProjectCube } | { kind: "arrow"; value: ProjectObjectProjectArrow } | { kind: "capsule"; value: ProjectObjectProjectCapsule }

ProjectGradientExtentsKind

Enum

Whether a gradient spans the object or the whole scene.

Global = 1

Stretch the ramp across the whole scene’s extents.

Local = 0

Stretch the ramp across the node’s own extents.

ProjectLineDash

gapScale : number

Gap length in multiples of the line width.

lineScale : number

Dash length in multiples of the line width.

ProjectLineJoin

type ProjectObjectProjectLineJoin = { kind: "none" } | { kind: "miter" } | { kind: "bevel" } | { kind: "round"; value: ProjectObjectProjectLineRound }

ProjectLineRound

resolution : number

ProjectLineStyle

type ProjectObjectProjectLineStyle = { kind: "solid" } | { kind: "dotted" } | { kind: "dashed"; value: ProjectObjectProjectLineDash }

ProjectMesh

A point cloud representation.

appearance optional : ProjectObjectProjectMeshAppearance

How the point cloud is drawn.

data : RemoteHandle

Handle of the stored model, as a hyphenated UUID.

ProjectMeshAppearance

type ProjectObjectProjectMeshAppearance = { kind: "matCap"; value: ProjectObjectProjectMeshMatCap } | { kind: "color"; value: ProjectObjectProjectMeshColor } | { kind: "attributeRamp"; value: ProjectObjectProjectMeshAttributeRamp } | { kind: "gradient"; value: ProjectObjectProjectMeshGradient }

How a point cloud is drawn.

ProjectMeshAttributeRamp

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

appearance optional : ProjectObjectProjectAttributeBasedAppearance

Which attribute drives the color and over what range.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

ProjectMeshColor

Point cloud drawn in one flat color.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

rgb : ColorColorRgb

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

ProjectMeshGradient

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

axis : MathVec3

Direction the ramp runs along.

extents : ProjectObjectProjectGradientExtentsKind

Which bounds the ramp is stretched across.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

ramp : string

Name of the color ramp.

ProjectMeshMatCap

Point cloud shaded with a named matcap texture.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

name : string

Name of the matcap texture.

opacity optional : number

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

ProjectName

A name for a ProjectNode.

name : string

The human-readable node name.

ProjectNoFilter

Filter that draws every element.

ProjectNode

The ID of a ProjectNode.

uuid : string

The identifier as a hyphenated UUID string.

ProjectPointCloud

A point cloud representation.

appearance optional : ProjectObjectProjectPointCloudAppearance

How the point cloud is drawn.

data : RemoteHandle

Handle of the stored model, as a hyphenated UUID.

ProjectPointCloudAppearance

type ProjectObjectProjectPointCloudAppearance = { kind: "matCap"; value: ProjectObjectProjectPointCloudMatCap } | { kind: "color"; value: ProjectObjectProjectPointCloudColor } | { kind: "attributeRamp"; value: ProjectObjectProjectPointCloudAttributeRamp } | { kind: "gradient"; value: ProjectObjectProjectPointCloudGradient }

How a point cloud is drawn.

ProjectPointCloudAttributeRamp

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

appearance optional : ProjectObjectProjectAttributeBasedAppearance

Which attribute drives the color and over what range.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

pointSize : number

Diameter of a drawn point in world units.

ProjectPointCloudColor

Point cloud drawn in one flat color.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

pointSize : number

Diameter of a drawn point in world units.

rgb : ColorColorRgb

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

ProjectPointCloudGradient

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

axis : MathVec3

Direction the ramp runs along.

extents : ProjectObjectProjectGradientExtentsKind

Which bounds the ramp is stretched across.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

opacity optional : number

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

pointSize : number

Diameter of a drawn point in world units.

ramp : string

Name of the color ramp.

ProjectPointCloudMatCap

Point cloud shaded with a named matcap texture.

filter optional : ProjectObjectProjectVolumetricFilter

Which points are drawn.

name : string

Name of the matcap texture.

opacity optional : number

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

pointSize : number

Diameter of a drawn point in world units.

ProjectPolyline

vertices optional : Array<MathVec3>

ProjectPolylineAppearance

color optional : ColorColorRgba

depthBias optional : number

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

fillColor optional : ColorColorRgba

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

lineJoin optional : ProjectObjectProjectLineJoin

linePerspective optional : boolean

Whether stroke width decreases with distance. The default is false.

lineStyle optional : ProjectObjectProjectLineStyle

lineWidth optional : number

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

ProjectShape

appearance : ProjectObjectProjectShapeAppearance

The appearance of the shape

geometry : ProjectObjectProjectGeometry

The shape geometry

ProjectShapeAppearance

How a shape is drawn.

color optional : ColorColorRgba

The color of the shape.

depthBias optional : number

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

lineJoin optional : ProjectObjectProjectLineJoin

linePerspective optional : boolean

Whether wireframe width decreases with distance. The default is false.

lineStyle optional : ProjectObjectProjectLineStyle

lineWidth optional : number

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

wireframe : boolean

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

ProjectSphere

A 3D Sphere.

radius : number

The radius of the Sphere.

ProjectTransform

Where an object sits, how it is turned, and its scale. All parts are double precision.

rotation : MathQuat

Rotation as an [x, y, z, w] quaternion. All four zero reads as the identity rotation.

scale : MathVec3

World-space scale.

translation : MathVec3

Position in the parent nodes object space, or world-space if a root node.

ProjectValueRangeFilter

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

attribute : string

Name of the attribute being tested.

max : number

Inclusive upper bound.

min : number

Inclusive lower bound.

ProjectVisibility

Whether an object is drawn.

kind : ProjectObjectProjectVisibilityKind

The VisibilityKind as an i32 kind.

ProjectVisibilityKind

Enum

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

Hidden = 2

Force the node hidden.

Inherited = 0

Inherit visibility from the parent node.

Visible = 1

Force the node visible.

ProjectVolumetricFilter

type ProjectObjectProjectVolumetricFilter = { kind: "none"; value: ProjectObjectProjectNoFilter } | { kind: "valueRange"; value: ProjectObjectProjectValueRangeFilter }

Which elements of a model are drawn.