Files
animation/hand-poses
jeremy cf336f3b5b feat(lena-hands): exp09 graded cross-digit finger weights + honest tear metrics
The exp05 verdict ("weights alone cannot clear the bar on this mesh") was
measured against a hard partition that was itself causing much of the tearing.
exp01-exp05 gave every vert to exactly ONE digit -- 08_finger_weights.py had an
explicit `elif lo in FING: continue  # other digit: hard wall` -- which
guarantees the fused inter-digit bridges tear by the full finger separation,
because a single edge ring absorbs the whole gap.

Replace that with graded blending (WEB_BLEND_R0): a vert's fraction toward its
nearest other digit ramps 0 -> 0.5 as r = d_own/(d_own+d_other) goes 0.35 -> 0.5,
so both sides of the equidistance valley reach 50/50 and the field is continuous
across the boundary. Applied after the smoother (whose hard wall would erode beta
exactly where it must survive) and evaluated in the neighbour digit's own
arc-length frame. WEB_BLEND_SKIP excludes the thumb: its transform is opposition,
not curl, so its frame does not correspond to a finger's.

Measured against an identical baseline (same input, blend the only variable),
real tears (>=1mm rest length) drop 23-60% with NO regression on flat, the pose
that ships: fist_r 1178 -> 530, grip_r 561 -> 222, fist_l 979 -> 633,
grip_l 420 -> 322; total >5x 2487 -> 1307; p99.9 better on every pose;
flat unchanged at 0/1. fin_bones confirms the mechanism rather than just the
count -- the middle<->ring and pinky<->ring families leave the top classes while
the thumb/palm ones are untouched to the edge (182 -> 182, 148 -> 148).

This does NOT make fist/grip shippable: 222-633 real tears still reads as a
destroyed hand in clay renders, and the residual is now ~53% thumb-pad-fused-to
-palm, which is topology and needs mesh surgery or the v02 rebake. Flat and
relaxed are the shippable poses; fist/grip belong to the morph lane for now.

Also here:
- README: the solver's input is v02/..._exp03.glb, NOT exp01. exp01 is pre-hand
  -fit (converter steps 2b/2c); its finger groups sit on the wrist and overlap
  the real finger by 1.6cm, so a solve from it silently zeroes every _02/_03 bone
  -- rigid stick fingers and a torn flat -- while weight sums stay 1.0 and every
  assert passes. Cost three wasted bakes and one false "the solver regressed".
- Seed assert demanded >=100 seeds while the radius loop caps at
  SEED_AXIS_R_MAX, which left pinky (88 seeds at 16mm) can never satisfy; the two
  constants were mutually unsatisfiable. Now >=60, and it is documented as a
  sanity gate rather than a quality bar.
- Detwist poses tested at last: real but marginal (fist_r 38.7x -> 28.7x,
  grip_r 30.0x -> 17.3x, left hand flat). A knob, not a fix.
- edge_stretch_cmp.py / skin_bone_territory.py / handpose_trim_hand_obj.py:
  judge tears by rest length and absolute posed growth, not raw ratio; audit
  whether a bone owns any verts at all (thumb_01 owns ZERO in exp05); and trim
  an arm-sized skin dump to the hand before rendering.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 11:33:15 -07:00
..

Hand poses — pre-ship staging for ariki-game

Canonical hand-pose library. Poses live here first; when a pose is adopted for the game it is copied to ariki-game/assets/quaternius/hand-poses/ (keep the two byte-identical — the runtime HandPoseLayer reads the game copy).

Format

{"bones": {"<bone_name>": [x, y, z, w], ...}} — glTF node-local quaternions on the canonical Quaternius skeleton, which is exactly Godot bone-pose space for these bodies.

40 bones per pose, including *_04_leaf_* tip bones. Some bodies lack the leaf bones — skip bones FindBone returns -1 for, never error.

Apply REST-RELATIVE, not directly (runtime does this as of 2026-08-18):

// delta = canonicalRest^-1 * pose;  target = thisBodysRest * delta
var target = boneRest * (canonRest.Inverse() * pose);
skeleton.SetBonePoseRotation(idx, target);

