---
title: "Bake and wire a pyro effect: spatial-compiler bake, check, sweep and wire"
description: "The spatial-compiler commands for pyro: check a spec, bake at draft or final quality, sweep variants, then wire the bake into Godot 4 with the six-way shader."
canonical: https://appliedmanifold.com/docs/pyro/bake-and-wire/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [Docs](https://appliedmanifold.com/docs/)
3.  [Pyro](https://appliedmanifold.com/docs/pyro/)
4.  Bake and wire

DOCS // PYRO 0.4.1

# Bake and wire

Run `spatial-compiler bake <name>.pyro.toml --out <dir>` to bake, then `spatial-compiler wire <dir> --scene <path>.tscn` to write a Godot 4 scene with the six-way shader. `check`, `schema` and `sweep` support the loop.

## Bake, then wire

Bake a spec into a folder, then wire the bake into a Godot 4 scene. The scene must sit inside a Godot project, so put the bake folder inside the project first.

terminal

```
spatial-compiler bake <name>.pyro.toml --out <dir>
spatial-compiler wire <dir> --scene <path>.tscn
```

`wire` installs the six-way shader `flipbook_6way.gdshader` and `pyro_sheet.gd` in the project and writes texture import settings. It also writes a scene whose root is a quad sized in meters, with its origin on the ground under the effect. The scene plays on its own, or you can set `autoplay = false` and drive `time_s` from the sim clock. `--set node=particles` writes a `GPUParticles3D` instead, for many copies.

## Commands

**`spatial-compiler schema`**
Prints every field, range, default, warning and metric as JSON. When the docs and the tool disagree, trust `schema`.

**`spatial-compiler check <spec>`**
Validates a spec without touching the GPU. Each error names the key and the nearest valid key or the range.

**`spatial-compiler bake <spec> --out <dir> [--quality draft|final] [--seed n] [--set k=v]`**
Bakes the spec. Draft doubles the cell size, so it is softer and carries the expected warning `GRID_REDUCED`.

**`spatial-compiler sweep <spec> --set key=v1,v2 --out <dir>`**
Bakes variants at draft quality onto one labelled comparison sheet, `sweep_sheet.png`, at most 16 variants.

**`spatial-compiler version`**
Prints the version.

`--set section.key=value` overrides one field. For `[[emitters]]` and `[[views]]`, `emitters.fuel=3` sets every row and `emitters.0.fuel=3` sets the first.

Exit codes are 0 for done, 1 for an invalid spec or arguments, 2 for a GPU failure and 3 for a file error.

## The loop

1.  Copy the nearest [example](https://appliedmanifold.com/docs/pyro/examples/) and run `spatial-compiler check` on it.
2.  Bake at draft quality and read `warnings`; change the key each `fix.hint` names.
3.  Open `preview_strip.png` and judge the look.
4.  Use `sweep` to compare two or three values of one or two keys.
5.  Bake at final quality until the report shows `"ok": true` and no warnings, then wire it.
