bbi.environment.environment

pydantic model EnvironmentUpdateParam

Bases: AnimationFrame

field preset_id: str | 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
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) None

Apply an environment preset profile to the world.

Parameters:

preset_name (str) – The name of the environment preset profile to apply.

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.