gs.options.ViewerOptions 选项#
- class genesis.options.ViewerOptions(*, res: tuple[typing.Annotated[int, BeforeValidator(func=<function _coerce_int at 0x78c81d8ed360>, 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 0x78c81d8ed360>, 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, realtime_factor: float | None = 1.0, 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, max_FPS: int | None = None)[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 rate (in frames per second) at which the viewer repaints on screen, and the framerate the recorded video is encoded at. Independent of the physics timestep.
realtime_factor (float | None) – When the viewer is shown, the simulation is paced to this multiple of wall-clock real time (1.0 is real time, 2.0 is twice as fast), falling behind gracefully when it cannot keep up. Set to None to run as fast as possible. Has no effect without a viewer. Defaults to 1.0.
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.
gs.options.ViewerOptions 提供了用于配置查看器的选项。此类包含了多种属性,可以用来定制查看器的行为和外观。