canonical_rest.json (regenerate with tools/make_canonical_rest.py) holds the canonical finger rests this correction needs. On a rig whose finger rest matches canonical the correction is algebraically a no-op, so nothing changes for the Quaternius/QuatSkin bodies. On one that deviates it is the only correct form — Mako's *_01 knuckles sit 11.5° off canonical, and writing poses straight in wrenched them away from his own rest and tore the palm/wrist boundary.

Poses

File Source (Kevin packs) Runtime status
pose_flat.json = canonical REST (see below) SHIPPED — verified in-engine on Mako 2026-08-18
pose_relaxed.json HandWave01 f0 (~10° off rest) staged
pose_fist.json AttackPunch01_R/L f7, merged (~61° off rest) blocked on finger-weight repair (shreds on exp01exp05 and on Mako)
pose_grip.json CombatIdle1H01 f0, both hands (~44° off rest) blocked, same repair

pose_flat is the REST pose — and that is why it is useful

Measured 2026-08-18: pose_flat.json matches kevin_female_combat.glb's finger rests to 0.04° — it is the canonical rest pose, not a separately harvested "flat hand". Do not expect it to straighten a hand that is already at rest.

It is still the load-bearing pose, because the shipped clips do not hold fingers at rest — they pin them in a permanent curl (frozen tracks, spread 0.0°). UAL1 Idle_Loop holds the fingers 53.9° off rest on average, up to 86.8° (thumb_03_r) — near a clench. So the FLAT layer's real job is to undo that baked-in curl.

On Mako that curl is what shreds his hands. It does not fling verts (max displacement only 23.3 cm, i.e. legitimate fingertip travel) — it tears: 2,258 edges stretched >5×, max 198×, which rips his fused hand open into sheets. Turning FLAT on removes the bulk of it. Evidence (in-engine, the only honest judge here): characters/work/mako/handfix/review/ingame_handcam_flat_{OFF,ON}.png and the ingame_mako_{left,right}_hand_flat_ON_zoom.png crops. Residual: at close range his RIGHT hand still shows a torn patch with FLAT on — his right hand owns far less finger geometry than his left (4,283 verts vs 10,532; middle_02_r owns just 157), so it is not fully fixed. FLAT only holds the FINGER bones at rest; hand_l/r still follow the clip.

Verification (before shipping a pose)

  • tools/handpose_bake_preview.py body.glb pose.json out.glb — bake into rest rotations.
  • tools/skin_displacement_check.py posed.glb original.glb — Godot-exact LBS travel; cm-scale = sane, m-scale = broken. Blind to fin tearing — pair it with the edge-stretch check (tools/edge_stretch.py).
  • tools/handpose_skin_to_obj.py + tools/handpose_render_objs.py — clay render. Never judge by importing a baked-pose GLB into Blender (false shards). Pass an ABSOLUTE outdir (a relative one silently writes nothing), name inputs <pose>_hand_<l|r>.obj (the glob requires it), and crop to the hand with tools/obj_crop.py or the arm dominates the frame.
  • tools/skin_lever_audit.py body.glb — finds bindings whose joint is implausibly far away in rest, and verts bound across the midline to the opposite hand. Invisible at rest, so nothing else catches them: this is what found Mako's 444 cross-hand verts.
  • tools/skin_crosshand_repair.py in.glb out.glb — repairs those by inpainting from the mesh's own healthy neighbours (--diagnose to preview).
  • tools/hand_bone_ownership.py body.glb [l|r] — which finger bones actually own geometry. Run it before trusting a pose on a new body: Mako is a two-finger rig, so only his thumb and middle chains own verts and index/ring/pinky own nothing.
  • tools/rest_deviation.py canonical.glb other.glb — per-bone finger rest deviation, i.e. whether a body needs the rest-relative correction.

Ratio alone is not the tearing gate. edge_stretch.py reports huge ratios on this mesh's sub-millimetre sliver edges (unwelded duplicates) — judge the absolute posed length. On Mako, flat's worst stretched edge reaches ~12.4 cm (benign, sub-pixel in engine) while fist/grip reach 1015 cm (real, visible needles).