Skip to content

EnvironmentTool ​

Inherits: RefCounted

The Environment button of the 3D toolbar, shown while a world scene is open: it puts the sun, the sky and the environment of the world into the scene as temporary nodes (EnvironmentPreview: not saved, gone when the button is pressed again) so that the viewport shows what the game shows, with a bar (EnvironmentBar) to try other configs, the hour of the day and the video settings of the project, and to make what is shown the configs of the world.

Variables ​

EditorPluginplugin
boolis_activefalse
Nodeworld_scenenull
Buttonbuttonnull
EnvironmentPreviewpreviewnull
EnvironmentBarbarnull

Methods ​

voidactivate()
voiddeactivate()
boolis_showing()
voidstart()
voidstop()
Dictionaryworld_configs()
Dictionaryzone_configs( zone_id: int )
booluse_for_zone( zone_id: int, sky: SkyConfig, environment: EnvironmentConfig )
booluse_for_world( sun: SunConfig, sky: SkyConfig, environment: EnvironmentConfig )

Variable descriptions ​

EditorPlugin plugin ​

No description yet.

bool is_active = false ​

No description yet.

Node world_scene = null ​

No description yet.

Button button = null ​

No description yet.

EnvironmentPreview preview = null ​

No description yet.

EnvironmentBar bar = null ​

No description yet.

Method descriptions ​

void activate() ​

No description yet.

void deactivate() ​

No description yet.

bool is_showing() ​

No description yet.

void start() ​

Puts the preview into the scene and the bar over the viewport

void stop() ​

Takes the preview and the bar away

Dictionary world_configs() ​

The configs the open world has by itself: its overrides, else the defaults of the project. {"time", "sun", "sky", "environment"}

Dictionary zone_configs( zone_id: int ) ​

The configs of a place for the preview: the world's sun path, and the sky and environment the zone has (its own, or from the zone above), else the world's. Zone 0 is the world itself.

bool use_for_zone( zone_id: int, sky: SkyConfig, environment: EnvironmentConfig ) ​

Gives a zone the sky and the environment that are shown (the ones it would take without its own are stored as none: the zone follows them when they change). Returns false when nothing was saved

bool use_for_world( sun: SunConfig, sky: SkyConfig, environment: EnvironmentConfig ) ​

Makes the shown configs the ones of the world (the default one is no override). The world data is saved