@babylonjs-toolkit/agent 1.2.16 → 1.2.21
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 +3 -2
- package/package.json +1 -1
- package/skills/bt-blender/SKILL.md +448 -0
- package/skills/bt-blender/THIRD_PARTY_NOTICES.md +141 -0
- package/skills/bt-blender/references/art-style-and-genre.md +173 -0
- package/skills/bt-blender/references/characters-and-creatures.md +644 -0
- package/skills/bt-blender/references/environments.md +478 -0
- package/skills/bt-blender/references/game-engine-export.md +284 -0
- package/skills/bt-blender/references/geometry-nodes.md +447 -0
- package/skills/bt-blender/references/hard-surface.md +724 -0
- package/skills/bt-blender/references/procedural-generation.md +358 -0
- package/skills/bt-blender/references/rigging-and-animation.md +1080 -0
- package/skills/bt-blender/references/sculpting-and-retopology.md +544 -0
- package/skills/bt-blender/references/uv-and-pbr-materials.md +381 -0
- package/skills/bt-blender/references/vehicles.md +637 -0
- package/skills/bt-blender/scripts/blender/__pycache__/construction_kit.cpython-313.pyc +0 -0
- package/skills/bt-blender/scripts/blender/__pycache__/geometry_nodes_builders.cpython-313.pyc +0 -0
- package/skills/bt-blender/scripts/blender/__pycache__/image_measure.cpython-313.pyc +0 -0
- package/skills/bt-blender/scripts/blender/__pycache__/reference_traces.cpython-313.pyc +0 -0
- package/skills/bt-blender/scripts/blender/assembly_check.py +420 -0
- package/skills/bt-blender/scripts/blender/blueprint.py +293 -0
- package/skills/bt-blender/scripts/blender/character_blockout.py +462 -0
- package/skills/bt-blender/scripts/blender/construction_kit.py +1770 -0
- package/skills/bt-blender/scripts/blender/coverage_check.py +221 -0
- package/skills/bt-blender/scripts/blender/environment_kit.py +525 -0
- package/skills/bt-blender/scripts/blender/evidence_sheet.py +243 -0
- package/skills/bt-blender/scripts/blender/export_asset.py +623 -0
- package/skills/bt-blender/scripts/blender/geometry_nodes_builders.py +575 -0
- package/skills/bt-blender/scripts/blender/hard_surface_panels.py +374 -0
- package/skills/bt-blender/scripts/blender/hard_surface_trims.py +200 -0
- package/skills/bt-blender/scripts/blender/image_measure.py +917 -0
- package/skills/bt-blender/scripts/blender/materials_pbr.py +439 -0
- package/skills/bt-blender/scripts/blender/measure_stations.py +496 -0
- package/skills/bt-blender/scripts/blender/ortho_views.py +309 -0
- package/skills/bt-blender/scripts/blender/overlay_sheet.py +238 -0
- package/skills/bt-blender/scripts/blender/procedural_game_ready.py +258 -0
- package/skills/bt-blender/scripts/blender/procedural_generators.py +842 -0
- package/skills/bt-blender/scripts/blender/qa_check.py +729 -0
- package/skills/bt-blender/scripts/blender/reference_traces.py +344 -0
- package/skills/bt-blender/scripts/blender/retopology_tools.py +781 -0
- package/skills/bt-blender/scripts/blender/review_render.py +358 -0
- package/skills/bt-blender/scripts/blender/rigging_tools.py +1170 -0
- package/skills/bt-blender/scripts/blender/style_palette.py +190 -0
- package/skills/bt-blender/scripts/blender/tool_common.py +289 -0
- package/skills/bt-blender/scripts/blender/trace.py +283 -0
- package/skills/bt-blender/scripts/blender/uv_layout.py +555 -0
- package/skills/bt-blender/scripts/blender/vehicle_parts.py +370 -0
- package/skills/bt-blender/scripts/blender/view_consistency.py +133 -0
- package/skills/bt-blender/scripts/blender/world_gate.py +231 -0
- package/skills/bt-blender/scripts/bt-blender.mjs +333 -0
- package/skills/bt-blender/scripts/validate_gltf.mjs +204 -0
- package/skills/bt-execute/SKILL.md +2 -1
- package/skills/bt-gauntlet/SKILL.md +30 -20
- package/skills/bt-gauntlet/references/critic-rubrics.md +106 -7
- package/skills/bt-gauntlet/references/loop-templates.md +23 -3
- package/skills/bt-gauntlet/references/spec-composition.md +20 -1
- package/skills/bt-gauntlet/references/target-images.md +27 -0
- package/skills/bt-gauntlet/references/unity-pipeline.md +41 -4
- package/skills/bt-gauntlet/references/workspace.md +90 -6
- package/skills/bt-unwrap/scripts/blender/__pycache__/bt_unwrap.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/image_utils.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/mesh_tools.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/model_io.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/previews.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/rasterizer.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/reference_views.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/reference_warp.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/texture_bake.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/texture_compose.cpython-313.pyc +0 -0
- package/skills/bt-unwrap/scripts/blender/__pycache__/uv_layout.cpython-313.pyc +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Babylon Toolkit Desktop Agent (1.2.
|
|
1
|
+
# Babylon Toolkit Desktop Agent (1.2.21)
|
|
2
2
|
|
|
3
3
|
The desktop agent owns the entire pipeline end to end — frontend and UI design, gameplay code, shaders, generated art and audio, 3D models in headless Blender, whole game levels and prefabs in a terminal-driven Unity Editor, the interactive glTF export, the web build, the dev server, and visual QA by screenshotting both Unity and the running browser.
|
|
4
4
|
|
|
@@ -290,6 +290,7 @@ pair or schedule the bridge.
|
|
|
290
290
|
| [`bt-hero`](skills/bt-hero/SKILL.md) | `/bt-hero` | Create smooth cinematic 3D scrolling hero sections. |
|
|
291
291
|
| [`bt-atlas`](skills/bt-atlas/SKILL.md) | `/bt-atlas` | Generate texture atlas skin variations. |
|
|
292
292
|
| [`bt-unwrap`](skills/bt-unwrap/SKILL.md) | `/bt-unwrap` | Turn a rough AI-generated (or any) 3D model into a clean, web-ready game asset in one headless Blender run: repair the geometry, decimate to a face budget (lost shape re-baked as a normal map), orient it to glTF / BabylonJS forward at real-world scale, give it a new UV layout of large islands (less space for surfaces nobody sees), bake the source textures onto it, and paint the sharp reference images back on — straight and three-quarter views, each camera solved from the silhouette, one view per face, seams kept off logos, and the model's own texture kept where images and geometry disagree (engines, cockpits) — so a melted, fragmented texture comes out crisp instead of smeared. GLB / glTF / FBX / OBJ / USD / PLY / STL / Alembic / .blend in; GLB / glTF / FBX / OBJ / USD / .blend out with 2048 WebP textures (4096 on request), a single-sided PBR material, optional Draco and LODs, before/after renders, coverage and clutter maps, the UV island map for `bt-atlas`, and a JSON report with acceptance checks for plans. `--refs`, `--faces`, `--length`, `--texture-size`, `--unwrap views\|smart\|keep`, `--analyze`. |
|
|
293
|
+
| [`bt-blender`](skills/bt-blender/SKILL.md) | `/bt-blender` | Model game assets from reference images in headless Blender, measured instead of eyeballed: write the asset brief, check that the reference views agree with each other, block out, then build with a tested construction kit (rounded sections with real corner radii lofted through measured stations, lathed and traced parts, subdivision cages whose holding loops hit a target radius and whose shrinkage is corrected to the measured sizes, radius-driven bevels, smooth shading with crisp design lines, welds that keep hard edges, moulded parts inflated from one silhouette). Every pass is graded against the references — station widths MATCH / CLOSE / WRONG, corner radii (equal depth on the model, circle fit on images), shading continuity, a world-scale silhouette IoU gate and a render at the asset's real in-game pixel height — then an asset QA gate (z-fighting, floating parts, flipped or inside-out normals, topology, UV overlap, empty material slots, skin weights) and an assembly check (gaps, embed depth, attachments, spec sizes). Exports glTF / GLB for BabylonJS (float bakes converted to sRGB bytes, tangents, Geometry Nodes instances realised or GPU-instanced, optional Draco / meshopt / WebP, Khronos glTF-Validator) or FBX by the Unity case table, re-imported to prove the size, with JSON evidence for every gate. Eleven domain references with tested helper modules cover hard surface, vehicles, environments, characters and creatures, rigging and animation, sculpting and retopology, UVs and PBR bakes, Geometry Nodes, procedural generation, engine export and art style. `measure-stations`, `world-gate`, `view-consistency`, `review-render`, `qa-check`, `assembly-check`, `export`, `run <build.py>`. |
|
|
293
294
|
| [`bt-optimize`](skills/bt-optimize/SKILL.md) | `/bt-optimize` | Make an exported Unity scene run fast in the browser: profile the BabylonJS frame (draw calls per pass, every main-pass draw by the object that owns it, shadow casters per cascade, lights, post-processing), then fix the causes on a copy of the scene — the one scene to export afterwards: rigid skinned meshes turned into plain meshes, repeated props instanced (off lightmaps and light probes), static objects that animate unfrozen, repeated deforming characters made an instanced VAT crowd, practical lights baked, point / spot shadows removed, shadow casters that shadow nothing visible pruned, static / lightmap unlocks, and static meshes and LOD groups merged when that saves draws; then re-bake, verify the copy against its source, export, and prove frame rate and look against the original in Unity, the browser and the game. Its `planning.md` is the playbook bt-spec and bt-plan follow to spec or Quick Plan the same work ("create a quick plan to optimize Level01.unity"). `--no-combine`, `--combine-only`, `--keep-gi`, `--instance-from:2`. |
|
|
294
295
|
| [`bt-profile`](skills/bt-profile/SKILL.md) | `/bt-profile` | Find what makes a web app slow and list the fixes (spec them with `/bt-spec`, or apply them with `--auto-fix`) — built for BabylonJS / Babylon Toolkit games, usable on any front end (give it a URL and the project folder): drive the running game in Chrome through a repeatable scenario (a cold load, a level start, a countdown), record the CPU profile, allocations, every frame and every GPU pipeline compile (with `--gpu-cold`, as on a first visit), map each millisecond to its source line and owner (your code, the toolkit runtime, BabylonJS, Havok, React), then list the fixes, or with `--auto-fix` apply them one at a time and re-measure each. Writes `.agents/profile/<slug>/dashboard.html` (live progress, Print / Download PDF) and a spec-ready `findings.md`. `--auto-fix`, `--snapshots`, `--watch`, `--gpu-cold`, `--stop`, `--resume`, `--restart`, `--project`, `--slug`. |
|
|
295
296
|
|
|
@@ -470,7 +471,7 @@ Where each tool looks for PROJECT-LOCAL skills (only when the user explicitly re
|
|
|
470
471
|
> for everything else (Codex, Copilot, Gemini CLI, Antigravity). By default use the
|
|
471
472
|
> GLOBAL (per-user home) locations; use the project-local locations only when the user
|
|
472
473
|
> explicitly asks for a project install. Copy **whole folders** into each — the
|
|
473
|
-
> `bt-atlas/scripts/`, `bt-unwrap/scripts/`, `bt-optimize/scripts/` and `bt-profile/scripts/` + `bt-profile/templates/` assets must be present in every location.
|
|
474
|
+
> `bt-atlas/scripts/`, `bt-unwrap/scripts/`, `bt-blender/scripts/` + `bt-blender/references/`, `bt-optimize/scripts/` and `bt-profile/scripts/` + `bt-profile/templates/` assets must be present in every location.
|
|
474
475
|
|
|
475
476
|
|
|
476
477
|
# Babylon Toolkit Loop Engineering (Gauntlet Loop)
|
package/package.json
CHANGED
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bt-blender
|
|
3
|
+
description: "The Babylon Toolkit Blender Skill models game assets from reference images in headless Blender, measured instead of eyeballed. It writes the brief, checks that the reference views agree with each other, sets them up as a blueprint at real scale and traces their outlines and design curves into world coordinates (parts built on the traces are stamped, and the gates fail unstamped parts), checks that every region of the reference belongs to a part, blocks out the whole silhouette first, then builds it with a tested construction kit (rounded sections with real corner radii lofted through measured stations, lathed and traced parts, subdivision cages whose holding loops hit a target radius and whose shrinkage is corrected to the measured sizes, radius-driven bevels, smooth shading with crisp design lines, welds that keep hard edges, moulded parts inflated from one silhouette). Every step is graded against the references: station widths MATCH / CLOSE / WRONG, corner radii (equal depth on the model, circle fit on images), shading continuity, a world-scale silhouette IoU gate, a one-sheet overlay of reference and model outlines in every view (IoU, missing and extra regions), and a render at the asset's real in-game pixel height. Before export it runs an asset QA gate (z-fighting, floating parts, flipped or inside-out normals, topology, UV overlap, empty material slots, skin weights) and an assembly check (gaps, embed depth, required attachments, spec sizes). It exports glTF / GLB for BabylonJS (float bakes converted to sRGB bytes, tangents, Geometry Nodes instances realised or GPU-instanced, optional Draco / meshopt / WebP, Khronos glTF-Validator) or FBX by the Unity case table (static, animated, rigged, Unity-sourced), re-imports to prove the size, and writes JSON evidence for every gate. Eleven domain references with tested helper modules cover hard surface, vehicles, environments, characters, rigging and animation, sculpting and retopology, UVs and PBR bakes, Geometry Nodes, procedural generation, engine export and art style. Use when an asset has to be built or rebuilt in Blender from reference images or a sketch sheet (e.g. `/bt-blender build the moulded housing from refs/housing --length 0.42`, `/bt-blender measure model.blend against refs/spec.json`, `/bt-blender qa build/asset.glb`)."
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are an EXPERT Babylon Toolkit technical artist who owns the asset pipeline end to end. Always adhere to any rules or requirements set out in the project's agent instructions (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md).
|
|
8
|
+
|
|
9
|
+
Use the user's message after the skill name as the `arguments`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Invocation
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/bt-blender build <what> [from <reference folder or images>] [--length|--width|--height <m>] [--format glb|gltf|fbx]
|
|
17
|
+
/bt-blender measure <model> against <spec.json>
|
|
18
|
+
/bt-blender qa <model> [--profile web|game|render|print]
|
|
19
|
+
/bt-blender export <model> [--out <file>]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Plain words map to steps: "build", "model", "rebuild" run the whole workflow below; "measure", "check against the
|
|
23
|
+
refs" run step 6; "qa", "is it clean" run step 7; "export", "ship it" run step 8. If the asset's real size is not
|
|
24
|
+
given and cannot be read from the references, ask once; never guess a scale.
|
|
25
|
+
|
|
26
|
+
All tools run through one launcher (Node 18+), which finds Blender the same way bt-unwrap does (`--blender <path>`,
|
|
27
|
+
then `$BLENDER`, then `blender` on PATH, then the usual install folders):
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
node <skill>/scripts/bt-blender.mjs <tool> [options] # prints ONE JSON line; exit 0 pass, 1 gate failed / error, 2 bad options
|
|
31
|
+
node <skill>/scripts/bt-blender.mjs <tool> --help # the tool's options
|
|
32
|
+
node <skill>/scripts/bt-blender.mjs run build.py [args] # your own build script, construction kit importable
|
|
33
|
+
node <skill>/scripts/bt-blender.mjs --list | --which-blender
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`--verbose` shows Blender's whole log and Python tracebacks. `<skill>` is this skill's folder.
|
|
37
|
+
|
|
38
|
+
**Without Node**, run any tool straight in Blender. The tools add their own folder to `sys.path`:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
blender --background --factory-startup --python-exit-code 1 --python <skill>/scripts/blender/<tool>.py -- [options]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The result is the stdout line starting `BT_BLENDER_RESULT `. Your own build script then needs
|
|
45
|
+
`import sys; sys.dont_write_bytecode = True; sys.path.insert(0, "<skill>/scripts/blender")` before
|
|
46
|
+
`import construction_kit as kit`.
|
|
47
|
+
|
|
48
|
+
| Tool | Script | What it answers |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `view-consistency` | `view_consistency.py` | Do the reference views agree with each other and with the known size? |
|
|
51
|
+
| `blueprint` | `blueprint.py` | The reference views as image planes at world scale in their view planes, a camera per view, the known-size box; with `--model`, the model drawn over every reference. |
|
|
52
|
+
| `trace` | `trace.py` | Every view's outline, and named design curves, in pixels and world metres (`traces.json`) for the build to stand on. |
|
|
53
|
+
| `coverage-check` | `coverage_check.py` | Does every region of the reference silhouette belong to a part (unclaimed regions, overlaps)? |
|
|
54
|
+
| `overlay-sheet` | `overlay_sheet.py` | The whole shape in every view on one sheet: both outlines, missing / extra regions, IoU. |
|
|
55
|
+
| `measure-stations` | `measure_stations.py` | Station by station, is the model the reference's size and form? |
|
|
56
|
+
| `world-gate` | `world_gate.py` | Does the whole silhouette overlap the reference at world scale (IoU)? |
|
|
57
|
+
| `review-render` | `review_render.py` | What does it look like: clay / parts / wire sheet, and at its in-game pixel height? |
|
|
58
|
+
| `qa-check` | `qa_check.py` | Will it ship clean: z-fighting, floaters, normals, topology, UVs (any map), weights, materials? |
|
|
59
|
+
| `assembly-check` | `assembly_check.py` | Is it physically put together: gaps, embeds, attachments, spec sizes? |
|
|
60
|
+
| `export` | `export_asset.py` | glTF / GLB or Unity FBX by case, instances, compression, re-import size check, glTF summary, Khronos validation. |
|
|
61
|
+
| `validate-gltf` | `validate_gltf.mjs` | Khronos glTF-Validator only (Node, no Blender). |
|
|
62
|
+
| `run` | your script | Your build script with `construction_kit` importable. |
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
|
|
66
|
+
- Blender 5.x. Every script and every trap below was tested on **Blender 5.3.0**. Tools always run with
|
|
67
|
+
`--background --factory-startup --python-exit-code 1`.
|
|
68
|
+
- Node 18+ for the launcher and the glTF validator. The validator is optional; install it once with
|
|
69
|
+
`npm install --prefix <skill>/scripts gltf-validator`, or point `--validator-dir` / `$BT_GLTF_VALIDATOR_DIR` at
|
|
70
|
+
a folder that has it. Without it, export reports validation as skipped (with that command) and still passes.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
# Conventions
|
|
75
|
+
|
|
76
|
+
- Metres, Blender Z up, the asset faces **-Y** (glTF / BabylonJS forward). A glTF export turns that into +Z forward,
|
|
77
|
+
Y up. Ground contact at Z = 0 unless the brief says otherwise.
|
|
78
|
+
- Straight views are Blender's numpad views: `front` looks at the face (+X right, +Z up), `back`, `right` (camera
|
|
79
|
+
at +X: image right is +Y), `left`, `top` (+X right, +Y up), `bottom`.
|
|
80
|
+
- A reference view is registered by two numbers: `pixels_per_metre`, and `origin_pixel` (the image column and row
|
|
81
|
+
where the world origin projects). Row 0 is the top of the image. Get them from a known dimension: measure the
|
|
82
|
+
subject's pixel extent along an axis whose length is known, divide, and place the origin from the ground line
|
|
83
|
+
and the centre line.
|
|
84
|
+
- Three-quarter or perspective references are not measured here. Solve their cameras with `bt-unwrap --analyze`
|
|
85
|
+
and measure the straight views.
|
|
86
|
+
- Objects whose names start with `_` (cutters, helpers) are ignored by every tool.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
# Domain references and helpers
|
|
91
|
+
|
|
92
|
+
Read the reference that matches the asset before step 3 (`references/<file>`). Each one has tested recipes,
|
|
93
|
+
measured numbers and a verification checklist. The Agent Reference's `unity-blender-cli.md` stays the
|
|
94
|
+
authority on the CLI, the API and export mechanics.
|
|
95
|
+
|
|
96
|
+
| Load | When the asset is |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `hard-surface.md` | manufactured: panels, cuts, sockets, grooves, bevel and holding-loop radii, weighted normals, trims and decals; rounded surfacing (design-line cages, a sharpness per line, zebra checks) |
|
|
99
|
+
| `vehicles.md` | something that drives, flies or floats: stance, lofted shells, rounded bodywork as one cage per side, wings and endplates as sections, wheels and tyres, the pivot hierarchy engines animate, LODs |
|
|
100
|
+
| `environments.md` | part of a place: modular kits on a grid, tiling UV0 plus lightmap UV, terrain tiles, collision proxies |
|
|
101
|
+
| `characters-and-creatures.md` | skinned: proportion charts, blockouts, deformation topology, hands and faces, modular parts |
|
|
102
|
+
| `rigging-and-animation.md` | moving: deform skeletons, engine-legal weights, clips, IK, retargeting, shape keys, mechanical rigs |
|
|
103
|
+
| `sculpting-and-retopology.md` | organic detail or a high poly to reduce: multires, remesh, QuadriFlow, shrinkwrap, high-to-low bakes, seam proof |
|
|
104
|
+
| `uv-and-pbr-materials.md` | getting textures: seams, texel density, lightmap UVs, PBR materials, bakes, ORM and Unity channel packing |
|
|
105
|
+
| `geometry-nodes.md` | made by rule: scatter, sweeps, curve arrays, and shipping instances (realised or GPU-instanced) |
|
|
106
|
+
| `procedural-generation.md` | one of many seeded variants: rocks, buildings, trees, tracks, plus LODs and colliders for each |
|
|
107
|
+
| `game-engine-export.md` | leaving Blender: the FBX and glTF option tables, LOD and collider naming, validation, engine symptoms |
|
|
108
|
+
| `art-style-and-genre.md` | given a look or genre: shape language, proportion, palette-atlas low poly, value checks, play-size reads |
|
|
109
|
+
|
|
110
|
+
Helper modules (`scripts/blender/`, importable in a `run` script; every function documented in its file):
|
|
111
|
+
|
|
112
|
+
| Module | Main functions |
|
|
113
|
+
|---|---|
|
|
114
|
+
| `hard_surface_panels` | `grid_plate`, `inset_recess`, `panel_groove`, `round_hole`, `boolean_cut` (the kit's), `mid_poly_finish`, `transfer_normals`, `corner_radius_in_section` |
|
|
115
|
+
| `hard_surface_trims` | `trim_strips`, `map_quad_strip`, `mesh_decal` |
|
|
116
|
+
| `vehicle_parts` | `wheel`, `wheel_profile`, `tread_lugs`, `radial_array`, `set_origin`, `mount_wheel`, `pivot_report`, `stations_from_outlines`, `stance_report`, `lod_chain` |
|
|
117
|
+
| `environment_kit` | `prism_piece`, `box_uv`, `lightmap_resolution`, `lightmap_uv`, `lightmap_report`, `convex_proxy`, `terrain_tile`, `seam_report`, `kit_report` |
|
|
118
|
+
| `character_blockout` | `humanoid_chart`, `skin_blockout`, `metaball_blockout`, `fit_height`, `symmetry_error` |
|
|
119
|
+
| `rigging_tools` | `build_armature`, `bind_auto`, `rigid_bind`, `make_engine_legal`, `weight_report`, `new_action`, `key_pose`, `stash_action`, `retarget_action`, `game_skeleton`, `export_rig`, the `GLTF_RIG_SETTINGS` / `UNITY_FBX_RIG_SETTINGS` presets |
|
|
120
|
+
| `retopology_tools` | `voxel_remesh`, `quadriflow`, `decimate_to`, `shrinkwrap_fit`, `multires_subdivide`, `displace`, `bake_high_to_low`, `topology_report`, `normal_seam_report` |
|
|
121
|
+
| `uv_layout` | `unwrap`, `box_project`, `pack`, `add_lightmap_uv`, `set_texel_density`, `overlap`, `self_overlap`, `island_gap_pixels` |
|
|
122
|
+
| `materials_pbr` | `principled_material`, `textured_material`, `bake_maps`, `pack_orm`, `unity_metallic_smoothness`, `hdrp_mask_map` |
|
|
123
|
+
| `geometry_nodes_builders` | `scatter_group`, `sweep_group`, `curve_array_group`, `add_modifier`, `set_input`, `instance_count`, `realize_to_mesh`, `instances_to_objects` |
|
|
124
|
+
| `procedural_generators` | `rock`, `building`, `space_colonization`, `lsystem_skeleton`, `skin_skeleton`, `closed_track_centerline`, `road_ribbon`, `variation_manifest` |
|
|
125
|
+
| `procedural_game_ready` | `lod_chain` (the kit's), `normal_deviation`, `convex_hull_collider`, `box_collider` |
|
|
126
|
+
| `style_palette` | `palette_image`, `palette_material`, `paint_faces`, `value_report`, `silhouette_pixel_height` |
|
|
127
|
+
| `image_measure`, `ortho_views` | masks, regions, traced outlines, line and circle fits, `corner_radius`; registered orthographic views and cameras |
|
|
128
|
+
| `reference_traces`, `evidence_sheet` | the `TraceSet` that `load_traces` returns and the trace-stamp check; labelled evidence sheets |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
# Workflow
|
|
133
|
+
|
|
134
|
+
Work through scripts saved to disk (`build_<asset>.py`), never by poking a live scene. A rebuild from the script
|
|
135
|
+
must give the same asset. Save the .blend after every step and keep each tool's JSON as evidence.
|
|
136
|
+
|
|
137
|
+
## 1. Asset brief
|
|
138
|
+
|
|
139
|
+
Write `brief.md` beside the build script before touching Blender:
|
|
140
|
+
- what it is and where it is seen: in-game camera distance, field of view and screen height, or the pixel height
|
|
141
|
+
it occupies on screen;
|
|
142
|
+
- forward axis, overall length x width x height in metres, and which dimension is known for certain;
|
|
143
|
+
- 3 to 6 primary masses, each with its shape language (rounded / tapered / faceted / moulded / tubular) and the
|
|
144
|
+
kit tool that builds it (see the form table in step 5);
|
|
145
|
+
- the hero features that must read at gameplay size, and what can be texture instead of geometry;
|
|
146
|
+
- a face budget, the material list (5 to 8 sampled colours), and the export target (glTF for BabylonJS, FBX for
|
|
147
|
+
Unity).
|
|
148
|
+
|
|
149
|
+
## 2. References and the view-consistency check
|
|
150
|
+
|
|
151
|
+
1. Put the straight views in `refs/` and write `refs/spec.json` (format below) with `pixels_per_metre` and
|
|
152
|
+
`origin_pixel` for each view, plus `"known_dimensions": {"x": ..., "y": ..., "z": ...}` from the brief.
|
|
153
|
+
2. Run `view-consistency --spec refs/spec.json`. It compares every pair of views that share a world axis, grades
|
|
154
|
+
the size difference like a station, flags views whose ends disagree by more than `--registration-tolerance`
|
|
155
|
+
(1 cm; usually a wrong origin pixel), and checks the known dimensions.
|
|
156
|
+
3. Any WRONG pair must be settled before fitting: fix a registration, or decide which view wins on that axis and
|
|
157
|
+
write the decision and the reason into the brief. Fitting a model to views that disagree makes every station
|
|
158
|
+
argue with another one.
|
|
159
|
+
|
|
160
|
+
## 3. Blueprint and trace: mandatory before any geometry
|
|
161
|
+
|
|
162
|
+
Model ON the references, never from numbers typed from them. Professionals set the views up as blueprints at real
|
|
163
|
+
scale, trace the outlines and build the surfaces on the traced curves. Here that is two tools and a stamp:
|
|
164
|
+
|
|
165
|
+
1. `blueprint --spec refs/spec.json --out blueprint.blend`. Every view becomes an image plane in its own view plane,
|
|
166
|
+
at the exact scale and position of its registration, behind the subject, low opacity, visible only in its own
|
|
167
|
+
axis-aligned view. Each view gets an orthographic camera, and a wire box marks the known dimensions. The build
|
|
168
|
+
script starts with `kit.load_blueprint("blueprint.blend")`. With `--model asset.blend` it also writes
|
|
169
|
+
`blueprint_<view>.png`, the model drawn over each reference at world scale.
|
|
170
|
+
2. `trace --spec refs/spec.json --out refs/traces.json [--curves refs/curves.json]`. It writes every view's outline,
|
|
171
|
+
in pixels and in world metres on the view plane, and `trace_<view>.png` previews. Pick the design lines in pixels
|
|
172
|
+
in `curves.json` (top line, shoulder line, plan edge, a flank's crease), and pair a curve with a second view for
|
|
173
|
+
3D points (format in the tool's `--help`). Check the previews: a traced outline that misses the subject is fixed
|
|
174
|
+
here (crop, `background_tolerance`), never later in the model.
|
|
175
|
+
3. The build script reads `traces = kit.load_traces("refs/traces.json")`. Blockout sections, loft stations, cage
|
|
176
|
+
design lines and tube paths come from `traces.curve(name)` and `traces.outline_boundary(view, axis, value,
|
|
177
|
+
side)`, never from hand-typed tables. Then `kit.stamp_traces(parts, "refs/traces.json")`.
|
|
178
|
+
4. Put `"require_traces": "traces.json"` in the spec. From then on `world-gate` and `measure-stations` fail any
|
|
179
|
+
measured part that is not stamped with the current traces file, and re-tracing makes the old stamps stale.
|
|
180
|
+
|
|
181
|
+
**Parts and coverage.** When the asset is built as parts (body, nose, flanks, pods), draw each part's region on
|
|
182
|
+
the whole-asset references in `coverage.json` and pass `coverage-check --reference refs/left.png --reference
|
|
183
|
+
refs/top.png --parts coverage.json --out coverage.png` (99 % of the silhouette by default) before building. Its
|
|
184
|
+
unclaimed regions are the parts nobody was going to build.
|
|
185
|
+
|
|
186
|
+
## 4. Blockout of the whole silhouette, then the primitive gate
|
|
187
|
+
|
|
188
|
+
Block the WHOLE asset first: every primary mass at its traced size, on the traced curves, with the kit's lofts,
|
|
189
|
+
spins and tubes (coarse: 3 to 5 stations, 2 segments per corner). No region of any view may be left for later. Run
|
|
190
|
+
`overlay-sheet --spec refs/spec.json --model blockout.blend --out blockout_sheet.png`, `world-gate` and
|
|
191
|
+
`review-render`. The blockout passes when every view's IoU is at least 0.85, the sheet shows no large missing
|
|
192
|
+
(red) or extra (blue) region in any view, and the proportions read right.
|
|
193
|
+
|
|
194
|
+
**Gate: no new primitives after the blockout.** Record the blockout's object list in the brief. From here on,
|
|
195
|
+
objects are only refined (more stations, radii, cages, bevels, details on existing parts). A new object needs a
|
|
196
|
+
line in the brief that says what it is and why the blockout missed it. Piling primitives onto a failing shape
|
|
197
|
+
hides the real error. Re-measure instead.
|
|
198
|
+
|
|
199
|
+
## 5. Construction with the kit
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
import construction_kit as kit # run with: node <skill>/scripts/bt-blender.mjs run build_asset.py
|
|
203
|
+
|
|
204
|
+
kit.clear_default_scene() # --factory-startup loads a default Cube; never measure it
|
|
205
|
+
kit.load_blueprint("blueprint.blend") # the references at world scale (helpers start with "_")
|
|
206
|
+
traces = kit.load_traces("refs/traces.json")
|
|
207
|
+
stations = []
|
|
208
|
+
for y in station_positions: # wherever the traced outlines change
|
|
209
|
+
width = 2 * traces.outline_boundary("top", "y", y, "max")
|
|
210
|
+
height = traces.outline_boundary("left", "y", y, "max")
|
|
211
|
+
stations.append((y, kit.rounded_section(width, height, 0.08, 0.03, segments=6)))
|
|
212
|
+
shell = kit.loft("Shell", stations)
|
|
213
|
+
kit.shade_smooth(shell, design_line_edges=cap_rims)
|
|
214
|
+
kit.stamp_traces([shell], "refs/traces.json")
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
| Form | Build it with |
|
|
218
|
+
|---|---|
|
|
219
|
+
| Rounded hard-surface bodies, housings, nose cones | `rounded_section` per station + `loft`. Put a station wherever the form changes. Width from the top view, height from the side view, corner radii from the front view. |
|
|
220
|
+
| Turned parts: wheels, knobs, bottles, nozzles | `profile_spin` with the traced (radius, height) profile |
|
|
221
|
+
| Struts, rails, pipes, handles, hoops | `curve_tube` through traced centre-line points (radius may taper) |
|
|
222
|
+
| Blends and junctions: pods, cheeks, intakes | a light quad cage + `subdivision_cage` with `holding_corner_radius` and `shrink_targets` |
|
|
223
|
+
| Rolled panels that flow into each other: bodywork, a nose with its cheeks and pods | `design_line_cage` on the traced design lines (a sharpness per line, one cage for everything that flows together) + `cage_audit` + `subdivision_cage` level 2, then zebra (`hard-surface.md` §3a) |
|
|
224
|
+
| Faceted, machined parts | box or loft + `bevel_edges` sized from the measured radius |
|
|
225
|
+
| Moulded parts read from one side silhouette | `sdf_inflate` from the side-view mask |
|
|
226
|
+
| Symmetric parts | build one half, `mirror` |
|
|
227
|
+
|
|
228
|
+
Kit API (`scripts/blender/construction_kit.py`; lengths in metres, every function documented in the file):
|
|
229
|
+
|
|
230
|
+
| Function | Notes |
|
|
231
|
+
|---|---|
|
|
232
|
+
| `clear_default_scene()` | empty scene (factory startup adds Camera, Cube, Light) |
|
|
233
|
+
| `rounded_section(width, height, corner_radius_top, corner_radius_bottom, segments=5, keystone=1.0)` | closed (x, z) section, x = -w/2..w/2, z = 0..height; radii in metres, clamped to fit; same `segments` gives the same point count and start point, so sections loft together. With keystone != 1 the widest point lies on the fillet, so the measured width is slightly under `width`. |
|
|
234
|
+
| `translate_section(points, x=0.0, z=0.0)` | move a section (e.g. a station's floor height) |
|
|
235
|
+
| `loft(name, stations, cap_ends=True, cap_style="quad")` | stations = [(y, section)], y strictly increasing; straight between stations, so it never bulges past a measurement. Caps are quad grids (no pole; an odd point count falls back to a fan); `cap_style="fan"` is the cheapest cap for a loft that is never subdivided |
|
|
236
|
+
| `profile_spin(name, profile_points, steps=32, axis='Z')` | (radius, height) profile; radius 0 becomes a pole of valence `steps`: never subdivide it (loft circular sections instead) |
|
|
237
|
+
| `curve_tube(name, points, radius, resolution=8, path_subdivisions=4, cap_ends=True, cap_style="quad")` | centripetal Catmull-Rom through every point, twist-free frames; radius per point allowed; quad caps for an even resolution |
|
|
238
|
+
| `design_line_cage(name, lines, row_names=None, creases=None, holding=None, fair_passes=0)` | `lines` = {name: (stations, 3) points} in order across the panel: the quad grid between them, so every edge is on a design line. `creases` / `holding` = {line or station name: value} write `crease_edge` (1.0 also sharp) and `bevel_weight_edge`; fairing skips crisp lines. Returns (object, {"lines", "rows": edge indices per name, "audit"}) |
|
|
239
|
+
| `cage_audit(obj)` | before subdividing: {"faces", "non_quads", "poles" (interior valence other than 4, with world positions), "max_edge_ratio", "max_edge_ratio_at"} |
|
|
240
|
+
| `subdivision_cage(obj, levels=1, holding_loop_width=None, crease_edges=None, shrink_targets=None, holding_edges=None, station_axis="Y", max_iterations=4, tolerance_percent=0.5, holding_corner_radius=None, clamp_overlap=True)` | creases already on the cage are honoured (`creased_edges` in the result counts them); holding loops are a 2-segment, profile 1.0 weight-limited bevel: the subdivided corner radius is 0.57 x the loop width at every level and the outer size stays exact, so give `holding_corner_radius` (loop width = r / 0.57). `shrink_targets` = [{"position", "width", "height"}]: the cage is scaled until the subdivided surface meets them; each round solves all stations together, and one round normally converges. Returns {"modifiers", "holding_loop_width", "creased_edges", "shrink", "holding_check"}. `holding_check` gives the loop width the bevel really got, the effective radius and folded faces, and a warning is raised when Clamp Overlap (global per object) shrank the loops; `clamp_overlap=False` turns the clamp off. |
|
|
241
|
+
| `bevel_edges(obj, edge_indices_or_weight, width, segments, profile=0.5, harden_normals=True)` | weight-limited bevel; width = measured radius, 3 to 4 segments for soft rounds, 1 to 2 for chamfers |
|
|
242
|
+
| `shade_smooth(obj, design_line_edges=None, sharp_angle_degrees=None)` | all faces smooth, sharp only on design lines; clears stale custom normals. Returns the sharp-edge count: 0 on a part with cuts means the marking missed. |
|
|
243
|
+
| `weld(obj, distance, keep_normals=True)` | merge by distance and copy the corner normals back, so split hard edges stay hard |
|
|
244
|
+
| `mirror(obj, axis="X", merge_distance=0.0001)` | Mirror modifier with clipping |
|
|
245
|
+
| `apply_modifiers(obj)` | bake the stack, keeping every data layer; Geometry Nodes instances are realised, not dropped |
|
|
246
|
+
| `boolean_cut(obj, cutters, solver="EXACT")` | normals recalculated on both sides first, cutters hidden; returns rim edges and the volume before / after |
|
|
247
|
+
| `radial_array(obj, count, axis="X")` / `lod_chain(obj, ratios=(0.5, 0.25))` | copies around the object origin; `_LOD0.._LODn` siblings with LOD0's normals transferred (`copy_object`, `lod_base_name`) |
|
|
248
|
+
| `evaluated_volume(obj)` / `edges_between(obj, faces_a, faces_b)` | closed-mesh volume of the evaluated mesh; the edges two face sets share |
|
|
249
|
+
| `smart_unwrap(obj, angle_limit_degrees=66.0, island_margin=0.02)` | Smart UV Project with a full headless context |
|
|
250
|
+
| `set_edge_values(obj, attribute, values)` | write `bevel_weight_edge` / `crease_edge` values |
|
|
251
|
+
| `world_vertices(obj, evaluated=True)` | world-space vertices; measure with these, never `bound_box` |
|
|
252
|
+
| `section_points(objects, position, axis="Y")` / `section_extent(objects, position, axis="Y", measure_axis="X")` | the exact cross-section at a station |
|
|
253
|
+
| `sdf_inflate(name, mask, pixels_per_metre, width, corner_radius, exponent=2.5, origin_pixel=None, voxel_size=None, rounding_mask=None, recess_depth=None, field_blur_pixels=0.0)` | right-view mask (image right +Y, up +Z) inflated along X into a closed, manifold solid |
|
|
254
|
+
| `load_blueprint(path)` | append the `blueprint` tool's `_Blueprint` collection (image planes, view cameras, reference box) into the scene |
|
|
255
|
+
| `load_traces(path)` | the `trace` tool's `traces.json` as a `TraceSet`: `.curve(name)` / `.curves` ((N, 3) world points), `.outline(view)` (plane coordinates), `.outline_points(view, depth)`, `.outline_boundary(view, axis, value, side="max")` (e.g. the side view's top line at a length station, or the top view's half-width), `.outline_extent(view, axis, value)`, `.extent(view)`, `.sha256` |
|
|
256
|
+
| `stamp_traces(objects, path)` | write the traces file's SHA-256 to each part's `bt_traces` property; the trace gate checks it |
|
|
257
|
+
|
|
258
|
+
Modifier order for subdivision builds: Mirror, then booleans (one cutter object, overlapping on every axis,
|
|
259
|
+
manifold, scale applied), then holding loops / bevel, then Subdivision, then Weighted Normal last if it is used
|
|
260
|
+
at all. Never put face-area weighted normals on a curved surface: they flatten every facet.
|
|
261
|
+
|
|
262
|
+
## 6. Measure
|
|
263
|
+
|
|
264
|
+
Run these after EVERY construction pass. Judge the whole shape in every view on the overlay sheet before any
|
|
265
|
+
detail, then fix the worst WRONG station first:
|
|
266
|
+
|
|
267
|
+
- **Whole silhouette, every view**: `overlay-sheet --spec refs/spec.json --model asset.blend --out sheet.png`
|
|
268
|
+
(or `--pair name=reference.png,capture.png` for captures from the game's locked cameras, perspective included).
|
|
269
|
+
Each tile shows the reference outline (amber) and the model outline (cyan), missing regions in red and extra
|
|
270
|
+
regions in blue, with IoU, reference-only and model-only percentages and the largest missing / extra regions.
|
|
271
|
+
A big red blob is a region nobody built: fix it before touching anything smaller.
|
|
272
|
+
|
|
273
|
+
- **Stations**: `measure-stations --spec refs/spec.json --model asset.blend`. Each station's silhouette extent is
|
|
274
|
+
graded **MATCH** (<= 3 % or <= 1 cm), **CLOSE** (<= 6 %) or **WRONG** (> 6 %). MISSING means one side has no
|
|
275
|
+
silhouette there. Exit 1 while any station or corner is WRONG or MISSING. The evidence image puts reference,
|
|
276
|
+
model and overlay side by side, with station lines coloured by grade.
|
|
277
|
+
- **Corner radius**, graded within 15 %. On reference images and `frame` captures, by circle fit: the flats
|
|
278
|
+
beside a corner are fitted as lines, the outline points more than 1 px off both flats form the arc, and a Kasa
|
|
279
|
+
fit refined by Gauss-Newton gives the radius. On the model, by **equal depth**: the distance d from the flats'
|
|
280
|
+
corner to the section gives r = d / (1 / sin(a / 2) - 1), because a subdivided corner is not a circle (a 0.05 m
|
|
281
|
+
corner read 0.0499 by equal depth, 0.0449 by circle fit). The report keeps both (`model_radius_method`,
|
|
282
|
+
`model_circle_fit_radius_m`). Ask for corners in the spec (`"corners": [{"name", "quadrant", "region"}]`).
|
|
283
|
+
- **Shading continuity**: the largest dihedral across smooth edges of the evaluated mesh (`--max-dihedral`, 20
|
|
284
|
+
degrees), plus luminance ramps across rolls (`"ramps"`). A ramp that steps in one pixel is a crease where the
|
|
285
|
+
reference rolls.
|
|
286
|
+
- **World-scale silhouette gate**: `world-gate --spec refs/spec.json --model asset.blend`. IoU per view (pass at
|
|
287
|
+
`--min-iou` 0.9), reference-only and model-only percentages, band-by-band width differences and registration
|
|
288
|
+
(size ratios and centre offsets in metres), with a diff image.
|
|
289
|
+
- **In-game review render**: `review-render --model asset.blend --out review --pixel-height <px>` (or
|
|
290
|
+
`--distance <m> --fov <deg>`, `--screen-height` 1080). It renders the clay / parts / wire contact sheet and the
|
|
291
|
+
asset at its real on-screen height, with a 4x enlargement. Judge the hero features at that size. Detail that
|
|
292
|
+
does not survive there belongs in the texture.
|
|
293
|
+
|
|
294
|
+
Grade honestly. Never move a reference registration or a station to make a number pass. Fix the model, or record
|
|
295
|
+
the decision in the brief.
|
|
296
|
+
|
|
297
|
+
## 7. QA
|
|
298
|
+
|
|
299
|
+
- `qa-check --model asset.blend [--profile web|game|render|print] [--allow-floating Decal] [--uv-map UVLightmap|1]
|
|
300
|
+
[--allow-uv-overlap Wall Floor]`. The profile sets which
|
|
301
|
+
checks are errors (`web` is the strictest for BabylonJS and the default; `game` treats stacked UVs as a warning;
|
|
302
|
+
`print` adds manifold rules). It checks:
|
|
303
|
+
- z-fighting and hidden back-to-back faces;
|
|
304
|
+
- floating parts: an island must connect to the main body through contacts (vertex contact or a triangle
|
|
305
|
+
overlap, both always tested), and enclosed parts are listed on their own;
|
|
306
|
+
- inside-out closed parts, and edges between faces with opposite winding;
|
|
307
|
+
- non-manifold, boundary, degenerate, duplicate and loose geometry;
|
|
308
|
+
- unapplied or negative scale;
|
|
309
|
+
- UVs: missing, zero-area, overlapping, out of range, on the active map or the one `--uv-map` names;
|
|
310
|
+
`--allow-uv-overlap` makes overlap a warning for tiling or mirrored maps on the objects listed;
|
|
311
|
+
- skin weights: unweighted vertices, more than 4 influences;
|
|
312
|
+
- materials: faces on empty slots, unused slots, missing textures, colour and data maps tagged with the wrong
|
|
313
|
+
colour space.
|
|
314
|
+
- `assembly-check --model asset.blend [--spec assembly.json] [--root Body]`. Every island is a part. It reports:
|
|
315
|
+
- floating groups, with the gap in metres to the main body (the group holding the largest part, or `--root`);
|
|
316
|
+
- contacts, with their penetration depth;
|
|
317
|
+
- closed parts whose normals point inward (corrected for mirrored objects);
|
|
318
|
+
- the spec's overall and per-part sizes, from world-space vertices;
|
|
319
|
+
- required attachments (`attached_to`); an unknown name is an error;
|
|
320
|
+
- intended overlaps (`expect_embedded`), which are not reported.
|
|
321
|
+
|
|
322
|
+
```json
|
|
323
|
+
{ "units": "cm", "contact_tolerance": 0.1, "root": "Body",
|
|
324
|
+
"overall": {"dims": [42, 30, 18], "tolerance": 1},
|
|
325
|
+
"parts": {"Hatch": {"dims": [12, 10, null], "attached_to": ["Body"]}},
|
|
326
|
+
"expect_embedded": [["Bolt*", "Plate"]] }
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## 8. Export
|
|
330
|
+
|
|
331
|
+
`export --model asset.blend --out build/asset.glb` (or `.gltf`, or `.fbx`; `--format` overrides the extension):
|
|
332
|
+
- **Geometry Nodes instances** are dropped by every exporter, so an object that makes them fails the export
|
|
333
|
+
unless `--realize` (baked into its mesh) or `--gpu-instances` (linked duplicates, `EXT_mesh_gpu_instancing`)
|
|
334
|
+
is given. Objects that evaluate to no mesh (an empty or profile-only curve) are left out and listed in
|
|
335
|
+
`skipped_objects`.
|
|
336
|
+
- **glTF / GLB**:
|
|
337
|
+
- exported with modifiers applied, Y up; a rig gets `rigging_tools.GLTF_RIG_SETTINGS` (one animation per NLA
|
|
338
|
+
track, 4 influences, the skin kept);
|
|
339
|
+
- tangents on by default (`--tangents on|auto|off`; `auto` = only with a normal map);
|
|
340
|
+
- `--draco [0-10]` (default 6) or `--meshopt` (`EXT_meshopt_compression`) for geometry, `--webp` for textures;
|
|
341
|
+
the round trip allows for their quantisation;
|
|
342
|
+
- every float image a material uses is swapped, in memory only, for an 8-bit copy: colour images get the sRGB
|
|
343
|
+
curve and data images keep their values (see the traps).
|
|
344
|
+
- **FBX (Unity, the guide's §8.2a case table)**: -Z forward, Y up, `FBX_SCALE_UNITS`, no leaf bones, normals
|
|
345
|
+
only. The space transform is baked only for a static Blender mesh; an animated object bakes its animation as
|
|
346
|
+
one scene take; a rig gets `rigging_tools.UNITY_FBX_RIG_SETTINGS` (deform bones only, every action);
|
|
347
|
+
`--source unity` (a file that came from Unity) never bakes. The report says which case applied.
|
|
348
|
+
- **Round trip**: the file is re-imported into an empty scene and its world size compared with the source (0.1 %
|
|
349
|
+
or 0.5 mm).
|
|
350
|
+
- **glTF summary**: nodes, meshes, primitives, triangles, materials, textures, image types, vertex attributes,
|
|
351
|
+
animations, skins and extensions.
|
|
352
|
+
- **Khronos glTF-Validator** through `scripts/validate_gltf.mjs`, ignoring `UNUSED_OBJECT`. Any error fails the
|
|
353
|
+
export. Without Node or the package, validation is reported as skipped and the export still passes.
|
|
354
|
+
- The report is `<out name>.export.json`. Run `validate-gltf <file>` alone on any glTF.
|
|
355
|
+
|
|
356
|
+
## 9. Traps (re-verified on Blender 5.3.0)
|
|
357
|
+
|
|
358
|
+
| Trap | 5.3.0 result | What the skill does |
|
|
359
|
+
|---|---|---|
|
|
360
|
+
| `--factory-startup` loads Camera, Cube and Light | **Confirmed** | `clear_default_scene()`; the tools load models into an empty scene |
|
|
361
|
+
| A linear float bake reaches the glTF without the sRGB curve (far too dark) | **Confirmed for a packed float image**: linear 0.2 exported as byte 51 instead of 124. An unsaved or EXR-saved float image exported correctly. | `export` converts every float image to 8-bit first (tested: 124) |
|
|
362
|
+
| `bound_box` is the local box; `obj.dimensions` is local too | **Confirmed**: a 1 m sphere rotated 45 degrees reads 1.414 m from `bound_box` | measure with `world_vertices` / evaluated world vertices everywhere |
|
|
363
|
+
| Merge by distance destroys split-edge hard shading | **Confirmed**: welding a split cube smooths it (54.7 degrees off). Existing custom normals survive a bmesh weld. | `weld()` copies the corner normals back (0 degrees) |
|
|
364
|
+
| Decimation drops custom normals | **Not reproduced**: the layer survives the Decimate modifier, but corner deviation grew from 30.5 to 43.8 degrees | re-run `shade_smooth` / `weld` after decimating, then re-check |
|
|
365
|
+
| Lightmap pack margin silently clamped | **Confirmed**: `PREF_MARGIN_DIV` is hard-limited to 0.001..1.0; 2.0 returns FINISHED with the same UVs as 1.0 | keep the margin at or under 1.0 and check the result |
|
|
366
|
+
| MANIFOLD boolean on flipped faces | **Confirmed, worse than reported**: one flipped face gives an EMPTY result with no error; all faces flipped gives an inverted solid (negative volume); EXACT gives a wrong volume | recalculate normals on target and cutter first; check the face count and volume after (`assembly-check` flags empty results and inverted parts) |
|
|
367
|
+
| Static FBX gets an empty animation take | **Not reproduced**: no AnimationStack or curves with `bake_anim` on or off | `export` sets `bake_anim` only when something is animated |
|
|
368
|
+
| `shade_smooth_by_angle` headless needs a context | **Confirmed**: object-only or no override returns CANCELLED and marks 0 edges | `shade_smooth()` works on mesh data, no operator |
|
|
369
|
+
| One-segment holding loops do not set a predictable radius | **Confirmed**: radius 2.3x to 5.2x the loop width, varying with the width | 2 segments at profile 1.0: radius 0.57 x width at levels 1 to 3, outer size exact |
|
|
370
|
+
| Exporters and `modifier_apply` drop Geometry Nodes instances | **Confirmed**: a ground with 108 scattered rocks exported 200 triangles, and the size round trip passed | `export` fails it without `--realize` / `--gpu-instances`; `apply_modifiers` realises |
|
|
371
|
+
| A curve whose nodes make no mesh has no `to_mesh()` | **Confirmed**: `None` for an empty curve and an instance-only curve (the export crashed) | `export` skips them and lists them |
|
|
372
|
+
| `matrix_world` is stale after setting `location` | **Confirmed**: translation still (0, 0, 0); a re-origin moved geometry 3 m, a radial array spread 7.9 m | helpers call `view_layer.update()` before reading it |
|
|
373
|
+
| FBX `ignore_leaf_bones` drops the last bone of every chain | **Confirmed**: Root-Mid-Tip imported as Root-Mid | tools re-import with it only when the file has `_end` bones |
|
|
374
|
+
| Bevel Clamp Overlap is global per object | **Confirmed**: an 8 mm slab took 4 mm loops to 2.28 mm on every edge | `subdivision_cage` reports `holding_check` and warns |
|
|
375
|
+
| A circle fit misreads a subdivided corner | **Confirmed**: 0.0449 for a 0.05 m corner (equal depth: 0.0499) | model corners are measured by equal depth |
|
|
376
|
+
| A copied tiling UV0 folds inside a lightmap | **Confirmed**: 349-448 texels overlapped on box-mapped kit pieces | `add_lightmap_uv` re-projects when `self_overlap` > 0 |
|
|
377
|
+
| The glTF importer adds a bone-shape object to a skinned file | **Confirmed**: a 2 m Icosphere made a 0.4 m rigged part re-import as 2.4 m | imports pass `disable_bone_shape=True` |
|
|
378
|
+
| Meshopt quantises positions | **Confirmed**: 2.2 mm on a 10 m piece (Draco 14 bit: under 1 mm) | the round trip allows for it |
|
|
379
|
+
|
|
380
|
+
More 5.3.0 traps (decimate ratio, bump distance, KTX2 fallback, slotted actions, rigify, QuadriFlow, sculpt
|
|
381
|
+
operators, FBX takes) are in the guide's §6.1 and in each domain reference.
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
# Stations spec
|
|
386
|
+
|
|
387
|
+
Paths are relative to the spec file. `measure-stations`, `world-gate`, `view-consistency`, `blueprint`, `trace`
|
|
388
|
+
and `overlay-sheet` share it.
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"model": "asset.blend",
|
|
393
|
+
"objects": ["Shell"],
|
|
394
|
+
"known_dimensions": {"x": 0.46, "y": 1.0, "z": 0.30},
|
|
395
|
+
"require_traces": "traces.json",
|
|
396
|
+
"views": [{
|
|
397
|
+
"name": "front", "view": "front", "image": "front.png",
|
|
398
|
+
"pixels_per_metre": 1000, "origin_pixel": [400, 450],
|
|
399
|
+
"crop": [0, 0, 800, 500], "background_tolerance": 0.08,
|
|
400
|
+
"frame": "captures/front.png",
|
|
401
|
+
"stations": {"axis": "z", "count": 6, "positions": [0.12]},
|
|
402
|
+
"corners": [{"name": "shoulder", "quadrant": "top_right", "region": [520, 180, 700, 330]}],
|
|
403
|
+
"ramps": [{"name": "roll", "axis": "z", "position": 0.25}]
|
|
404
|
+
}]
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
- `stations.axis` is one of the view's two image axes; each station measures the silhouette across it.
|
|
409
|
+
- `frame` (optional) replaces the model render with a capture from the game's own locked camera. Use it to judge
|
|
410
|
+
the asset where it is actually seen.
|
|
411
|
+
- `require_traces` (optional, set once the traces exist): `world-gate` and `measure-stations` fail, without
|
|
412
|
+
measuring, while any measured object lacks a `bt_traces` stamp matching that file's current SHA-256
|
|
413
|
+
(`kit.stamp_traces`). The message names the unstamped and stale parts.
|
|
414
|
+
- `world-gate` also runs on a single view without a spec:
|
|
415
|
+
`--image --view --pixels-per-metre --origin-pixel [--crop]`.
|
|
416
|
+
|
|
417
|
+
# Outputs
|
|
418
|
+
|
|
419
|
+
| Tool | Writes |
|
|
420
|
+
|---|---|
|
|
421
|
+
| `view-consistency` | `view_consistency.json` (spec folder or `--out`) |
|
|
422
|
+
| `blueprint` | the blueprint `.blend`, `<out>.json` (registration per view); with `--model`, `blueprint_<view>.png` |
|
|
423
|
+
| `trace` | `traces.json`, `trace_<view>.png` |
|
|
424
|
+
| `coverage-check` | the picture (`--out`) and `<out>.json`: coverage, unclaimed regions, overlaps per reference |
|
|
425
|
+
| `overlay-sheet` | the sheet (`--out`) and `<out>.json`: IoU, missing / extra percentages and regions per view |
|
|
426
|
+
| `measure-stations` | `stations_evidence/stations.json`, `stations_<view>.png` |
|
|
427
|
+
| `world-gate` | `world_gate/world_gate.json`, `diff_<view>.png` |
|
|
428
|
+
| `review-render` | `review_sheet.png`, `gameplay_<N>px.png`, `gameplay_<N>px_x4.png` |
|
|
429
|
+
| `qa-check`, `assembly-check` | the JSON result; `--out` also writes it to a file |
|
|
430
|
+
| `export` | the model, its textures (`.gltf`), `<name>.export.json` |
|
|
431
|
+
|
|
432
|
+
Every tool prints exactly one JSON result line, with `"ok"` (it ran) and `"pass"` (its gate passed).
|
|
433
|
+
Read the JSON; do not parse the log.
|
|
434
|
+
|
|
435
|
+
# Limits
|
|
436
|
+
|
|
437
|
+
- Straight orthographic views only for the registered tools. Perspective and three-quarter references go through
|
|
438
|
+
`bt-unwrap --analyze`; `overlay-sheet --pair` compares any locked-camera capture with its reference, unregistered.
|
|
439
|
+
- `trace` follows pixel edges, so a traced outline is as good as the reference image: anti-aliased edges, drop
|
|
440
|
+
shadows and drawn lines move it by their width. Read the previews.
|
|
441
|
+
- Subject masks come from the background colour at the image border. Busy or gradient backgrounds need a `crop`,
|
|
442
|
+
or a clean silhouette image.
|
|
443
|
+
- `qa-check` samples UV overlap on a 128 x 128 raster, so overlaps below one texel can be missed.
|
|
444
|
+
- Sculpting, remeshing, retopology and high-to-low bakes are covered by `references/sculpting-and-retopology.md`
|
|
445
|
+
(`retopology_tools`). bt-unwrap still repairs and re-textures AI-generated or imported meshes; skins are
|
|
446
|
+
bt-atlas's.
|
|
447
|
+
|
|
448
|
+
See `THIRD_PARTY_NOTICES.md` for the MIT code this skill adapts and the ideas it credits.
|