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 Ocean, Time, and Weather. Access the various components via world.env.<component>.

property time_of_day: Time

The current time of day in the world.

property weather: Weather

The current weather in the world.

property ocean: Ocean

The ocean in the world. Only available for worlds with an ocean.

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.

apply_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.

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.

execute(frame_id: int | None = None, frame_max: int | None = None, delta_seconds: float | None = None) None

Updates the environment preset to the specified frame.

Parameters:
  • frame_id (int | None, optional) – The frame ID. Defaults to None.

  • frame_max (int | None, optional) – Max frame count in the current loop. Defaults to None.

  • delta_seconds (float | None, optional) – The target real-time in seconds between frames. This is used to calculate physical displacement for certain assets. Defaults to None.