set_world
Set a Blender scene's background and ambient lighting to a plain colour, preset, or HDRI image; control strength, rotation, camera visibility, and transparent renders.
Instructions
Set the background and ambient light: a plain colour or an HDRI image. color is '#rrggbb' or [r, g, b] (0-1).
An explicit color wins over the preset colour.
strength multiplies the light (1 is normal). With neither colour, preset nor hdri only the strength changes.
hdri lights the scene with an image and gives metal and glass something to reflect. It is a path to an .hdr or .exr
file, or the name of a studio light shipped with Blender: city, courtyard, forest, interior, night, studio, sunrise, sunset
(the answer lists them in builtin_hdris; an unknown name gives the list in the error). rotation_deg turns it about Z.
visible_to_camera=false keeps the HDRI for light and reflections, and the camera sees the plain color or preset
colour instead (without them: the colour the world had). Works in eevee and cycles.
A later call without hdri and with a colour or preset makes the world a plain colour again.
transparent=true makes the render background transparent (alpha 0) and the world only lights the scene.
The flag stays on until set_world is called again with transparent=false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hdri | No | ||
| color | No | ||
| preset | No | ||
| strength | No | ||
| transparent | No | ||
| rotation_deg | No | ||
| visible_to_camera | No |