Dolly View
tb.ops.viewport.dolly(*, factor: float) -> Result
Move the camera along its view direction: a factor above 1 moves away (2 doubles the distance), below 1 moves closer. Orthographic views zoom by the same factor.
Exit Isolate
tb.ops.viewport.exit_isolate() -> Result
Leave Isolate Selected in this editor's viewport, like Alt+Q (a no-op when not isolating).
Frame Viewport
tb.ops.viewport.frame(
*,
all: bool = False,
nodes: Sequence[ObjectRef] = ...,
padding: float = ...,
) -> Result
Frame the active viewport's selection (F), the named objects, or every visible object with all = true (A), keeping the view angle. padding scales the space around them (1.5 = the standard F padding). Requires a mounted 3D viewport; a successful call queues the scoped request rather than reporting camera completion.
Get Viewport Camera
tb.ops.viewport.get_camera() -> Result
The view camera as last drawn: position, target and up (metres), distance, whether it is orthographic (after queued changes) and its visible height, and the viewport's screen rect and center in points. viewport.set_camera takes the same pose back.
Isolate Selected
tb.ops.viewport.isolate(*, nodes: Sequence[ObjectRef] = ...) -> Result
Show only the given objects' meshes (default: the selection; groups isolate their meshes) in this editor's viewport, like Shift+I. View state: the document and history are unchanged; viewport.exit_isolate shows everything again.
Orbit View
tb.ops.viewport.orbit(*, yaw: float = 0.0, pitch: float = 0.0) -> Result
Orbit the camera around its target: positive yaw turns the view left around the world up axis, positive pitch tilts it up. An orthographic view stays orthographic.
Pan View
tb.ops.viewport.pan(*, dx: float = 0.0, dy: float = 0.0) -> Result
Pan the view as if the pan button dragged it by (dx, dy) screen points: the scene follows the drag.
Pick At
tb.ops.viewport.pick_at(*, x: float, y: float) -> Result
The nearest visible, unlocked object under screen point (x, y) of the caller's 3D viewport, in points like the rect viewport.get_camera reports: node, name, world point and normal, distance and triangle, or null on a miss. Uses what the viewport last drew and refuses while it is behind the document or when there is no 3D viewport (use scene.ray_cast there).
Preview Camera
tb.ops.viewport.preview_camera(
*,
mode: Literal["free", "face", "firstPerson"],
) -> Result
Preview the animation through a character camera: face (a perspective view that follows the head, orbit and dolly still work around it), firstPerson (the view from the character's eyes, turning with the head, as a game's first-person camera) or free (ordinary navigation). The character's head joint is found by name.
Reset View
tb.ops.viewport.reset_view() -> Result
Return to the default perspective view: (5, 5, 5) grid units looking at the origin.
Set Viewport Camera
tb.ops.viewport.set_camera(
*,
position: Vec3Like,
target: Vec3Like,
up: Vec3Like = ...,
ortho_height: float = ...,
) -> Result
Put the view camera exactly at a pose viewport.get_camera reported: position and target in metres, optional up (default +Y) and, for an orthographic view, orthoHeight (the visible height in metres). Restores a saved view, e.g. between screenshots.
Set Orthographic
tb.ops.viewport.set_ortho(*, ortho: bool) -> Result
Switch the view to orthographic (true) or perspective (false), keeping the pose and the apparent size at the target.
Set View
tb.ops.viewport.set_view(
*,
view: Literal["persp", "top", "bottom", "front", "back", "right", "left"],
) -> Result
Look at the target from a named view at the current distance: persp is the default perspective direction, the axis views are orthographic.
Toggle Ortho View
tb.ops.viewport.toggle_ortho() -> Result
Switch between perspective and orthographic projection. Repeated calls alternate in order.