Skip to content

Make the Blender rig robust: exit codes, fresh outputs, weight continuity, cloth - #6

Open
rubenmarcus wants to merge 32 commits into
feat/blender-character-rig-20261109from
fix/character-rig-robustness-20261109
Open

rubenmarcus wants to merge 32 commits into
feat/blender-character-rig-20261109from
fix/character-rig-robustness-20261109

Conversation

@rubenmarcus

Copy link
Copy Markdown
Member

Batch B ran PR #4 on 11 more characters and 0/11 passed the strict gate. Batch A passed 6/12. Two of the failures were pipeline bugs, and the rest were weight steps the rules couldn't remove. Stacked on #4.

Bugs

  • Blender --python exits 0 when a script raises. Vlad R3 printed RuntimeError: no T-pose arm band found and the runner built on the previous joints.json, which produced a hybrid rig. Every step now ends in C.run_main(main) and exits 1 on any exception.
  • The runner deletes a step's outputs and every later step's before it runs. Afterwards it requires fresh outputs, writes input/output SHA-256 to run-manifest.json, and refuses --from when an upstream input or output changed since that step ran. A fake-Blender check (R5) covers the silent exit, exit 1, a changed config and a hand-edited parts.json.
  • rig_joints.py crashed on knee_c[0] when a tail extra took leg faces (teletreco-chiadinho R1). Leg sections now fall back to rows within 3 cm and the knee to the hip-ankle line; a missing ankle or thigh raises a clear error.

Generalization

  • Gradient limit. Ramps only scaled weights that already existed, so a vertex could switch bones within millimetres (roqueiro Spine/Spine01 10.2×, ministro Hips/Spine02 42.8×). Every edge whose weight change exceeds its length over 0.025 × height is now relaxed, with rigid vertices fixed. This creates shared influence across part borders.
  • Groin. Near the crotch, the thigh share between the thighs moves to Hips (chiadinho 14.2× → 3.17×, padre 12.8× → 2.49×).
  • Hanging cloth. Extras with kind: skirt|cape get spine-by-height weights that fade into the thighs below the hips. measure keeps body-surface extras such as a coat skirt in the joint measurement.
  • Estimator. The crotch comes from the parts step's closed mesh, because a removed cape opened the legs. The arm band relaxes to 1.5× the torso half-width for A-poses.

Results: 25 characters (11 batch B, 12 batch A, 2 pilots) were rerun into csbrasil/local/rig-blender-20261109/v2/<id>/. 17/25 pass the strict gate, up from 6/23. No pilot regressed and none of batch A's 6 passes regressed. Per-character numbers are in v2/summary-final.txt.

Still failing: vlad 16.8× (cape bottom fused to the heels), satanista 14.4× (cape kind; 12.4× without it), ministro 7.3× (coat front at the waist), barbudo 4.28×, rapper 4.0×, chupa-cabra 3.84×, corisco 3.83×, tiradentes 3.62×.

npm run check passes.

Written with Claude Code (trailer Agent: Claude Code).

Blender --python exits 0 when a script raises, so a failed joints step let the runner build on the previous joints.json (Vlad R3 hybrid). Steps now end in C.run_main, which exits 1 on any exception; the runner deletes a step's and every later step's outputs before running, requires fresh outputs afterwards, records input/output SHA-256 in run-manifest.json and refuses to resume on changed inputs or hand-edited upstream files. A fake-Blender check covers each case.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…poses

A tail extra that captured leg faces crashed on knee_c[0] (teletreco-chiadinho R1): leg sections now fall back to rows within 3 cm, the knee to the hip-ankle line, and missing ankle/thigh sections raise a clear error. The crotch comes from the parts step's closed mesh (a removed cape opened the legs and hid the crotch, so no arm band was found on vlad), and the arm band test relaxes from 2.2x to 1.5x the torso half-width for A-poses.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…edurally

