hackbuild-motion.rig

humanoid bone name mapper without per rig tables, limb chains, rest pose analysis, and the expression and viseme table. rust core in wasm.

open the full tool

how this works
how it works

every package in this repository works in one normalized humanoid space: vrm 1.0 bone names, t pose, +z forward, meters, feet at y = 0. this package gets a rig there.

mapRig splits each bone name into a side, body part words and a number, scores the candidates and picks the 55 vrm bones with no per rig table. the report lists missing required bones, helper bones and a guess at the dialect (mixamo, vroid, mmd and others).

analyzeRest measures facing, units and floor from the rest pose, and the three.js adapter applies the fix. limbChains gives the chain model for non humanoids: legs, tail, ears, spine, neck and head, each with a root, a tip and a pole.

packages@hackbuild/rig
install
sh
npm install @hackbuild/rig
code
ts
import { load, mapRig, resolveExpressions } from "@hackbuild/rig";
import { mapObject3D, restOf, applyRestFix } from "@hackbuild/rig/three";

await load(); // inlined wasm; or a URL or bytes
const { report, bones } = mapObject3D(gltf.scene);
if (report.missingRequired.length) console.warn("not a humanoid:", report.missingRequired);
const rest = restOf(bones);
if (rest) applyRestFix(gltf.scene, bones, rest); // faces +Z, meters, feet on y = 0, T pose arms

const face = resolveExpressions(morphNamesOf(gltf.scene));
face.aa?.binds; // [{ morph: "viseme_aa", weight: 1 }] on a Ready Player Me style head