gs.options.ViewerOptions#
- class genesis.options.ViewerOptions(*, res: tuple[typing.Annotated[int, BeforeValidator(func=<function _coerce_int at 0x73fbdcd20ea0>, json_schema_input_type=PydanticUndefined), FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)]), FieldInfo(annotation=NoneType, required=True, metadata=[Gt(gt=0)])], typing.Annotated[int, BeforeValidator(func=<function _coerce_int at 0x73fbdcd20ea0>, json_schema_input_type=PydanticUndefined), FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)]), FieldInfo(annotation=NoneType, required=True, metadata=[Gt(gt=0)])]] | None = None, run_in_thread: bool | None = None, refresh_rate: int = 60, max_FPS: int | None = 60, camera_pos: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] = (3.5, 0.5, 2.5), camera_lookat: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] = (0.0, 0.0, 0.5), camera_up: tuple[typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])], typing.Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=False), _PydanticGeneralMetadata(allow_inf_nan=False)])]] = (0.0, 0.0, 1.0), camera_fov: float = 40, enable_help_text: bool = True, enable_default_keybinds: bool = True, enable_gui: bool = False)[source]#
Bases:
OptionsOptions configuring preperties of the interactive viewer.
Note
The viewer’s camera uses the Rasterizer backend regardless of gs.renderers.* when creating the scene.
- Parameters:
res (tuple, shape (2,), optional) – The resolution of the viewer. If not set, will auto-compute using resolution of the connected display.
run_in_thread (bool) – Whether to run the viewer in a background thread. This option is not supported on MacOS. True by default if available.
refresh_rate (int) – The refresh rate of the viewer.
max_FPS (int | None) – The FPS (frames per second) the viewer will be capped at. Note that this will also synchronize the simulation speed. If not set, the viewer will render at maximum speed.
camera_pos (tuple of float, shape (3,)) – The position of the viewer’s camera.
camera_lookat (tuple of float, shape (3,)) – The lookat position that the camera.
camera_up (tuple of float, shape (3,)) – The up vector of the camera’s extrinsic pose.
camera_fov (float) – The field of view (in degrees) of the camera.
enable_help_text (bool) – Whether to enable the rendering of instructions text in the viewer.
enable_default_keybinds (bool) – Whether to enable the default keyboard controls in the viewer.
enable_gui (bool) – Whether to automatically attach the ImGui overlay panel when the viewer is constructed. Defaults to False. The overlay renders its own controls and captures keyboard input, so it requires enable_help_text and enable_default_keybinds to be False; they default to False when enable_gui is True, and explicitly setting either to True alongside enable_gui raises an error. Scene editing controls (Rebuild Scene, Add Entity, per-entity remove) are visible but disabled unless the scene is managed by a gs.InteractiveScene that supports them.