viewport
Camera controls and viewport settings.
5 functions / 0 types
Modules
Index
| Function | Description |
|---|---|
| get_exposure | The exposure one viewport camera draws at, as an EV100. |
| get_skybox_visible | Read whether a viewport shows the scene’s skybox. |
| set_exposure | Set how much light viewport cameras let in, as an EV100. |
| set_skybox_visible | Show or hide the scene’s skybox in a viewport. A viewport never set shows it. |
| set_view_cube_model | Set a custom glTF binary model for the view cube in every viewport. |
get_exposure
def get_exposure(
*,
viewport: str | None = None,
_transaction_id: str | None = None
) -> floatThe exposure one viewport camera draws at, as an EV100.
Reads the exposure reached so far while a change eases. A camera never given an exposure reads as 9.7, the exposure it draws at.
Fails unless exactly one viewport camera matches viewport.
Returns float.
viewport optional : str | None
Label of the viewport to read. Absent, the only viewport is read. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_skybox_visible
def get_skybox_visible(
*,
viewport: str | None = None,
_transaction_id: str | None = None
) -> boolRead whether a viewport shows the scene’s skybox.
Fails with InvalidArgument unless exactly one viewport matches viewport.
Returns bool.
viewport optional : str | None
Label of the viewport to read. Absent, the only viewport. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_exposure
def set_exposure(
*,
ev100: float,
viewport: str | None = None,
duration_seconds: float | None = None,
_transaction_id: str | None = None
) -> NoneSet how much light viewport cameras let in, as an EV100.
Acts on every viewport camera whose label is viewport, or on all of them when it is absent.
Lower is brighter, and each step of one halves or doubles the light let in. A scene lit by
sunlight in lux suits about 14. A camera never given an exposure draws at 9.7.
Fails without changing anything when ev100 is not a finite number.
Returns None.
ev100 : float
The exposure as an EV100.
viewport optional : str | None
Label of the viewports to change. Absent, every viewport changes. Defaults to None.
duration_seconds optional : float | None
Seconds to ease from the current exposure to ev100, in even steps of EV100 with a gentle start and end. Absent, zero, negative or non-finite sets it at once. A new call stops an easing in progress and starts from the exposure that easing had reached. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_skybox_visible
def set_skybox_visible(
*,
viewport: str | None = None,
visible: bool,
_transaction_id: str | None = None
) -> NoneShow or hide the scene’s skybox in a viewport. A viewport never set shows it.
Fails with InvalidArgument when no viewport matches viewport.
Returns None.
viewport optional : str | None
Label of the viewports to change. Absent, every viewport. Defaults to None.
visible : bool
Show the skybox, or draw black behind the scene.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_view_cube_model
def set_view_cube_model(*, model: str | None = None, _transaction_id: str | None = None) -> NoneSet a custom glTF binary model for the view cube in every viewport.
Node names define camera targets: face_+x for a face, edge_+x+y for an edge, and
corner_+x+y+z for a corner. Nodes with other names are visible but do not respond to clicks.
The model is rendered unlit.
Returns None.
model optional : str | None
Base64-encoded glTF binary. Omit to restore the built-in cube. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.