bbi.environment.weather

pydantic model WeatherUpdateParam

Bases: AnimationFrame

field cloud_coverage: Annotated[float, Field(ge=0)] | None = None
field cloud_drift: float | None = None
field fog_distance: float | None = None
field fog_intensity: float | None = None
field fog_max_opacity: float | None = None
field rain_intensity: float | None = None
field rain_screen_droplets: ScreenDropletsPreset | None = None
field rain_screen_droplets_blur: Annotated[int, Field(ge=0, le=10)] | None = None
field rain_screen_droplets_density: Annotated[float, Field(ge=0, le=10)] | None = None
field rain_screen_droplets_seed: int | None = None
field rain_screen_droplets_speed: Annotated[float, Field(ge=0, le=10)] | None = None
field sky_atmosphere_contribution_color_scale: Color | None = None
field sun_azimuth: float | None = None
field sun_elevation: float | None = None
field sun_intensity: float | None = None
class Weather(env_preset: EnvironmentProfile)

Bases: Node, Animatable[WeatherUpdateParam]

Class for controlling the weather conditions.

The World has a default weather accessible via world.env.weather.

property sun_intensity: float
property sun_elevation: float
property sun_azimuth: float
property cloud_coverage: float
property cloud_drift: float
property fog_intensity: float
property fog_distance: float
property sky_atmosphere_contribution_color_scale: Color
property fog_max_opacity: float
property rain_intensity: float
property rain_screen_droplets_blur: int
property rain_screen_droplets_density: float
property rain_screen_droplets_speed: float
property rain_screen_droplets_seed: int
property rain_screen_droplets: ScreenDropletsPreset
set_sun_intensity(intensity: float) None

Set the intensity of the sun.

The initial sun intensity value is 5.0.

Parameters:

intensity (float) – The intensity of the sun from 0 to 10.

set_sun_elevation(elevation: float) None

Set the elevation angle, the vertical angle between the sun and the horizon.

Parameters:

elevation (float) – The elevation angle of the sun in degrees.

set_sun_azimuth(azimuth: float) None

Set the azimuth angle, the horizontal angle between the sun and the north direction.

The default camera has a yaw value of 0. Thus, when the sun azimuth is:
  • 0, the sun is behind the camera

  • 90, the sun is to the left of the camera

  • 180, the sun is in front of the camera

  • 270, the sun is to the right of the camera

Parameters:

azimuth (float) – The azimuth angle of the sun in degrees.

set_cloud_coverage(coverage: float) None

Set the cloud coverage of the weather.

Parameters:

coverage (float) – The cloud coverage.

set_cloud_drift(drift: float) None

Set the cloud drift of the weather. Represents a time offset for the clouds. Good for getting a good formation

Parameters:

drift (float) – The cloud drift.

set_fog_intensity(intensity: float) None

Set the fog intensity.

Parameters:

intensity (float) – The fog intensity.

set_fog_distance(distance: float) None

Set the distance from the camera where fog starts (the maximum visibile range without fog) in meters.

Parameters:

distance (float) – The distance from camera where for starts, in meters.

set_fog_sky_atmosphere_contribution_color_scale(color: Color) None

Set the color scale of the sky atmosphere contribution.

Parameters:

color (Vector4) – The color scale of the sky atmosphere contribution.

set_fog_max_opacity(opacity: float) None

Set the maximum opacity of the fog.

Parameters:

opacity (float) – The maximum opacity of the fog.

set_rain_intensity(intensity: float) None

Set the intensity of the rain.

Parameters:

intensity (float) – The intensity of the rain.

set_rain_screen_droplets_blur(blur: int) None

Set the blur intensity of droplets on the screen.

Parameters:

blur (int) – The intensity of the blur effect. A value of 0 will default to streaking raindrops. Must be between 0 and 10.

set_rain_screen_droplets_density(density: float) None

Set the density of blurry droplets on the screen.

Parameters:

density (float) – The number of droplets that appear on the screen. Must be between 0 and 10.

set_rain_screen_droplets_speed(speed: float) None

Set the speed of blurry droplets on the screen.

Parameters:

speed (float) – How quickly the droplets move across the screen. Must be between 0 and 10.

set_rain_screen_droplets_seed(seed: int) None

Specify a seed for the rain screen droplets pattern.

Parameters:

seed (int) – The seed value.

set_rain_screen_droplets(screen_droplets: ScreenDropletsPreset) None

Set the visibility of rain droplets on the camera lens.

Parameters:

screen_droplets (ScreenDropletsPreset) – The type of rain droplets effect on the camera lens.

get_max_warmup_frames() int

Return the maximum number of warm-up frames for rendering, given the current weather settings.

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

Updates the weather conditions 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.