@babylonjs-toolkit/agent 1.1.14 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/package.json +1 -1
- package/persona.md +2 -0
- package/skills/bt-gauntlet/SKILL.md +48 -30
- package/skills/bt-gauntlet/references/critic-rubrics.md +2 -2
- package/skills/bt-gauntlet/references/loop-templates.md +2 -2
- package/skills/bt-gauntlet/references/spec-composition.md +2 -2
- package/skills/bt-gauntlet/references/target-images.md +6 -6
- package/skills/bt-gauntlet/references/unity-pipeline.md +480 -0
- package/skills/bt-gauntlet/references/workspace.md +6 -5
- package/skills/bt-gauntlet/references/blender-model-pipeline.md +0 -194
- package/skills/bt-gauntlet/references/unity-level-pipeline.md +0 -285
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
# Pipeline: `blender-model`
|
|
2
|
-
|
|
3
|
-
**Deliverable:** a high-fidelity model or asset authored/refined in headless Blender — geometry, UVs, PBR
|
|
4
|
-
maps, LODs, skinning, animation — delivered either as a `.glb` straight to BabylonJS, or as an FBX inside a
|
|
5
|
-
Unity project for a `unity-level` job to compose with.
|
|
6
|
-
|
|
7
|
-
> **Required reading before round 1.** Fetch and read the Agent Reference's
|
|
8
|
-
> [Blender Headless CLI Instructions](https://raw.githubusercontent.com/babylontoolkit/agent/main/references/unity-blender-cli.md)
|
|
9
|
-
> in full. Section numbers below refer to it. Builder subagents must be given it too.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 1. Decide the destination first — it changes everything downstream
|
|
14
|
-
|
|
15
|
-
| The asset needs… | Route |
|
|
16
|
-
|---|---|
|
|
17
|
-
| Interactive components (Rigidbody, Animator, AudioSource, NavMeshAgent, LODGroup …) | **Blender fixes the model → Unity composes → Toolkit exports.** Blender **cannot** write `extras.metadata.components`; those come from Unity, and only under a Pro licence. |
|
|
18
|
-
| Geometry / materials / animation only — a prop, a clip, a static mesh | **Export `.glb` straight from Blender and skip Unity entirely.** |
|
|
19
|
-
|
|
20
|
-
Record the route in `pipeline.md`. It decides where the artifact lives, how it is verified, and whether the
|
|
21
|
-
`unity-level` pipeline's licence gate applies.
|
|
22
|
-
|
|
23
|
-
## 2. Prerequisite gate — before round 1, and again on every resume
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
blender --version
|
|
27
|
-
blender -b --factory-startup --python-exit-code 1 \
|
|
28
|
-
--python-expr "import bpy; print('bpy', bpy.app.version_string)"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
| Must be true | Why |
|
|
32
|
-
|---|---|
|
|
33
|
-
| Blender resolves on PATH (or the `bpy` pip module is importable) | no builder can run |
|
|
34
|
-
| The canonical four flags are used on **every** invocation | see below |
|
|
35
|
-
| The importers/exporters you need exist **in this build** | operator names moved in 5.x — enumerate, never assume (§3) |
|
|
36
|
-
| For the Unity route: the `unity-level` prerequisite gate also passes | components and the export come from Unity |
|
|
37
|
-
|
|
38
|
-
**The canonical invocation — use all four flags every time:**
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
blender --background --factory-startup --python-exit-code 1 \
|
|
42
|
-
--python /path/to/script.py -- arg1 arg2
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
> ⚠️ **A Python exception does not fail the process.** Blender prints the traceback and exits `0`. Without
|
|
46
|
-
> `--python-exit-code 1` the loop will record a crashed round as a success and the critic will be handed
|
|
47
|
-
> stale evidence. This is the single most dangerous gotcha in this pipeline.
|
|
48
|
-
|
|
49
|
-
Introspect before relying on any operator (§7):
|
|
50
|
-
|
|
51
|
-
```python
|
|
52
|
-
print(sorted(n for n in dir(bpy.ops.export_scene) if not n.startswith('_')))
|
|
53
|
-
print(bpy.ops.export_scene.gltf.__doc__)
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### `pipeline.md` for this kind
|
|
57
|
-
|
|
58
|
-
```markdown
|
|
59
|
-
# Pipeline — blender-model
|
|
60
|
-
Route : glb-direct | via-unity
|
|
61
|
-
Blender : 5.1.2 (path: /Applications/Blender.app/Contents/MacOS/Blender)
|
|
62
|
-
Source asset : /abs/path/UnityProject/Assets/Models/character.fbx
|
|
63
|
-
Write mode : IN PLACE (GUID preserved) | NEW PATH (GUID reset — settings copied)
|
|
64
|
-
Backup : character.fbx.bak
|
|
65
|
-
Viewer page : http://localhost:8888/viewer.html?asset=character.glb
|
|
66
|
-
Viewer lighting: FIXED — hdri studio.hdr, exposure 1.0, no post (never change mid-run)
|
|
67
|
-
Tri budget : 45k · Texel density: 512 px/m
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## 3. In place vs. new file — the rule that protects the whole project
|
|
73
|
-
|
|
74
|
-
| | **Edit in place** (overwrite the FBX) | **Create a new model** (new path) |
|
|
75
|
-
|---|---|---|
|
|
76
|
-
| Unity GUID | ✅ preserved | ❌ new GUID |
|
|
77
|
-
| Existing scene / prefab references | ✅ all survive and pick up the change | ➖ referenced by nothing |
|
|
78
|
-
| Importer settings — rig, avatar, clips, scale | ✅ preserved (`.meta` untouched) | ❌ **reset to defaults** |
|
|
79
|
-
| Use for | iterating on an asset already in scenes | variants, LODs, experiments |
|
|
80
|
-
|
|
81
|
-
**A gauntlet iterates on the same asset for many rounds. That makes in-place the default, and it makes this
|
|
82
|
-
a hard loop rule:**
|
|
83
|
-
|
|
84
|
-
- **Always back up first** — the write is destructive: `cp "$FBX" "$FBX.bak"`.
|
|
85
|
-
- **Never delete-then-recreate.** Removing the file removes its `.meta`, which destroys the GUID and breaks
|
|
86
|
-
every scene and prefab that referenced it. Overwrite the bytes; leave the `.meta` alone.
|
|
87
|
-
- When a round genuinely needs a new path (an LOD, a variant), **copy the importer settings across** — Unity
|
|
88
|
-
will not (§8.3) — and record it in the round journal.
|
|
89
|
-
|
|
90
|
-
After any write, refresh Unity and confirm the GUID survived:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
unity command eval 'UnityEditor.AssetDatabase.Refresh(UnityEditor.ImportAssetOptions.ForceSynchronousImport); return "ok";' --project-path "$PROJ"
|
|
94
|
-
|
|
95
|
-
unity command eval 'string p="Assets/Models/character.fbx";
|
|
96
|
-
var i=(UnityEditor.ModelImporter)UnityEditor.AssetImporter.GetAtPath(p);
|
|
97
|
-
return UnityEditor.AssetDatabase.AssetPathToGUID(p) + " rig=" + i.animationType + " scale=" + i.globalScale;' \
|
|
98
|
-
--project-path "$PROJ"
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## 4. Part taxonomy — the default decomposition
|
|
104
|
-
|
|
105
|
-
| Part | Owns |
|
|
106
|
-
|---|---|
|
|
107
|
-
| **P1 Silhouette & proportion** | primary forms, scale against reference, readability at thumbnail size |
|
|
108
|
-
| **P2 Secondary forms** | panel breaks, bevels, structural detail, booleans and remesh cleanup |
|
|
109
|
-
| **P3 UVs & texel density** | unwrap, seam placement, uniform px/m, no stretching, atlas packing |
|
|
110
|
-
| **P4 PBR materials** | albedo, roughness, metallic, normal, AO — generated or baked, never flat placeholders |
|
|
111
|
-
| **P5 Baked maps** | high-to-low normal and AO bakes, curvature, cavity |
|
|
112
|
-
| **P6 Detail pass** | wear, edge damage, grime in crevices, decals, micro-normal |
|
|
113
|
-
| **P7 Topology & LODs** | tri budget, decimate chain, normals recalculated, no n-gons where they matter |
|
|
114
|
-
| **P8 Rig & skinning** *(if animated)* | weights ≤ 4 influences/vertex, normalised to 1.0, bone names matching the Unity Avatar rig |
|
|
115
|
-
| **P9 Integration** | scale, orientation, pivot, naming, `add_leaf_bones=False` on FBX export, collision proxies |
|
|
116
|
-
|
|
117
|
-
**Textures are generated, not procedural.** Where an image-generation tool is configured (the toolkit's
|
|
118
|
-
`kie-image` MCP — `generate_image`), use it for albedo, normals, roughness masks and detail maps. Do not
|
|
119
|
-
substitute procedural noise or flat colours for missing maps; that is the fastest route to a plastic-looking
|
|
120
|
-
asset and the critic will name it every round.
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## 5. Verify recipe — the round's step 4
|
|
125
|
-
|
|
126
|
-
### 5.1 The engine is the truth, not the Cycles render
|
|
127
|
-
|
|
128
|
-
**Primary evidence: the asset loaded in BabylonJS, in a browser, under the fixed viewer lighting rig.** A
|
|
129
|
-
Cycles/EEVEE render flatters a model in ways the real-time engine will not — it is a diagnostic, not the
|
|
130
|
-
verdict.
|
|
131
|
-
|
|
132
|
-
- **Via Unity route:** re-export the level and load it off the toolkit dev server
|
|
133
|
-
(`unity-exporter-cli.md` §12) — that is how you verify the round trip actually survived.
|
|
134
|
-
- **glb-direct route:** serve the `.glb` into a minimal BabylonJS viewer page and screenshot that.
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
curl -sS -o /dev/null -w "%{http_code}\n" "http://localhost:8888/scenes/level01.gltf"
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### 5.2 Lock the viewer, not just the camera
|
|
141
|
-
|
|
142
|
-
Two variables must be frozen or every round changes more than the model:
|
|
143
|
-
|
|
144
|
-
1. **The camera set** — fixed orbit angles recorded in `cameras.md`: a hero 3/4, a front elevation, and at
|
|
145
|
-
least one detail crop. Same distance, same fov, same resolution, every round.
|
|
146
|
-
2. **The lighting rig** — one HDRI, one exposure, no post. Written into `pipeline.md` and never changed
|
|
147
|
-
mid-run. A model that "got better" under a different HDRI did not get better.
|
|
148
|
-
|
|
149
|
-
### 5.3 The Blender-vs-engine gap
|
|
150
|
-
|
|
151
|
-
Render the same locked angles from Blender as a **secondary** frame. When the Blender render looks right and
|
|
152
|
-
the engine frame looks wrong, the round's problem is the export or the material translation — not the
|
|
153
|
-
sculpt. Make the critic say which side the gap is on, exactly as the `unity-level` pipeline does for the
|
|
154
|
-
Unity-vs-export boundary.
|
|
155
|
-
|
|
156
|
-
### 5.4 Metrics
|
|
157
|
-
|
|
158
|
-
Collect into `evidence/round-NN-<part>-metrics.json`: triangle count, material and texture count, texture
|
|
159
|
-
memory, texel density, influence count per vertex (max), whether weights normalise to 1.0, load time, and
|
|
160
|
-
browser console errors.
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## 6. Extra critic inputs and gates for this pipeline
|
|
165
|
-
|
|
166
|
-
Scored on the **model / asset rubric** in `critic-rubrics.md` (Silhouette & Proportion, Surface & Material,
|
|
167
|
-
Detail Density, Topology & Efficiency, Integration Readiness).
|
|
168
|
-
|
|
169
|
-
**Hard gates:**
|
|
170
|
-
|
|
171
|
-
| Gate | Fails when |
|
|
172
|
-
|---|---|
|
|
173
|
-
| **Tri / texture budget** | the loop card's budget is exceeded |
|
|
174
|
-
| **Engine-legal skinning** | any vertex has > 4 influences, or weights do not normalise to 1.0 |
|
|
175
|
-
| **Rig names** | bone names no longer match the Unity Avatar/Animator rig |
|
|
176
|
-
| **Transform hygiene** | scale, orientation or pivot is wrong at import — the most common silent defect on generated and converted assets |
|
|
177
|
-
| **GUID survival** | an in-place round changed the GUID, or importer settings were reset |
|
|
178
|
-
| **Console** | the `.glb` produces errors on load |
|
|
179
|
-
| **No placeholder maps** | a material ships with flat-colour or procedural-noise stand-ins for maps the target needs |
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## 7. Known failure modes
|
|
184
|
-
|
|
185
|
-
| Symptom | Cause | Fix |
|
|
186
|
-
|---|---|---|
|
|
187
|
-
| A crashed round recorded as success | missing `--python-exit-code 1` | always pass all four canonical flags |
|
|
188
|
-
| `bpy.ops.import_scene.fbx` not found | operator names moved in 5.x (`bpy.ops.wm.fbx_import` is native now) | enumerate the operators in *this* build (§3) |
|
|
189
|
-
| Every scene reference to the model broke | wrote to a new path, or delete-then-recreate | edit in place; never remove the `.meta` |
|
|
190
|
-
| Importer settings silently reset | new file path | copy them across explicitly (§8.3) |
|
|
191
|
-
| Model imports at 1/100 scale or lying on its side | FBX unit mismatch, or a generated asset's arbitrary orientation | `transform_apply` after fixing scale/rotation; check on every generated asset |
|
|
192
|
-
| Model looks great in Blender, dead in the engine | material translation or missing maps | §5.3 — isolate the side before re-sculpting |
|
|
193
|
-
| Components missing from the exported asset | Blender cannot write them, or community licence | components come from Unity under Pro only (§8.5) |
|
|
194
|
-
| `blender -b in.fbx` does nothing | not a valid invocation | import inside the script instead (§5) |
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
# Pipeline: `unity-level`
|
|
2
|
-
|
|
3
|
-
**Deliverable:** a Unity-authored scene exported by the Babylon Toolkit as a **game level** — baked GI,
|
|
4
|
-
IBL/skybox, reflection probes, terrain, fog, tonemapping — consumed by a BabylonJS game.
|
|
5
|
-
|
|
6
|
-
The loop protocol in `SKILL.md` does not change. What changes is **what the builder edits** (a Unity scene,
|
|
7
|
-
via the CLI) and **what the verifier produces** (a browser screenshot of the *exported* level, plus the
|
|
8
|
-
exported scene metadata). No gameplay code is in scope here — the level is the artifact.
|
|
9
|
-
|
|
10
|
-
> **Required reading before round 1.** Fetch and read the Agent Reference's
|
|
11
|
-
> [Unity Exporter Instructions](https://raw.githubusercontent.com/babylontoolkit/agent/main/references/unity-exporter-cli.md)
|
|
12
|
-
> in full. Section numbers below (§4B, §8, §9 …) refer to it. Builder subagents must be given it too — a
|
|
13
|
-
> subagent does not inherit your context.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## 1. Prerequisite gate — before round 1, and again on every resume
|
|
18
|
-
|
|
19
|
-
**A gauntlet that starts without these spends its whole budget polishing something that never exports.**
|
|
20
|
-
Run the gate, write the result to `_gauntlet/<name>/pipeline.md`, and refuse to start if it fails.
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
unity command bt_status --project-path "$PROJ"
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
| Must be true | Why it is fatal |
|
|
27
|
-
|---|---|
|
|
28
|
-
| `pro : True` | **Community silently drops Terrain**, plus Rigidbody, Animator, AudioSource, NavMeshAgent, CharacterController, ParticleSystem, Canvas, VideoPlayer, **PostProcess volumes** and **LOD groups**. The export still succeeds and still writes scene metadata — it just quietly omits them. See §0. |
|
|
29
|
-
| An Editor is reachable | `unity command` needs a live Editor — resident headless or a GUI copilot session (§6). |
|
|
30
|
-
| All three packages installed | `com.unity.pipeline` + `org.khronos.unitygltf` + `com.babylontoolkit.editor` (§4.1). |
|
|
31
|
-
| Scene Exporter panel bootstrapped once, in a GUI session | Seeds layers, FreeImage, shader list and root namespace, and writes `package.json` (§5.1). **A cold machine that has never run the GUI cannot start a gauntlet.** |
|
|
32
|
-
| `npm install` run in the project root | Any build with `CompileProjectScript` needs the local `tsc` (§5.2). |
|
|
33
|
-
| `unity list --format json \| grep bt_` returns the eight `bt_*` commands | The shipped CLI bridge (`com.babylontoolkit.editor` 9.22.3+, §11). If empty: `recompile` + `recompile_status`. |
|
|
34
|
-
| `baking : False` | A lightmap bake in progress hard-blocks every export. |
|
|
35
|
-
|
|
36
|
-
The combined three-things check from §0, worth running verbatim:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
unity command eval 'string r = UnityTools.GetRootPath();
|
|
40
|
-
return "pro=" + ToolkitManager.IsPro()
|
|
41
|
-
+ " tsc=" + System.IO.File.Exists(System.IO.Path.Combine(r, CanvasTools.CVPanel.TscLocalPath))
|
|
42
|
-
+ " scene=" + UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene().path;' \
|
|
43
|
-
--project-path "$PROJ"
|
|
44
|
-
# want: pro=True tsc=True scene=Assets/Scenes/<the one you meant>.unity
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Licence is a loop-card boundary, not a warning.** If `pro` is `False`, park immediately and tell the user
|
|
48
|
-
that a valid `Assets/[Config]/license.json` is required — the two service grant paths
|
|
49
|
-
(`HasActiveSubscription()`, `GenerateDeveloperLicense()`) are documented as **not live yet**, so
|
|
50
|
-
`license.json` is the only working path today.
|
|
51
|
-
|
|
52
|
-
### `pipeline.md` for this kind
|
|
53
|
-
|
|
54
|
-
```markdown
|
|
55
|
-
# Pipeline — unity-level
|
|
56
|
-
Unity project : /abs/path/UnityProject
|
|
57
|
-
Editor mode : copilot (resident GUI) | headless (-batchmode -nographics)
|
|
58
|
-
Editor version: 6000.5.10f1
|
|
59
|
-
Toolkit : 9.22.3 licence: professional
|
|
60
|
-
Scene : Assets/Scenes/Level01.unity
|
|
61
|
-
Export root : /abs/path/UnityProject/Export
|
|
62
|
-
Dev server : http://localhost:8888 (started via bt_devserver_start)
|
|
63
|
-
Player page : /index.html?scene=level01.gltf (requires a web-project build — see §4.3)
|
|
64
|
-
Bake tier : preview | production
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
> **None of this survives a pause.** A resident Editor, a warm asset database and a running dev server are
|
|
68
|
-
> all session-scoped. On resume, re-launch and re-run the gate before touching anything.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## 2. Build surface — what a builder may edit
|
|
73
|
-
|
|
74
|
-
Everything runs against the **live active scene** through the CLI. The Editor keeps its in-memory state in
|
|
75
|
-
sync; raw file edits cannot.
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
unity command eval_file /tmp/round-12-lighting.cs --project-path "$PROJ" --format json
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
> ⚠️ **Never hand-edit `.unity`, `.prefab` or `.asset` YAML while a live Editor is reachable.** fileIDs and
|
|
82
|
-
> GUIDs are easy to get wrong, the Editor will not see the change until a reimport, and it is very easy to
|
|
83
|
-
> write valid-looking YAML into the wrong scene. Only edit files directly when `unity status` /
|
|
84
|
-
> `unity command` show no reachable Editor — and say so explicitly in the round journal.
|
|
85
|
-
|
|
86
|
-
Models come from Blender via the `blender-model` pipeline reference; **edit FBX files in place** so the
|
|
87
|
-
Unity GUID and importer settings survive and every scene reference picks up the change.
|
|
88
|
-
|
|
89
|
-
### The LightingSettings trap — round 1 must handle it
|
|
90
|
-
|
|
91
|
-
A scene created with `EditorSceneManager.NewScene` in batch mode has **no LightingSettings asset**, and the
|
|
92
|
-
export throws `Lightmapping.lightingSettings is null`. Worse, *reading* the property throws when unset, so
|
|
93
|
-
a plain null-check raises the very error it checks for. Probe with `TryGetLightingSettings`, and note the
|
|
94
|
-
order and the `MarkSceneDirty` — without it the assignment is never written to disk and the *second* export
|
|
95
|
-
of that scene fails, which reads as "the fix stopped working" (§8.1):
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
NewScene -> build hierarchy -> SaveScene -> assign LightingSettings
|
|
99
|
-
-> MarkSceneDirty -> SaveOpenScenes -> AssetDatabase.SaveAssets -> BuildProject
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
grep -n "m_LightingSettings" Assets/Scenes/Level01.unity
|
|
104
|
-
# bad: m_LightingSettings: {fileID: 0}
|
|
105
|
-
# good: m_LightingSettings: {fileID: 4890085278179872738, guid: 64c317a2..., type: 2}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## 3. Part taxonomy — the default decomposition
|
|
111
|
-
|
|
112
|
-
Round 1 records this as the part checklist in `progress.md`, ordered roughly by impact. Drop parts the
|
|
113
|
-
brief puts out of scope; never add gameplay code parts to a `unity-level` job.
|
|
114
|
-
|
|
115
|
-
| Part | Owns | Exported metadata it drives |
|
|
116
|
-
|---|---|---|
|
|
117
|
-
| **P1 Landform & terrain** | terrain heightmap, terrain layers, splat weights, trees/details | Terrain component (**Pro-gated**) |
|
|
118
|
-
| **P2 Blockout & composition** | major masses, silhouette, sightlines, the framing at each locked camera | geometry |
|
|
119
|
-
| **P3 Set dressing & scatter** | props, clutter, decals, LOD groups | geometry, LOD (**Pro-gated**) |
|
|
120
|
-
| **P4 Materials & surfacing** | albedo/roughness/metallic/normal, texel density, wear | materials, textures |
|
|
121
|
-
| **P5 Light rig** | sun angle + colour temp, practicals, shadow distance and softness, light modes | `light` components, `sunposition`, `sunrotation` |
|
|
122
|
-
| **P6 GI / lightmap bake** | lightmapper, resolution, bounces, denoiser, AO, UV padding | `ambientlightmap`, `lightmaplevel`, lightmap textures |
|
|
123
|
-
| **P7 IBL / skybox / ambient** | skybox material or cubemap, ambient mode/source, SH, sky reflections | `skybox`, `skyreflections`, `createpolynomials`, `ambientlighting`, `ambientskymode`, `ambientskysource`, `ambientskycolor`, `ambientgroundcolor`, `ambientlightintensity` |
|
|
124
|
-
| **P8 Reflection probes** | placement, resolution, box projection, intensity | `reflectionprobeintensity` |
|
|
125
|
-
| **P9 Atmosphere & fog** | fog type/mode/colour/density, height fog, volumetrics | `fogtype`, `fogmode`, `fogcolor`, `fogdensity`, `fogstart`, `fogend`, `fogvolumetric`, `fogbaseheight`, `fogmaximumheight`, `fogmeanfreepath`, `foganisotropy` |
|
|
126
|
-
| **P10 Image processing** | exposure, tonemapping, gamma, clear colour | `exposure`, `tonemapping`, `gammacorrection`, `imageprocessing`, `clearcolor` |
|
|
127
|
-
| **P11 Perf & budget** | draw calls, texture format, lightmap memory, render groups, freeze/prewarm | `webptextures`, `ktxtextures`, `webplightmaps`, `ktxlightmaps`, `rendergroups`, `freezeactivemeshes`, `prewarmup`, `performancepriority` |
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## 4. Verify recipe — the round's step 4, in order
|
|
132
|
-
|
|
133
|
-
Four things can fail independently. Run them in this order and stop at the first failure.
|
|
134
|
-
|
|
135
|
-
### 4.1 Bake
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# kick the bake
|
|
139
|
-
unity command eval 'UnityEditor.Lightmapping.BakeAsync(); return "started";' --project-path "$PROJ"
|
|
140
|
-
|
|
141
|
-
# poll — the export hard-throws while this is true
|
|
142
|
-
unity command eval 'return UnityEditor.Lightmapping.isRunning;' --project-path "$PROJ"
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
**Bake tiering is a budget, and it is the dominant cost of this pipeline.** Converge on a **preview** tier
|
|
146
|
-
(low lightmap resolution, few bounces, fast/no denoiser) and switch to the **production** tier only for the
|
|
147
|
-
final rounds and the integration critic. Record the tier in `progress.md` under `Budgets:` and in every
|
|
148
|
-
round journal — *a preview-tier score is not comparable to a production-tier score*, and the critic must be
|
|
149
|
-
told which tier it is looking at.
|
|
150
|
-
|
|
151
|
-
### 4.2 Export as a **game level**
|
|
152
|
-
|
|
153
|
-
The distinction that matters: **`selection == null` means game level.** That single flag gates the entire
|
|
154
|
-
scene-metadata block — skybox, ambient/IBL, SH, reflection probe intensity, fog, tonemapping, exposure,
|
|
155
|
-
gravity, navmesh, sun position. Pass a non-empty selection and you get an asset container with **none** of
|
|
156
|
-
it (§10). A level export writes 73 metadata keys; a container writes 23.
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
unity command bt_export_level --scene Assets/Scenes/Level01.unity \
|
|
160
|
-
--project-path "$PROJ" --timeout 900
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
- **Always pass `--scene`.** A fresh Editor session opens the *template's* default scene, and exporting
|
|
164
|
-
without opening yours silently exports the wrong one (§8.1).
|
|
165
|
-
- `bt_export_level` throws on `EditorApplication.isCompiling` and on `Lightmapping.isRunning`.
|
|
166
|
-
- `BuildProject` calls `SaveOpenScenes()` and `SaveSettings()` — **anything you toggle in memory is
|
|
167
|
-
persisted to disk.** Snapshot and restore, as the shipped bridge does for `geometryOnly`.
|
|
168
|
-
|
|
169
|
-
### 4.3 Serve — and the `index.html` trap
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
unity command bt_devserver_start --project-path "$PROJ"
|
|
173
|
-
unity command bt_devserver_status --project-path "$PROJ"
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
| URL | Serves |
|
|
177
|
-
|---|---|
|
|
178
|
-
| `http://localhost:8888/index.html` | the generated web project, default scene |
|
|
179
|
-
| `http://localhost:8888/index.html?scene=level01.gltf` | the same player pointed at one scene (**file name, not a path**) |
|
|
180
|
-
| `http://localhost:8888/scenes/level01.gltf` | the raw exported asset |
|
|
181
|
-
|
|
182
|
-
> ⚠️ **`bt_export_level` defaults to `--geometryOnly true`, which skips the web-project emit — so
|
|
183
|
-
> `/index.html` 404s and there is nothing to screenshot.** Decide once, in round 1, and record it in
|
|
184
|
-
> `pipeline.md`: either run `bt_build_project` (or `--geometryOnly false`) to generate the player, or point
|
|
185
|
-
> your own BabylonJS loader page at the raw `scenes/*.gltf` URL. This is the most common first-round dead
|
|
186
|
-
> end in this pipeline.
|
|
187
|
-
|
|
188
|
-
### 4.4 Capture from the locked camera
|
|
189
|
-
|
|
190
|
-
Locked cameras are **real Unity cameras** in the scene, named `gauntlet_<slug>` (e.g. `gauntlet_hero`), one
|
|
191
|
-
per target image, with their exact transform and fov recorded in `cameras.md`. They export as `camera`
|
|
192
|
-
components under both licence tiers.
|
|
193
|
-
|
|
194
|
-
In the browser, select the camera by name before the screenshot rather than trusting whichever camera the
|
|
195
|
-
player defaulted to — via the host's browser tool (`chrome-devtools` `evaluate_script` on Claude Code):
|
|
196
|
-
|
|
197
|
-
```js
|
|
198
|
-
// select the locked camera, settle, then screenshot
|
|
199
|
-
const cam = scene.getCameraByName("gauntlet_hero");
|
|
200
|
-
if (!cam) throw new Error("locked camera missing from export");
|
|
201
|
-
scene.activeCamera = cam;
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
Then capture to `_gauntlet/<name>/evidence/round-NN-<part>-hero.png`, and collect
|
|
205
|
-
`round-NN-<part>-metrics.json`: FPS, draw calls, load time, console errors.
|
|
206
|
-
|
|
207
|
-
> Confirm the camera-selection call against your player page on the first round and record what worked in
|
|
208
|
-
> `pipeline.md` — the toolkit's player may already expose its own camera switching, in which case use that.
|
|
209
|
-
|
|
210
|
-
### 4.5 Read back the export boundary
|
|
211
|
-
|
|
212
|
-
The objective check this pipeline gets for free — assert that what the part was supposed to change actually
|
|
213
|
-
crossed the boundary. Scene metadata lives at **`scenes[0].extras.metadata`**, not the document root:
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
jq '.scenes[0].extras.metadata
|
|
217
|
-
| {license, skybox, ambientlighting, ambientskymode, ambientlightmap, lightmaplevel,
|
|
218
|
-
reflectionprobeintensity, exposure, tonemapping, fogmode, fogvolumetric, sunposition}' \
|
|
219
|
-
"$PROJ/Export/scenes/level01.gltf"
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Write the result to `evidence/round-NN-<part>-metadata.json` and hand it to the critic. `license` must read
|
|
223
|
-
`"professional"`.
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
## 5. Extra critic inputs and gates for this pipeline
|
|
228
|
-
|
|
229
|
-
Added to the standard contract in `critic-rubrics.md`:
|
|
230
|
-
|
|
231
|
-
**Inputs:** the exported metadata dump, the bake tier, and — when a Unity-side capture exists — the Editor
|
|
232
|
-
viewport frame alongside the browser frame.
|
|
233
|
-
|
|
234
|
-
**Hard gates:**
|
|
235
|
-
|
|
236
|
-
| Gate | Fails when |
|
|
237
|
-
|---|---|
|
|
238
|
-
| **Export boundary** | a metadata key the part owns is absent, default, or contradicts what the round claims it set |
|
|
239
|
-
| **Licence tier** | `scenes[0].extras.metadata.license` is not `"professional"` |
|
|
240
|
-
| **Level, not container** | `properties` is `false`, or the scene-metadata block is missing — the export was made with a non-null selection |
|
|
241
|
-
| **Bake tier honesty** | the round journal does not state which tier the evidence was baked at |
|
|
242
|
-
|
|
243
|
-
**The Unity-vs-export gap — make the critic isolate it.** If the Editor viewport looks right and the
|
|
244
|
-
exported browser frame looks flat, the round's problem is the *export path*, not the art — and a critic
|
|
245
|
-
looking only at the browser frame will send the builder off to "fix the lighting" forever. When both frames
|
|
246
|
-
are available, the critic must state which side of the boundary the gap is on.
|
|
247
|
-
|
|
248
|
-
> Capturing the Unity side needs a graphics device — it works in **copilot mode** (a resident GUI Editor),
|
|
249
|
-
> via a `Camera.Render()` to a `RenderTexture` and `EncodeToPNG`. A `-nographics` headless Editor cannot
|
|
250
|
-
> render, so in headless mode this diagnostic is unavailable; say so rather than skipping it silently.
|
|
251
|
-
> Verify which you have on round 1 and record it in `pipeline.md`.
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
## 6. Scope the target to what can actually cross the boundary
|
|
256
|
-
|
|
257
|
-
The 73-key metadata list **is** the export surface for scene-level look. Anything the target image depends
|
|
258
|
-
on that has no key — screen-space reflections, SSGI/SSAO, custom render passes, bespoke volume stacks —
|
|
259
|
-
does not survive, and a critic that keeps raising it will name the same gap forever.
|
|
260
|
-
|
|
261
|
-
During the interview's target-reachability pass, walk the target against that key list and record whatever
|
|
262
|
-
cannot cross in the loop card's **`OUT OF REACH`** slot. Critics are instructed not to raise gaps against
|
|
263
|
-
it. Where an effect can be *approximated* on the BabylonJS side instead (a reflection probe standing in for
|
|
264
|
-
SSR, baked contact shadows standing in for SSAO), record that as the approach rather than as out of reach.
|
|
265
|
-
|
|
266
|
-
> The precise URP/HDRP boundary is worth **measuring on your first real export** rather than assuming.
|
|
267
|
-
> Export one scene with the effects you care about, dump `scenes[0].extras.metadata`, and record what
|
|
268
|
-
> actually landed in `pipeline.md`. Do that before finalizing the rubric for a job that leans on them.
|
|
269
|
-
|
|
270
|
-
---
|
|
271
|
-
|
|
272
|
-
## 7. Known failure modes — check these before blaming the art
|
|
273
|
-
|
|
274
|
-
| Symptom | Cause | Fix |
|
|
275
|
-
|---|---|---|
|
|
276
|
-
| Export produced geometry but no terrain / physics / LODs | community licence | §0 — install a valid `license.json`; the log line is `Pro Tools Disabled` |
|
|
277
|
-
| `Lightmapping.lightingSettings is null` | programmatic scene with no LightingSettings asset | §8.1, and remember `MarkSceneDirty` |
|
|
278
|
-
| The fix "stopped working" on the second export | `MarkSceneDirty` was missed, so the assignment never persisted | check `m_LightingSettings` in the `.unity` file |
|
|
279
|
-
| `A lightmap bake is in progress.` | `Lightmapping.isRunning` | poll it out before exporting |
|
|
280
|
-
| Exported the wrong scene | fresh session opened the template default | always pass `--scene` |
|
|
281
|
-
| `/index.html` 404s | `--geometryOnly true` skipped the web-project emit | §4.3 |
|
|
282
|
-
| Skybox/fog missing from the export | a non-null selection made it a container | §10 — `selection == null` for a level |
|
|
283
|
-
| Exporter settings changed on their own | `BuildProject` calls `SaveSettings()` every run | snapshot and restore what you toggle |
|
|
284
|
-
| Unity Hub cannot open the project | copilot mode leaves a resident Editor holding the lock | `bt-stop-editor.sh <ProjectPath>` (§4B.3) |
|
|
285
|
-
| `unity command` cannot connect | Safe Mode, or a batch Editor invisible to `status` | `unity pipeline list`; gate on `unity command`, not `unity status` |
|