--- title: "raea scene" summary: "Find floating, sunk and clipping 3D parts, say what each part rests on, meter a shot's light, hold every frame to the stage checks a render runs, and list each part's planned detail beside how large the frames show it." order: 47 sources: ["apps/scene/src/lib.rs", "apps/scene/src/light.rs", "apps/scene/src/stage.rs", "apps/scene/src/lod.rs", "runtime/lod-plan/src/lib.rs", "runtime/lod-plan/src/report.rs", "runtime/lod-plan/src/plan.rs", "systems/stage/src/lib.rs", "systems/stage/src/clearance.rs", "systems/contact/src/lint.rs", "systems/contact/src/zfight.rs", "apps/scene/src/faults.rs", "apps/scene/src/seed.rs", "systems/notice/src/lib.rs", "apps/scene/src/motion.rs", "systems/motionfaults/src/lib.rs", "runtime/endchecks/src/faults.rs", "apps/scene/src/ask.rs", "apps/scene/src/chars.rs"] --- `raea scene` steps a composition's frames and measures its 3D scene without rendering pictures. `lint` reports parts that float, sink into what they stand on, clip into each other or tilt, and exits 1 on an error. A float or sink is measured at the part's feet (rays down from its lowest points), not its box, so a stool whose box clips a table's edge but whose feet are on the floor rests. A clip comes with the move that clears it (the part, the axis, how far) and, when the move is sideways, where it settles once moved. Faces of two parts lying in one plane over each other (a rug's top in the floor's, which flickers as the camera moves) are an error from 1 cm² up. `explain` says what every part rests on. `light` meters the light on the shot's subject; given several compositions, it compares their first and last frames across each cut. `stage` steps every frame and holds it to the checks `raea render` runs at its end (docs/stage-guards.feature): 3D words too small or turned too far to read, a reveal that never starts or never finishes, a part whose size jumps in one frame, a camera that lurches or goes in and back out, frames with almost nothing on screen. It exits 1 on an error, as the render would, without drawing a frame, so it's the cheap look before one. RichText `read={false}` leaves a sign nobody is meant to read out of it. `--clearance M` also holds the camera M metres off every solid part on every frame (0.45 for a carried camera, less for a rig): each part it comes closer to, the frames and the nearest it gets, or that it's inside the part. Glass, decals, volumes and parts under 5 cm are passed over. `lod` lists every part's planned detail beside what the frames show. A part's plan is how large it is meant to be seen, which is how much of it gets built: | lod | for | across the frame | | --- | --- | --- | | 0 | the hero | 50% or more | | 1 | featured | 20% to 50% | | 2 | set dressing | 8% to 20% | | 3 | background: a grey box reads | 2% to 8% | | 4 | far: a silhouette | under 2% | The plan is the part's own `lod` prop (``, ``, or a parent `` or `` for every part inside), else the `lod` of the object with the part's name in the job's plan (`make` on the brief.ts above the composition). What a frame shows is how much of it the part's box spans through that frame's camera, the larger of its width's and its height's share. The table puts parts seen closer than planned first, then the rest of the planned parts, then the parts nobody planned by how large they get, so a part forgotten since the plan was written is found by reading down it. Under it: each `lod-closer` finding, and any level the plan gives a name that no part in the frames goes by. A part seen one level finer than planned is a warning; two or more is an error, and `lod` exits 1. `raea render`, `raea scene stage` and `raea check --quick` say the same finding, and `raea goal check` holds a job at it. A part hidden behind other meshes isn't counted as seen; RAEA_LOD_CHECK=0 leaves the check out of a render. `faults` judges the lint's findings as a viewer of the shot would see them. Every frame's camera (up to 48 over the shot) is asked whether each finding is in frame, facing it and not behind any part, measured against the scene's real triangles, and how many pixels its gap, depth or overlapping patch covers there. A small model turns that, the kind of fault and the words of the parts' names into the chance it reads as a fault. It lists likely faults (0.5 or more, FAULT) and seen ones under that (maybe), counts the findings no camera sees, and exits 1 on any fault. Each line ends with the finding's key. `--real KEY` and `--fine KEY` keep a verdict beside the project, and a finding the last run reported that is gone while both its parts remain is kept as fixed, so real. `raea scene faults train [FOLDER]` fits the model to every project's verdicts under FOLDER and keeps it in raea's models folder (notice/faults.json), which every run after uses. It reports how many verdicts it gets right fitted without each one's finding, and without each one's whole shot (a scene it hasn't seen). Until then it judges by a written prior (systems/notice/src/model.rs). See docs/notice.feature. `faults --clip` holds a character's motion to what a body does, frame by frame (raea-sys-motionfaults): a knee that gives and comes back in a snap while its foot stands (a buckle), a standing foot that slides or glides along the ground (a skate), a joint past its anatomical range, a finger bent back, sideways or twisted past its range, a joint or the root jolting in one frame, and a finger, the thumb or the palm inside what the hand holds. A clip is JSON: the skeleton's `joints` (and `surface`, for the palm), `fps`, and `frames` of `{ root, turns }`, with `thing` (a ball, box, capsule or cylinder) and each frame's `thing: { at, turn }` for what the hand holds. `--clip` takes a file or a folder of them. The lines sit just above what 107 retargeted ACCAD captures do; `--seed N` plants N faults of each kind in every clip and says how many are caught. `--motion` reads the characters from the composition itself, no clip written out, and also tests every finger bone against the scene's real triangles. Motion findings also pass a critic, a tiny logistic model fitted by `raea scene faults train` to every motion verdict (fixes, `--real`, `--fine`): what it learns of one joint carries to its neighbours, and a verdict on the finding's own key at its size outranks it. `--ask N` puts the N likeliest faults to a vision model, the fault ringed on its frame and described in the scene's own words, so it answers only whether it's meant; see docs/notice.feature NT12. A render runs the judge too: at its end the first frame's floating, sunk, lifted and doubled-face findings are judged through the render's own cameras, and only the likely faults are said (RAEA_FAULTS_CHECK=0 leaves it out). ```sh raea scene lint room.tsx raea scene faults room.tsx --composition shot-in # the findings a viewer of shot-in would notice raea scene faults room.tsx --composition shot-tv --fine 'air:r106_map|' # the draped map is meant raea scene faults train ~/Documents/raea # fit the judge to every project's verdicts raea scene faults --clip walk.json # a clip's buckles, skates, bent fingers, jolts raea scene faults --clip clips/ --seed 2 # what it catches of faults planted in real motion raea scene faults take.tsx --composition take --motion # the composition's characters, hands against the scene raea scene faults room.tsx --composition shot-case --ask 3 # a vision model on whether the 3 likeliest are meant raea scene explain room.tsx --frame 90 --json raea scene light room.tsx --part hero raea scene light film.tsx --composition shot1,shot2,shot3 # the light across the cuts raea scene stage film.tsx --from 1800 --to 2400 # the stage checks on 20 s of it raea scene stage walk.tsx --clearance 0.45 # and the camera kept off the set raea scene lod walk.tsx # every part's planned detail against the frames ``` ## Usage ```sh raea scene export EDIT.tsx -o DIR [--composition ID] [--frame N | --at A-B] (the composition's 3D as data other tools build: DIR/scene.json, each part placed (y up, metres) with its shape, material or light, and the camera; meshes/ and models/ beside it) raea scene lint|explain|faults|light|stage|lod EDIT.tsx [--composition ID] [--frame N] [--part NAME] [--from N] [--to N] [--clearance M] [--real KEY] [--fine KEY] [--seed N] [--ask N [--dry]] [--motion] [--json] | raea scene faults train [FOLDER] | raea scene faults --clip CLIP.json|FOLDER [--real KEY] [--fine KEY] [--fine-from N] [--fine-upto N] [--real-from N] [--real-upto N] [--by NAME] [--seed N] [--json] (what each 3D part rests on: floating, sunk and clipping parts; light: the scene's lighting) ``` Headless: it needs nothing running and opens no window. Takes up to 3 arguments besides its flags. ## Flags | Flag | Takes | What it does | | --- | --- | --- | | `--ask` | `N` | `faults`: render the frame each of the N likeliest faults shows largest on, ring it, and ask a vision model (`raea ask`) whether it's meant or a mistake, handing it the scene's own words for the fault. An answer 0.7 sure or more is kept as a verdict (by ask), which a person's verdict outranks. The ringed pictures stay in review/faults-ask/. | | `--at` | `A-B` | `export`: each part's placement and the camera's field of view on every frame from A to B, for keyframes in Blender or Godot. | | `--by` | `NAME` | With `--real`/`--fine` on motion findings: who made the call, kept with each example (`claude` for an agent that looked at the render); a person's by default. | | `--clearance` | `M` | `stage`: every run of frames where the camera is nearer a solid part than M metres (0.45 carried, 0.15 on a rig). | | `--clip` | `CLIP.json\|FOLDER` | `faults`: a character's motion (joints, fps, frames of root and turns) held to what a body does: buckles, skates, joints and fingers past their range, jolts, fingers through what the hand holds. A folder takes every .json in it. | | `--composition` | `ID` | Which composition to measure. `light` takes several, comma-separated, to compare the light across their cuts. | | `--dry` | – | With `faults --ask`: render and ring the pictures and say what would be asked, spending nothing. | | `--fine` | `KEY` | `faults`: keep a verdict that the finding with this key (printed after its line) is meant as it is, in the project's review/faults.labels.jsonl. With `--clip`: the motion finding's line for that check and joint (its key, such as skate:foot_l) rises to just above its size, for every run after (notice/motion.json in raea's models folder). May repeat. | | `--fine-from` | `N` | With `--fine` on motion findings: only findings of the key this size or bigger, in the finding's own units (degrees past the range for a finger or a joint limit). | | `--fine-upto` | `N` | With `--fine` on motion findings: only findings of the key this size or smaller (a pinky's small bends fine, its big one not). | | `--frame` | `N` | The frame to measure (0 by default; `light` also takes `last`). | | `--from` | `N` | With `stage` and `lod`: the first frame held to the checks (0 when left out). Every frame before it is still stepped, so a scene that builds over time is as it would render. | | `--json` | – | Print as JSON: `lint` its findings (check, level, the parts they are about, frames, says, measure, fix), `explain` every part with its support, gap and box, `lod` every part's row (planned, seen, largest, at, frames, closer), the plan's names no part goes by, and its findings. | | `--motion` | – | `faults`: the composition's characters (each ``'s joint parts, its skeleton.json beside its joint.glb) held to what a body does on every frame, as `--clip` does, and each finger bone tested against the scene's other parts: a thumb through a grip, or left off what the hand holds. Takes `--real`/`--fine KEY` as `--clip` does, and a finding the last run reported that's gone now (review/motion.last/) is kept as a real verdict: a fix teaches it. | | `--part` | `NAME` | With `light`: the part to meter, in place of the shot's subject. | | `--real` | `KEY` | `faults`: keep a verdict that the finding with this key is a real fault, in the project's review/faults.labels.jsonl. With `--clip`: that check's line for that joint falls to the finding's size. May repeat. | | `--real-from` | `N` | With `--real` on motion findings: only findings of the key this size or bigger. | | `--real-upto` | `N` | With `--real` on motion findings: only findings of the key this size or smaller. | | `--seed` | `N` | `faults`: plant N faults of known size in props that rest (sunk, lifted, in the air), lint again and say how many the judge calls faults among those plain to see, seen smaller, and hidden. With `--clip`: plant N of each motion fault (buckle, skate, jolt, limit, finger, through) in every clip and say how many are caught. Writes nothing. | | `--to` | `N` | With `stage` and `lod`: the last frame held to the checks (the composition's last when left out). | | `-o` | `DIR` | `export`: the folder scene.json is written to, with meshes/ and models/ beside it. | ## See also - [3D](../../guides/3d.md) covers building and checking a scene.