Scene Handles#

A handle is created for each object that is added to the scene. These can be used to read and set state, as well as detect clicks.

When a scene node is added to a server (for example, via viser.ViserServer.add_frame()), state is synchronized between all connected clients. When a scene node is added to a client (for example, via viser.ClientHandle.add_frame()), state is local to a specific client.

class viser.SceneNodeHandle[source]#

Handle base class for interacting with scene nodes.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

remove() None[source]#

Remove the node from the scene.

Return type:

None

class viser.CameraFrustumHandle[source]#

Handle for camera frustums.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.FrameHandle[source]#

Handle for coordinate frames.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.BatchedAxesHandle[source]#

Handle for batched coordinate frames.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.GlbHandle[source]#

Handle for GLB objects.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.Gui3dContainerHandle[source]#

Use as a context to place GUI elements into a 3D GUI container.

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None[source]#

Permanently remove this GUI container from the visualizer.

Return type:

None

class viser.ImageHandle[source]#

Handle for 2D images, rendered in 3D.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.LabelHandle[source]#

Handle for 2D label objects. Does not support click events.

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.MeshHandle[source]#

Handle for mesh objects.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.MeshSkinnedHandle[source]#

Handle for skinned mesh objects.

bones: tuple[MeshSkinnedBoneHandle, ...]#

Bones of the skinned mesh. These handles can be used for reading and writing poses, which are defined relative to the mesh root.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.MeshSkinnedBoneHandle[source]#

Handle for reading and writing the poses of bones in a skinned mesh.

property wxyz: ndarray#

Orientation of the bone. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

property position: ndarray#

Position of the bone. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.PointCloudHandle[source]#

Handle for point clouds. Does not support click events.

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

class viser.TransformControlsHandle[source]#

Handle for interacting with transform control gizmos.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

property update_timestamp: float#
on_update(func: Callable[[TransformControlsHandle], None]) Callable[[TransformControlsHandle], None][source]#

Attach a callback for when the gizmo is moved.

Parameters:

func (Callable[[TransformControlsHandle], None]) –

Return type:

Callable[[TransformControlsHandle], None]

class viser.GaussianSplatHandle[source]#

Handle for Gaussian splatting objects.

Work-in-progress. Gaussian rendering is still under development.

on_click(func: Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]) Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]#

Attach a callback for when a scene node is clicked.

Parameters:
Return type:

Callable[[SceneNodePointerEvent[TSceneNodeHandle]], None]

property position: ndarray#

Position of the scene node. This is equivalent to the t in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.

remove() None#

Remove the node from the scene.

Return type:

None

property visible: bool#

Whether the scene node is visible or not. Synchronized to clients automatically when assigned.

property wxyz: ndarray#

Orientation of the scene node. This is the quaternion representation of the R in p_parent = [R | t] p_local. Synchronized to clients automatically when assigned.