Boundary ramps only scaled existing weights, so neighbouring vertices could switch bones within millimetres (roqueiro Spine/Spine01 10.2x, ministro Hips/Spine02 42.8x). A gradient limit relaxes every edge whose weight change exceeds its length over 0.025 x height, with rigid vertices fixed, which creates shared influence across part borders. Near the crotch the thigh share moves to Hips on the midline (teletreco-chiadinho 14.2x). Extras with kind skirt or cape get spine-by-height weights that fade into the thighs below the hips.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
A coat skirt over the legs (ministro-creepy) or a weight-only torso region (chupa-cabra) removed with the extras left no thigh or torso section. Extras with measure: true, and kind skirt by default, stay in the measured body, and the torso falls back to the mid-depth of the vertices at that height.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
From the v2 gauntlet runs; joints.json overrides only where the batch worker's override still measures better (bicheiro, coronel, corisco excluded as failing, dom-pedro, dracula, nanica, pm). JSON only.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Review of #6: the resume guard skipped the source, so --from=parts --source=b.glb silently reused a.glb's clean.blend.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The orthographic PNGs, their .view.json sidecars and the review sheets were neither deleted nor hashed, so a failed render left last run's files for review. The check header now lists R5, R1 rejects a non-boolean measure, and a new R5 mutant leaves a render unwritten.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
edgesStillOver reported the count from the start of the final iteration. Also drop the unused cloth_weights parameters.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
select.grow keeps the faces connected to seed points, stopping at folds over crease degrees and adding the inner side of thin sheets within thickness, so a cape box no longer takes the back of the boots. cut deletes the extra's face ring that touches the listed body parts (cutFaces in parts.json); nothing is moved or welded. satanista-talkshow 14.38x -> 3.79x, vlad 16.84x -> 6.03x.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Spine joints take a locally line-fitted axis through outlier-free torso section centroids; the neck its own sections; the last-resort torso section leaves extras out. Knees are searched in kneeWindow: forward side-profile bend, else the narrowest smoothed section without boot-top steps, else kneeRatio. Opt-in levers measured on 37 characters: joints.shoulderAt junction (underarm gap), joints.spineDepth, weights.thighCeiling and clavicleFloor; R1 validates grow, cut and shoulderAt. Docs record why they are not defaults.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…se gate

assombracao-lanhouse, bebe-reborn, bicho-do-bueiro, boneca-da-cristaleira, boneco-falante-87, chupa-cabra, clovis-fora-do-ar, coelho-pascoa-shopping, corisco, muro-de-caco, sorridente-onibus and tiradentes. pm-arrego takes spineDepth 0.15 to keep its pass under the new spine axis; dom-pedro-i drops its joints.json override (the estimate passes once its shoulder transitions are measured).

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Inside a band around the hip joints (waistBand) or the neck (neckBand) the weights become a smooth function of height and of the angle around the torso axis: thighs or clavicles on the sides, the spine chain by height in front and behind, fading back to the rule weights beyond the band. ministro-creepy 6.89x -> 3.27x (PASS), vlad 6.03x -> 5.30x, ursinho-fliperama 5.42x -> 4.40x; worse on barbudo-creepy, bebezao-de-feira, rapper-zona-sul and dino-festa, so off by default.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…s spine depth

ministro-creepy: coat skirt as a measured cape grown from seeds and cut from the legs, a rigid pendant, waistBand 0.06. capitao-caveira: spineDepth 0.15 brings the worst clip back from 3.09x to 2.67x (2.62x in v1); the medial-axis spine had moved Spine02/Spine01 5-6 cm forward of its backpack-free back.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
chainLocality keeps each spine-chain bone between its parent and child joints on vertices of no limb part; sideExclusive removes opposite-side bones past a margin from the midline. satanista-talkshow 3.79x -> 3.39x (PASS); vlad 5.30x -> 4.05x, bebezao-de-feira 4.22x -> 3.60x, still over the gate. Off by default; the other 30 passing rigs are unchanged.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Grown cape, chainLocality 0.02, sideExclusive 0.03, gradientRamp 0.04 and shoulder-to-arm linear blends.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
vlad-v8 (coat-lower raised to 0.95 m) died in rig_joints.py with
'no torso section or body vertices at z=0.889': the unmeasured coat
took every torso face at that height and clipping the full-mesh
section in front of it left nothing. Fall back to the unclipped
full-mesh section there instead of failing; the earlier fallbacks
keep their order, so rigs that ran before are unchanged.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Vertices shared by two cloth extras (vlad's coat-upper/coat-lower
seam) kept heat weights (Hips 0.61 + RightUpLeg 0.28) next to cloth
vertices at Hips 0.96 and tore in death at 4.05x. They now take the
mean of both extras' cloth weights: vlad 4.05x -> 3.58x. Only vlad
has two cloth extras, so no other rig changes.

