Skip to content

Scene Atmosphere MCP ​

Use the full Editor MCP for permanent changes to the currently loaded atmosphere. Read docs/guides/AtmosphereLightGroup.md for the field meanings and detailed examples.

Resolve the Target ​

  • Call editor_get_context; use the existing Editor process and wait for lifecycle operations to finish before editing.
  • Call terrain_get_atmosphere and confirm current_scene_path and atmosphere.lightgroup_path. Do not assume the scene uses default.lightgroup.
  • An empty path with storage=embedded_in_map means the atmosphere is stored in map.acmap. Saving an external .lightgroup affects every scene that subsequently loads that shared asset. Use a separate atmosphere copy for disposable tests.
  • These tools edit the active Zone and main Light. Creating, copying, selecting or deleting presets belongs to the editor atmosphere panel. Additional point/spot lights use terrain_query_lights and the separate light editing tools.

Discover and Patch ​

The query returns attribute maps under atmosphere.zone and atmosphere.main_light. Each entry has type, value and editable; enums have options, and resources have resource_type. Use the exact returned names and only patch editable fields. The available fields come from the current component metadata, so do not invent a fixed universal attribute list. Buffer fields such as spherical harmonics are read-only; the main Light remains Directional.

Pass a partial zone / main_light map. Use JSON bool/number/string values, enum option strings, vector component arrays, and Color arrays in normalized RGBA order. Resource values are existing logical paths, not absolute filesystem paths; an empty string clears a resource. Use main_light_rotation: [x,y,z] for local Euler angles in degrees.

For example, first query and then preview a small mood change:

json
{
  "zone": {"Fog Color": [0.08, 0.14, 0.28, 1], "Depth Fog Enable": true, "Depth Fog Density": 1.15},
  "main_light": {"Brightness Multiplier": 2.4},
  "main_light_rotation": [25, 0, 140]
}

Send this patch to terrain_preview_atmosphere_edit, inspect patch_plan, then send the same patch and its preview_token or preview_hash to terrain_apply_atmosphere_edit. A stale preview must be queried and previewed again. Inspector changes to atmosphere values invalidate the token even without a new history entry. Automated callers may use skip_preview=true only with the current history_state_id as expected_state_id.

Raw native setters may constrain values. Inspect the actual atmosphere returned by Apply and query again; do not assume the requested number is exactly what was stored. Depth Fog AutoCompute can override manual distances, and Use Temperature or weather controls can affect the visible main light color.

Persist and Verify ​

Apply changes memory and creates one terrain.atmosphere_edit transaction. A no-op creates none. Use terrain_list_history and terrain_get_state to check it. terrain_undo / terrain_redo use expected_state_id from the latest state. Preview, Apply and history operations do not write the atmosphere file or start a bake; the MCP change skips the legacy panel's next autosave notification.

For discrete tile terrain, call terrain_save_scene. For other terrain backends, use normal editor scene save. Saving writes the referenced .lightgroup, or the embedded atmosphere in map.acmap. Reload with editor_reload_scene, wait with editor_lifecycle_wait, and query again. Check the rendered scene in the foreground; numeric readback alone does not prove the requested mood is visible.

If tools are absent, use the editor atmosphere panel or narrowly edit the offline XML while preserving unrelated data. Avoid writing XML behind an open scene, which may later overwrite it from memory. Temporary gameplay weather/lighting uses Scene.TryGetWeatherController() / Scene.TryGetLightingController() and does not persist this file; see sce-scene-environment.