Repository navigation
Convert Mixamo and UAL clips to meshy-28 with a QA gate - #7
Open
rubenmarcus wants to merge 32 commits into
Open
rubenmarcus wants to merge 32 commits into
rubenmarcus wants to merge 32 commits into
Conversation
Characters may now declare an animations.extra map of named clips beyond
the states: fixed vocabulary names (locomotion, weapon handling, damage
reactions, melee, round outcomes) or an emote_ prefix with a suffix. Keys
match ^[a-z][a-z0-9_]{1,40}$; each entry carries file, duration, loop,
rootMotion and source. Extra files are declared in files under the
animations.extra.<name> role, so duplicates, missing paths and the byte
budget (extras included) are enforced before any payload is hashed, and
each extra GLB must contain an animation named exactly as its key.
Agent: Claude Code
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The valid fixture now ships two extra clips (a vocabulary name and an emote_ name) and a no-extras pack stays valid. Twelve new mutants cover the contract: unknown, state-colliding, bare-prefix and pattern-violating names; missing, duplicated, shared, non-GLB and misnamed clip files; entries with missing or mistyped fields; and extras pushing the pack over its byte budget. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The tube humanoid moves out of character-rig-check into tools/checks/lib so the animation check can skin clips on it (it also takes another joint layout). rig-pose-test gains --states and --samples, so a QA gate can run it on clips other than the 11 state clips. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
One retarget core for both steps: world-rotation deltas with rest-direction alignment of arms and legs, hips displacement scaled by hips height with straight-line root motion extracted into metadata, ground contact on the lowest foot joint, two-bone foot IK inside the source's contact windows (loop-aware), 30 fps resampling, trim and facing correction. Mixamo maps its spine anatomically (Spine->Spine02, Spine2->Spine), UAL follows the UE mannequin names. Bake ports the client's retarget-glb rules (absolute arms, Curl_* untouched, refuse unmapped rigs) and adds a mesh-aware toe floor clamp. Clips carry extras.clip metadata with the studio-assets catalog id. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
clip-qa skins every frame on the character and gates foot slide inside contact windows (root motion added back, relative to the source's own slide), floor penetration, floating, hips height, loop seams, two-hand grip stability and skin stretch through rig-pose-test --clips. clip-sheet renders evenly spaced instants from a fixed camera over a 10 cm floor grid. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Mixamo-like bone trees with scrambled rest frames, duplicate leaves and three name prefixes, a Z-up UAL-like glTF and the synthetic skinned body cover the maps, delta transfer, spine order, root motion, resampling, facing, contact and IK, rest alignment, bake rules and every QA gate with one mutant each. Runs in npm run check without any Mixamo or UAL bytes. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Bone maps, method, clip metadata, QA thresholds, the three gauntlet rounds on capitao-caveira and mst, and the residual issues. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The toe clamp becomes a floor clamp over body regions: heels pitch at the ankle, toes at the ball, hands at the elbow then the shoulder, knees lift the hips, and a foot whose heel and toes both sink is raised by leg IK. The QA gate reports the lowest vertex per region and holds heels to 1 cm. Pilot: mst grenade-throw hand -5.48 -> -0.50 cm, heels at most -0.6 cm; 12/12 pilot clips pass. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Floor clamp: a limb whose pivots are vertical is raised by two-bone IK (hands under a straight arm, heels under the ankle), the rest of the body lifts the hips, and a final whole-body pass lifts out of any remaining penetration or drops a character hanging above the floor where the source has a foot planted. Clips record the source's per-frame foot clearance; QA floats are measured above it, slide allows 1.25x the source's own slide + 1 cm and hips may follow the source's own height + 0.08. FBX files whose footer FBXLoader misreads are re-parsed with a padded footer, and three.js sources can be sampled again after a full LoopOnce pass. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
build-library converts every catalog clip except T-poses, rig files, swimming and repeated takes, detects loops from the seam and airborne clips from the source's feet, and writes index.json with the pack key each clip proposes: runtime state, contract extra name, emote_ name or a proposed name (8-way diagonals, sprint, turns, jump phases, death variants). library-report folds clip-qa verdicts into the index with a per-category table. The check covers the plan rules, the floor clamp lifts and drops, and the FBX footer fallback. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Pilot now 12/12 on capitao-caveira and mst; the full catalog (419 clips) passes 372 on mst and 367 on capitao-caveira, most remaining failures being skin stretch in extreme poses. Lists the proposed extra names for the pack contract and recommends keeping the anatomical Mixamo spine map. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Adopt the 45 names the animation conversion library proposes (branch feat/animation-conversion-20261109, PROPOSED_EXTRA_NAMES; every name is used by at least one key of library/index.json): 8-way walk/run/sprint diagonals, sprint gaits, crouched locomotion and aim, standing turns, jump phases, pistol variants and death variants. extraClipNames is now coreExtraClipNames (23) plus converterExtraClipNames (45, sorted to diff against the converter's own sorted export). assertExtraClipVocabulary enforces the single source: the vocabulary must equal the core set plus the converter set, with no duplicates, state collisions or pattern breaks. The converter must import extraClipNames from this module instead of keeping its own copy (noted in docs/character-pack.md). Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The synthetic fixture now carries a converter-named extra (sprint_fwd_left) alongside strafe_left and emote_danca, proving the new names validate end to end through the pack contract. New check cases: - PASS: assertExtraClipVocabulary on the real exports (68 names = 23 core + 45 converter) - Mutant: a converter key outside the vocabulary (vault_low) fails for the missing-name reason - Mutant: a vocabulary name outside the core and converter sets - Mutant: a dropped core name - Mutant: a duplicate vocabulary entry Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…, rig-tagged stretch Legacy client rigs (24 to 28 joints) bake by name; helpers a clip never drives are listed in bakedFor.unanimated. Shin-weighted vertices below the ankle form a passive shoe region the floor clamp leaves alone and the QA reports apart (a lift for them made cuca float). While the ball is planted the foot turns about the pinned ankle so the ball stays put, with world locks moving back at the root velocity inside in-place clips. Loops are closed after per-frame corrections. clip-qa tags stretch [rig] when the worst vertex is weighted across sides or across three joints, and --flags-from measures the client's metadata-free clips with the converted clips' flags. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…planted ankles A few degrees of hip-joint asymmetry in the legacy rigs turned whole clips off the root velocity's line (funkeiro, camera-roxa, mandrake: 4.4 cm of slide, now 0 failing). Rest alignment turns a limb at most 20°, so a rig bent on purpose keeps its bend. Where a standing leg cannot reach its planted ankle the hips drop (at most 5 cm) instead of dragging the foot. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
All 100 legacy rigs bake by name; new clips pass 1085/1100 states and 2084/2100 extras once rig-weight stretch is set aside, against 582/1100 for the clips shipped today. No state survives as a shared clip on more than 35 rigs, so every state is baked per character (about 255 KB merged for 11 states). Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…abulary The converter imports extraClipNames from tools/lib/character-pack.mjs instead of keeping its own copy. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
animation-library imports extraClipNames and the state lists from tools/lib/character-pack.mjs; its converter names are checked equal to the contract's converterExtraClipNames, and those keys are now vocabulary keys. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…tored pack-character writes states.glb, extra.glb and manifest.json (sha256, bytes, clips, durations, loop, root speed, provenance). Packs resample keys and store rotations as normalized int16, core glTF that three.js's GLTFLoader dequantizes; clip-qa --pack gates the packed data, and the readers dequantize normalized outputs. The body drop follows the source's lowest foot through flight phases, and bake --passive-knees (recorded in bakedFor.passiveRegions) stops shin-skinned tails from hoisting a rig. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
… rig Legs bound with the knee bent past 45 degrees (knee joint off the leg line on short mascot and robe rigs) are no longer straightened; that straightening stood padre-parapsicologo 13 to 30 percent above its bind. Rifle clips keep the support hand within 2 cm of the median hand distance by left-arm two-bone IK. clip-qa reports the bind knee bend and tags hips-rise failures on such rigs as [rig]. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…d legs Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
…terpolates pack-character writes states, loco, combat and ceremony packs plus one file per curated emote, all meshopt-encoded without filters (lossless; the client's GLTFLoader already registers MeshoptDecoder, Studio readers use the meshoptimizer package through packIO). clip-qa --pack takes several packs. clipSampler and gltfPoseSource interpolate with slerpFlat like three.js: Quaternion#slerp returned the earlier key for near-identical dequantized keys, up to 0.9 degrees off what the client plays. Check P1 now loads a pack with three.js's GLTFLoader and compares. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
This was referenced Nov 9, 2026
A heel sinking while its ball is in a contact window was pitched about the ankle, which swept the planted ball forward (bebezao-de-feira crouchwalk: 2.5 cm slide before the clamp, 4.3 cm after, limit 4.06). The clamp now takes the contact windows (bake passes result.contacts), turns such a foot about the ball and moves the ankle there by leg IK; the ball stays put (check clause Q4: 0.00 cm, 2.1 cm about the ankle). bebezao crouchwalk: 2.91 cm. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Foot IK keeps knees bound bent at least 15 degrees on their own bend side (padre-parapsicologo's crouch folded the thigh 176 degrees). Head bends past 20 degrees give 60 percent of the excess to the neck with the gaze unchanged (death stretch 4.2x to 2.9x on boneco-falante-87, coelho-pascoa-shopping, coronel-arrego). Legs bound past 37.5 degrees are not aligned (bebe-reborn walk1h hips). The reach drop may reach 12 cm (boneca-da-cristaleira crouchwalk slide 6.3 to 3.8 cm). bake --state-source bakes a state from another reference clip of the same kind; clip QA tags hips rise as rig only past 45 degrees of bind knee bend. Checks A14 and A15. Re-gated on 130 characters: 0 strict passes lost, 73 gained. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
A cape, robe or coat skinned to the Hips counted as body: in a crouch its hem crossed the floor, the clamp raised the hips by its depth, and with the hem then resting on the floor the drop never brought them back (soles 30 cm up on dracula, 33 cm on satanista-talkshow, 13 cm on vlad). Torso- or arm-weighted vertices below mid-thigh in the bind pose are now a passive hem region that neither lifts nor holds up the body, and the floor is the lowest sole vertex of the bind pose (soleFloor). Thigh vertices stay body. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
The float gate took the lowest vertex of any kind, so a hem lying on the floor hid soles floating 7 to 35 cm. It now skips hem vertices, measures against the sole floor, reports hem apart and the lowest sole's highest point (soleMaxCm, not gated: kneels and deaths rest on knees and torso with the feet up). On the old bakes of the 130 characters it fails 42 clips the old gate passed, all floating soles over a hem. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Q4 bakes a crouch on the synthetic body with a skirt down to 14 cm above the floor: the hem goes 23.6 cm through the floor and the soles stay on it. The old rule (hem in the lifting body region) floats the soles 23.6 cm and the float gate must fail it with the hem on the floor. Reverting either the clamp or the QA turns the clause red. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
130 characters re-baked and gated before and after: 7636 and 7638 of 11050 clips pass, none lost. Ten rigs bake differently, only in the hips track. Cloth skinned to a leg (padre-parapsicologo, microfonildo) stays a residual. Agent: Claude Code Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Member
Author
|
Local verification on head 9f6dd43 (Linux, Node 26.12.1): npm ci PASS; npm run check PASS (156 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 1 of the pilot was a straight port of the client's
retarget-mixamo.mjs+retarget-glb.mjs. Six Mixamo clips baked onto capitao-caveira floated 5.7 to 8.1 cm off the floor in 5 of 6 clips, because the hips-height ratio is only right while the character stands up straight. This PR adds the Studio conversion pipeline, a QA gate that measures this kind of failure, and the whole P0 catalog converted and gated on two characters.Stacked on #4 (base
feat/blender-character-rig-20261109).What's in it
tools/animations/convert-clips.mjs: Mixamo FBX (any key rate, with or without skin) and Quaternius UAL glTF go to meshy-28 reference clips at 30 fps. Supports trim, loop,in-place | keep | striproot motion (the speed is recorded so the runtime can scale playback), and studio-assets catalog ids as provenance.tools/animations/bake-character.mjs: reference clips go onto one character's rig. It ports theretarget-glbrules (absolute arms,Curl_*untouched, refuses rigs that don't map) and adds a mesh-aware floor clamp: heels, toes, hands, knees and body, with limb IK where no pivot works, plus a final lift or drop of the whole body.tools/animations/clip-qa.mjs: the gate. It checks foot slide inside the source's contact windows, floor penetration per body region (heels at most 1 cm), floating above the source's own foot clearance, hips height, loop seam, two-hand grip, and skin stretch throughrig-pose-test.mjs --clips --states.tools/animations/build-library.mjs+library-report.mjs: the full catalog goes toindex.json, each clip with the pack key it proposes, and per-category verdicts are folded back in.tools/animations/clip-sheet.mjs: Blender contact sheets.docs/animation-conversion.mdhas the bone maps (Mixamo and UAL to meshy-28), method, metadata, thresholds, pilot, library, spine map comparison and residuals.Results
Pilot (6 clips × capitao-caveira + mst): 12/12 pass. Every lowest vertex is within 5 mm of the floor. mst grenade-throw's hand was 5.48 cm into the floor and is now at 0.50 cm; heels are at most 0.50 cm into the floor.
Library (437 catalog clips; 419 converted, 18 skipped: T-pose, rig file, 2 swim, 14 repeated takes; 0 conversion failures): 381/419 pass on mst, 383/419 on capitao-caveira with the current converter (372 and 367 before the packed-run fixes).
Keys: 10 runtime-state candidates, 66 of the 68 contract extra names (there's no
draw_pistol/holster_pistolsource, and nowalkfirestate source), 99emote_*. The vocabulary now comes from #5: this branch merges it and importsextraClipNamesfromtools/lib/character-pack.mjs, and the check asserts the library's 45 converter names equal the contract'sconverterExtraClipNames.Spine map: I compared both maps on the 10 current game states that have a catalog source, on mst, capitao-caveira and doutora. With the client's name-based map, the lowest spine joint bends 16 to 57° where the source bends 6 to 25°. That is a visible waist kink in the walk and run side views. Back stretch is equal (mst 3.311× vs 3.312×) or lower with the anatomical map (capitao-caveira 1.95× vs 2.25×). Recommendation: keep the anatomical map. The client is unchanged.
Verification
The check has no Mixamo or UAL bytes. It uses synthetic bone trees with scrambled rest frames, a UAL-like Z-up glTF, a synthetic skinned body, and one mutant per QA gate. The fixes carry negative controls: without contact + IK, shin proportions slide 4.5 cm; without limb alignment, the knee stays 18° bent; without loop-aware ramps, the seam opens. It also covers the floor clamp cases, the FBX footer fallback on 32- and 64-bit records, and the library plan and key rules.
Private outputs stay outside the repo, under
csbrasil/local/anim-conv-20261109/: the library index is atlibrary/index.json, the summaries atlibrary/summary-round{1,2,3}.mdandsummary-final.md, the spine evidence inspine/, and the sheets insheets/(library-keyed-*.png,library-8way-capitao-caveira.png,spine-compare-*.png).Residual issues
Written with AI assistance (Claude Code). The commits carry the
Agent: Claude Codetrailer.Legacy client rigs (P5 pilot, later commits)
bake-character.mjsnow bakes the client's 100 legacy rigs (74 bodies, 26 skins) by joint name. I baked the 11 states and the 21 contract extras on all of them and compared against the clips the client ships today, with no client change. Results with rig-weight stretch set aside:Fixes the run surfaced, over three rounds:
shoeregion for shins skinned below the ankle.[rig]or[clip]from the worst vertex's weights.No state passes as a shared clip on more than 35 of 100 rigs, so every state has to be baked per character (about 255 KB merged, 53 KB gzip after resampling and int16 rotations). Details are in the doc's "Legacy client rigs" section.
Packs and the 130-character run (later commits)
tools/animations/pack-character.mjswrites per characterstates.glb(11 states),extra.glb(the contract extras, lazy) andmanifest.json(sha256, bytes, clips, durations, loop, speed in m/s, catalog provenance). Packs resample keys and store rotations as normalized int16. That is core glTF and the client'sGLTFLoaderdequantizes it in_getArrayFromAccessor, so no extension or decoder is needed.clip-qa --packgates the packed data as stored.Sizes per character: states 329 KB (162 KB gzip) uncompressed, 146 KB (53 KB gzip) packed. The 66 extras go from 2.06 MB (1.01 MB gzip) to 1.06 MB (443 KB gzip). Meshopt would take another 15 to 25% off the gzip size, and the client already ships
MeshoptDecoder(29 KB), but the Studio readers would need it too, so it's not applied.Ran on 130 characters (100 legacy rigs plus the 30 Blender rigs that pass v4), 11 states and 66 extras each:
--passive-knees, because its tail is skinned toRightLeg. States hips at most 1.037 of bind height, at most 2 cm above the source's feet. The tail still sinks up to 29 cm (52 cm with today's clips) until the weights get fixed.Remaining: hips 1.08 to 1.16 on run diagonals for short-legged Blender rigs (53), crouch-walk diagonal slides of 4 to 8 cm (42), and stretch on four clips that also stretch mst a little (3.6x). New check clauses: A13 (bent-bound leg kept), B3 (grip 4.8 to 1.9 cm), P1 (pack round trip within 0.003 degrees).
Family packs, meshopt, emotes (later commits)
The single
extra.glbis now split so a match loads only what it needs:loco.glb(45 clips: directions, turns, jump phases, pistol locomotion, aim idles),combat.glb(14: reload, draw/holster, hits, grenade, knife, shoot variants) andceremony.glb(7: victory, defeat, deaths). Emotes stay out of the packs, as one file per emote underemotes/. For now there are 8 curated ones: capoeira ginga, meia lua de frente, bencao, breakdance uprock, freeze var 2, salute, being cocky and happy hand gesture. The reasons are in the doc.Packs are now meshopt-encoded in lossless mode (no filters). The client's GLTFLoader already registers MeshoptDecoder, and Studio reads them through the
meshoptimizerpackage. Gzip sizes per character: states 45 KB, loco 163 KB, combat 99 KB, ceremony 96 KB, emotes 9 to 24 KB each. On 130 characters and 85 clips, packing changes no QA verdict (0 lost, 0 gained).While checking the packs against three.js I found the Studio readers used
Quaternion#slerp. That returns the earlier key when two dequantized keys are nearly identical, so QA was up to 0.9 degrees off what the client plays. They now interpolate withslerpFlatlike three.js does. Check P1 loads a pack with three.js's GLTFLoader and gets within 3e-6 degrees of the Studio reader.Ball pivot in the floor clamp (later commit)
bebezao-de-feira's pack was blocked by its
crouchwalk: 4.26 cm of slide against a 4.06 cm limit. Before the floor clamp it was 2.46 cm. The clamp lifted a heel that sank during heel-off by pitching the foot about the ankle, and that swept the planted ball forward. Now a heel that sinks while its ball is in a contact window turns about the ball, the ankle follows by leg IK, and the ball stays put (check Q4: 0.00 cm, 2.1 cm about the ankle). bebezao crouchwalk is now 2.91 cm. The limit is unchanged.Re-gated on the 130 characters against the previous run: 0 packed passes lost, 20 gained (7537 to 7557 of 11050), and packed vs uncompressed verdicts are still identical.
Fixes from the 0.2.0 pack audit (later commit)
The 33 installed 0.2.0 packs were gated again as shipped. Nine characters had a state clip with a non-rig failure: death stretch on six of them, padre's crouch, boneca's crouchwalk slide and bebe-reborn's walk1h hips. Fixed in the bake, with no limit changed:
bake --state-sourcebakes a state from another clip of the same kind. chupa-cabra, dama-creepy, dracula and padre usedeath_headshot_frontfor death.Re-gated on 130 characters: 0 strict passes lost and 73 gained. The per-character flags are listed in the doc. New checks: A14 (knee side) and A15 (neck spread).