frontPanel (opt-in, per cloth extra) splits the cloth in front of the
hip joints over both thighs with its own leg share; on vlad it
measured 3.583x with and without. R1 validates the new key.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The tunic hanging in front of vlad's crotch (0.74 m) stepped from
Hips 0.46 at 0.795 m to 0.71 at 0.775 m at the edge of the default
groin band and tore in death (3.58x). groinBand 0.08 with
gradientRamp 0.05 moves that edge: worst clip 3.30x (crouch), back
2.30x, hands 1.65x/1.46x, synthetic 2.02x, 0 pose-test failures.
Full battery: 32/37 pass, no other rig changed.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
weights.flankBand (x height) gives the torso sides between Hips and
Spine01 only the spine chain by height, with no clavicle or thigh.
On bebezao-de-feira (0.04) it removed the crouchwalk flank tear
(LeftShoulder 0.43 next to LeftUpLeg 0.29; 3.59x -> 3.48x), but its
lower fade became the new step in death (3.25x -> 3.77x), so no
config uses it yet. R1 checks the three band keys. Full battery
unchanged: 32/37.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
weights.flankFade (x height) sets how far below the Hips joint the
flank band fades in. On bebezao-de-feira the default 3.4 cm fade
tore in death (3.77x); 0.043 still gave 4.09x, 0.06 and 0.08 bring
death to 3.09x. R1 checks the new key.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
flankBand 0.04 with flankFade 0.06 keeps clavicles and thighs off the
belly flanks: worst clip 3.48x (crouchwalk), back 3.48x, hands
1.67x/1.78x, synthetic 2.25x, 0 pose-test failures. Full battery
33/37, no other rig changed.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
An extra with remove: true is deleted in the parts step and the hole
it leaves in the rest of the mesh is filled; the cap takes its
neighbours' part. It is for Mint geometry the concept does not have.
R1 accepts remove as the extra's only mode, without cut or measure.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The Mint mesh has a 44 cm rod with a ball fused to the tail, pointing
straight back at hip height in every pose. The concept and the ficha
(bow tie, basket on the back) have no such prop, so the rod is
removed (243 faces, 4808 -> 4574 triangles). It had pulled the
measured Hips 8.5 cm back; without it death tore at the tail (4.12x),
so joints.json keeps Hips at the old position: worst clip 3.30x
(death), 0 pose-test failures, as before.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The stretch gate passed rigs whose Arm joint sat near the wrist, so
every clip left the arms in T. The pose test now fails when the bind
Arm->ForeArm / ForeArm->Hand ratio leaves [0.6, 1.7], or when the
visible arm angle at idle@0.5 (world down vs clavicle joint -> hand
centroid of the skinned mesh) is more than 25 deg off the donor's
(mst on its own idle: 50.8 deg left, 38.0 deg right). The runner runs
it strict. R4 adds the elbow-at-wrist and arm-at-wrist mutants; R1
checks parts.armpitX and parts.armMinLength.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
A sleeve or costume that fills the space under the arm pushed the
armpit to the sleeve end: the arm part and the shoulder joint landed
6-15 cm from the wrist on clovis-fora-do-ar, bebezao-de-feira,
boneca-da-cristaleira and coronel-arrego's right arm. When armpit ->
wrist is shorter than parts.armMinLength x height (0.1), the armpit
takes the other side's, else the arm-torso junction; parts.armpitX
sets it by hand (clovis: 0.30 m). nanica, whose arm joints come from
joints.json, opts out. Idle arm angles now 50-66/34-58 deg; full
battery 33/37, no pass lost.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
weights.jointSmooth smooths the final weights near listed joints over the
welded mesh, never giving a vertex a new bone, so part rules, rigid vertices
and the 4-influence limit hold and UV seams stay closed. It targets the
client's select-inflate gate (weapon idle + support-hand IK + finger curl),
where raised arms fold shoulder, armpit and neck edges. Off by default; the
check validates the option.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Per-character jointSmooth (ten rigs), the r1 shoulder/elbow blends with
gradientRamp 0.05 (prata, dom-pedro-i, sorridente-onibus) and a hood that
follows the neck band below a rigid crown (assombracao-lanhouse). Every rig
still passes the strict pose test; client select-inflate ruins/1e4 before ->
after: assombracao-lanhouse 56.1->17.0, bicho-do-bueiro 52.9->41.2,
coelho-pascoa-shopping 47.1->35.3, bebezao-de-feira 39.6->23.3,
prata 34.6->15.9, roqueiro-mistico-70 31.5->16.7, dom-pedro-i 29.4->7.4,
chupa-cabra 28.8->27.9, teletreco-chiadinho 28.1->20.8,
capitao-caveira 24.7->18.1, nanica 24.2->10.6, sorridente-onibus 23.7->20.8.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Its jointSmooth repaint (neck/Spine/Head 0.06 x 20) lowered select-inflate
39.6 -> 23.3 and passed the strict pose test, but the baked walk1h state
then failed clip QA (skin stretch 3.592x > 3.5 at Spine01+RightShoulder),
which the shipped 0.2.2 passes. Back to the shipped config.

Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
@rubenmarcus

Copy link
Copy Markdown
Member Author

Local verification on head a1ebaea (Linux, Node 26.12.1): npm ci PASS; npm run check PASS (100 PASS lines); npm run check:asset-gen PASS (4 PASS lines); npm run smoke:pack PASS (68 PASS lines). Blender 5.2.0 LTS is installed; these synthetic gates do not establish a real-asset or visual approval.

@rubenmarcus

Copy link
Copy Markdown
Member Author

Integration with #7 exposed a crash when the requested clip subset does not include idle: the pose test dereferenced an absent idle sampler, so clip QA could not assess individual clips. Head c782fda computes the idle-angle gate when idle is present; npm ci, check, check:asset-gen and smoke:pack pass, and the combined #6/#7/#8 synthetic suite now passes the existing Q3 isolated-clip QA regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant