Gates¶
Four of the views model_gate.py renders for one model: a fit view, the model beside a 1.4 m person, a close-up from 0.5 m, and a diagnostic view. In a diagnostic view every visible back face is painted magenta. This one shows none.
A gate is a review that work must pass before the next step. This page covers the model gate's two scripts, the files they read and write, and which tool feeds which reviewer.
The five gates around the build¶
| Gate | Reviewer | Judges | Tools that feed it |
|---|---|---|---|
| Model | asset-reviewer | one model alone, from its file, before import | model_gate.py, asset_gate.py |
| Placement | dressing-reviewer | what each build pass placed, and how | all of PropGate, ZFightScan, asset_gate.py check, WorldCapture |
| Runtime | playtest-reviewer | everything that runs, in play mode | WorldAudit, ParticleAudit, WorldCapture in play mode |
| Surface | material-reviewer | materials, shaders and textures in the scene's own light | UnlitPropAudit, WorldAudit, WorldCapture |
| Final | final-reviewer | lighting, bake quality, final polish | WorldAudit, ZFightScan, WorldCapture, the UV2 audit |
Before these five, the layout-reviewer is the gate for structure.
Every gate also re-shoots the findings ledger cases in its scope. The Unity tools are on Unity checks.
The model gate, step by step¶
flowchart TD
a[A model is delivered<br/>one model per FBX file] --> b[Deliverer writes the sidecar<br/>stem.model.json]
b --> c["asset_gate.py sidecar<br/>validates it"]
c --> d["asset-reviewer runs model_gate.py<br/>measure.json and views"]
d --> e["asset_gate.py sheet<br/>one sheet of all views"]
e --> f{Verdict}
f -- NEEDS WORK or MINOR FIXES --> a
f -- SHIP IT --> g["asset_gate.py add<br/>one registry row"]
g --> h["world-builder runs asset_gate.py check"]
h -- PASS --> i[Import and place]
h -- BLOCKED --> a
A model file enters a scene only when its sha256 hash has a SHIP IT row in the registry. A sha256 is a fingerprint of the file's bytes: change the file and the fingerprint changes.
The sidecar: <stem>.model.json¶
Whoever delivers a model writes this small file beside it. It declares what the checks cannot guess.
{"front": "+Z", "real_size_m": [0.42, 0.40, 0.85], "size_factor": 1.0, "pivot": "base",
"joints": [{"name": "RingEnd", "point": [0.0, 1.62, 0.0], "attaches_to": "ring on the post",
"max_gap_m": 0.002, "embed_m": 0.02}]}
| Key | Required | Meaning |
|---|---|---|
front |
yes | +Z, -Z, +X, -X or none: the local axis the front faces. Kit-made files use +Z |
real_size_m |
yes | [w, d, h] of the real object in metres: width across the front, depth, height |
joints |
yes, [] when it attaches to nothing |
one entry per thing the model attaches to: name, point, attaches_to, max_gap_m (default 0.002), embed_m (default 0.02) |
size_factor |
no, 1.0 | file size divided by real size: 1.0 for furniture, the world's scale factor for a file modelled smaller |
pivot |
no, base |
base, mount, hang or center |
min_view_m, min_view_reason |
no, 0.5 | the closest a player can get, with the reason when above 0.5 |
All values are in the Unity frame of the imported file: metres, Y up, +Z forward.
Each joint is also an empty object in the model file, named exactly Joint_<name>.
model_gate.py: measure and render¶
It runs inside headless Blender, through the kit's blender tool:
python .omp/scripts/tool.py blender --script .omp/skills/asset-import/scripts/model_gate.py -- \
--model <file.fbx|.glb|.obj> --out <dir> [--json <stem>.model.json] \
[--base-z 0.0] [--eye 1.3] [--focus=x,y,z ...] [--no-render]
| Flag | Meaning |
|---|---|
--model |
the model file. One model per file |
--out |
the output folder |
--json |
the sidecar. Without it, the sidecar beside the file is read |
--base-z |
height of the model's lowest point above the floor as placed: 0 on the floor, 0.75 on a table |
--eye |
eye height for the views, default 1.3 |
--focus |
an extra 0.5 m close-up at a point, for an inside, a handle, a label or a knot |
--no-render |
measure only |
--selftest |
builds a known-bad model and checks that the tool catches it |
It writes <out>/measure.json and <out>/views/*.png, and prints one MODEL_GATE ... line.
The views:
| Files | Show |
|---|---|
a_fit_* |
front, back, sides at eye height, 45° above, 45° below, top |
b_scale_person_1p4m |
the model beside a 1.4 m person |
c_close*_0p5m |
close-ups from 0.5 m: front, back, above, behind-above, below |
d_joint_* |
each declared joint from 0.3 m, the point marked red |
e_diag_* |
14 directions, every visible back face magenta |
Look renders use back-face culling, as Unity does. A hole or a flipped face shows the background.
measure.json holds, among others: tris, material_slots, open_edges, non_manifold_edges, inward_faces, coplanar_overlapping_pairs, size_wdh_measured_m and joints.
Prove the tool first. Once per session the reviewer runs:
python .omp/scripts/tool.py blender --script .omp/skills/asset-import/scripts/model_gate.py -- --selftest --out <tmp>
It must print MODEL_GATE SELFTEST PASS. On FAIL there are no verdicts.
asset_gate.py: the registry¶
asset_gate.py sha <file>...
asset_gate.py sidecar <file>...
asset_gate.py check --project <p> <file>...
asset_gate.py check --project <p> --list paths.txt
asset_gate.py add --project <p> --model M --file F --verdict "SHIP IT" --score 8 --round 1
asset_gate.py list --project <p> [--open]
asset_gate.py sheet <views dir> --out sheet.png [--cols 4] [--title "Model r1"]
The script is at skills/asset-import/scripts/asset_gate.py.
| Command | Does | Who runs it |
|---|---|---|
sha |
prints a file's sha256 | anyone |
sidecar |
validates <stem>.model.json beside each file |
the deliverer, the reviewer |
check |
exits 0 only when every file has a valid sidecar and a SHIP IT row for its sha256. One OK or BLOCKED line per file, then ASSET_GATE files=<n> blocked=<n> PASS or FAIL |
the builder before import and before placing; the dressing-reviewer |
add |
appends one registry row. It hashes the file itself | the asset-reviewer only |
list |
prints the newest row per file; --open shows only those without SHIP IT |
anyone |
sheet |
builds one sheet image from a views folder | the reviewer |
The registry file¶
<project>/Design/assets_reviewed.tsv: tab-separated, append-only.
| Column | Holds |
|---|---|
model |
the model's name |
file |
the file path |
sha256 |
the file's hash. This is the key |
verdict |
SHIP IT, MINOR FIXES or NEEDS WORK |
score |
out of 10 |
round |
the review round |
date |
when it was judged |
- The newest row for a sha256 counts.
- A file that changed has a new sha256 and therefore no row: it is unreviewed.
- Every judged model gets a row, failed ones included.
- The file, its textures and its sidecar are copied into the project together, byte for byte. A re-export or re-save between the gate and the import needs a new round.
The full rules are in skills/asset-import/SKILL.md, section "Model gate".
