Skip to reading
Cameras, Lighting & Rendering

52 Switch lights and glow from events

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page

Use the dedicated runtime actions when you want a switch to change visible lighting. Editing a generic stored property is not always enough to rebuild a live material or light.

Code example
await Action("ToggleLight", {"entityId":"key_light"})
await SetGlow({"entityId":"lamp", "enabled":true})
await SetSceneBrightness({"sceneId":"lab",
    "brightness":0.8})

The example is GDScript inside a run function. ToggleLight is a supported action through Action even if it is not listed by the current shared selector. SetGlow and ToggleGlow have shared action fields. Author the object’s glow before toggling it; the toggle does not invent an emission setup for an object that has none.

Source table from 52 Switch lights and glow from events, page 58
ActionUse
ToggleGlowReverse an authored object glow’s on/off state.
SetGlowChoose on or off explicitly. Use this for reliable cleanup.
ToggleRGBStringSwitch an authored decorative string.
SetSceneBrightnessChange the current or named room’s image brightness.
SetSceneTintApply a room tint with color and strength.

An on/off variable can link a switch to a light, glow or RGB string. Use the same variable intentionally and test both the initial state and returning to the room.

Page 58 of 109Permalink
Go to page