bbi.environment.environment¶
- pydantic model EnvironmentUpdateParam¶
Bases:
AnimationFrame- field preset_id: str | None = None¶
- field with_variations: bool | None = None¶
- class Environment¶
Bases:
Node,Animatable[EnvironmentUpdateParam]Central class for controlling the environmental conditions in the world.
The Environment class serves as a container and manager for various environmental conditions, such as the
OceanandWeather. Access the various components viaworld.env.<component>.- property preset_id: str | None¶
- property rand_preset_ids: list[str]¶
- property with_variations: bool¶
- has_ocean() bool¶
Checks if the world has an ocean.
- has_weather() bool¶
Checks if the world has weather.
- get_preset_names() list[str]¶
Get the names of all available environment preset.
- set_preset(preset_name: str, with_variations: bool = False) None¶
Apply an environment preset profile to the world.
- Parameters:
preset_name (str) – The name of the environment preset profile to apply.
with_variations (bool, optional) – Whether to apply predefined variations to the environment properties. Variations will be within preset-specific boundaries that maintain the overall aesthetic of the preset. Defaults to False.
- apply_preset(preset_name: str, with_variations: bool = False) None¶
DEPRECATED: Use set_preset instead.
Apply an environment preset profile to the world.
- Parameters:
preset_name (str) – The name of the environment preset profile to apply.
with_variations (bool, optional) – Whether to apply predefined variations to the environment properties. Variations will be within preset-specific boundaries that maintain the overall aesthetic of the preset. Defaults to False.
- configure_preset_randomization(preset_names: list[str], with_variations: bool = True) None¶
Set a list of environment presets that would be randomly applied during scenario execution.
Note that keyframed presets take precedence over randomized presets.
- Parameters:
preset_names (list[str]) – The names of the environment presets to be randomly applied.
with_variations (bool, optional) – Whether to apply predefined variations to the environment properties. Variations will be within preset-specific boundaries to maintain the overall aesthetic of the preset. Defaults to True.
- get_assigned_preset_at_frame(frame_id: int, total_frames: int) str | None¶
Get the assigned preset at a specific frame.
- Parameters:
frame_id (int) – Index of the frame.
total_frames (int) – Total number of frames.
- execute(frame_id: int, frame_max: int, delta_seconds: float) None¶
Updates the environment preset to the specified frame.
- Parameters:
frame_id (int) – The frame ID.
frame_max (int) – Max frame count in the current loop.
delta_seconds (float) – The target real-time in seconds between frames. This is used to calculate physical displacement for certain assets.