fix: correct rig deformation — arms no longer cross body, feet no longer stretch to center
The model animated but deformed wrong: arms crossed the torso and foot heels stretched to the model's center-bottom. Two root causes, both fixed: 1. Pose mismatch. Sketchfab models are modelled in an A-pose (arms angled down) but the Quaternius library rests in a T-pose. Binding the A-pose mesh to T-pose arm bones misweighted the arms, and the library clips (which rotate arms ~70° down from the T rest) then shoved the already-drooped arms across the body. Fix: autorig.fit_arms_to_mesh() reorients each arm bone chain along the model's real arm direction; merge_animations retargets every clip from the library's T-pose rest onto the fitted rest via world-space constraint bake (Copy Rotation/Location + nla.bake), so world motion is reproduced regardless of the rest difference. 2. Feet-to-center stretch. The library's deform-flagged `root` bone runs up the body centre-line; nearest-bone weighting assigned inner-foot/heel verts to it, stretching them to center when animated. Fix: exclude root/control/mechanism bones from weighting (_NON_DEFORM_HINTS). Also upgraded nearest-bone weighting from rigid (1 bone/vert) to a smooth inverse-distance blend across the nearest 4 bones, so joints deform cleanly. Bone-heat still fails on Miku's joined hair/clothing mesh, so this is the primary path. Verified by rendering Idle/Walk/Run poses (Blender): natural stance, arms at sides swinging correctly, feet planted, proper running stride. Smoke test still 30/30. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5
parent
22cb0a58b7
commit
9939e7e524
@@ -20,7 +20,8 @@ menu dropdown, fully animated in first AND third person, synced in multiplayer.
|
||||
3. **Animation library** — already bundled. `assets/characters/animations/_library.glb`
|
||||
is the CC0 Quaternius Universal Animation Library (13 game-relevant clips
|
||||
mapped in `LIBRARY_CLIP_MAP`). `tools/autorig.py` rigs every character to
|
||||
this library's own skeleton, so clips apply with zero retargeting. To use a
|
||||
this library's skeleton (fitting the arm bones to the model's actual pose),
|
||||
and `merge_animations.py` retargets each clip onto that fitted rest. To use a
|
||||
different/larger set instead, see "Swapping the animation library" below.
|
||||
|
||||
## The pipeline, step by step
|
||||
@@ -31,8 +32,8 @@ Each step is also runnable on its own:
|
||||
|---|---|---|
|
||||
| 1. Find | `python tools/sketchfab_import.py search "anime robot" --rigged` | Search downloadable models (license shown per result) |
|
||||
| 2. Download | `python tools/sketchfab_import.py download <uid>` | GLB + license/attribution JSON into `assets/characters/incoming/` |
|
||||
| 3. Auto-rig | `blender --background --python tools/autorig.py -- in.glb out.glb` | Fits a Mixamo-named skeleton, binds automatic weights |
|
||||
| 4. Animate | `blender --background --python tools/merge_animations.py -- rigged.glb assets/characters/animations out.glb` | Merges the shared clip library, strips root motion, canonical names |
|
||||
| 3. Auto-rig | `blender --background --python tools/autorig.py -- in.glb out.glb` | Fits the skeleton (incl. arm bones) to the mesh, binds smooth nearest-bone weights |
|
||||
| 4. Animate | `blender --background --python tools/merge_animations.py -- rigged.glb assets/characters/animations out.glb` | Retargets the clip library onto the fitted rest, strips root motion, canonical names |
|
||||
| 5. Register | (automatic in pipeline.py) | Copies to `skins/`, adds entry to `skins.json` |
|
||||
|
||||
`tools/pipeline.py` chains all of it. Useful flags:
|
||||
|
||||
Reference in New Issue
Block a user