Sandbox — LSD is in active testing. All systems operational·payments are test-mode (no real charges).
Overview Use Cases News Docs Tool Store Support Community Get LSD
All docs
Context· property

Context.viewer

the 3d/2d viewer surface, if a viewer is open

Python
viewer: Viewer

Returns Viewer — the viewer surface, or None

Example#

Python
@tool.command("demo/frame")
def frame(ctx: Context):
    if ctx.viewer:
        ctx.viewer.fit()

Notes#

A lazily populated slot — None when no viewer is available. Use it to drive the camera, layers, and drawing on the open viewer.

See also#

API: ui · panel · Context

Guides: Commands & actions

By LSD Team · Last updated Jul 17, 2026 Ask on Discord View as Markdown