Skip to content
Shapemetry

Types - Skeleton

API reference for ./evaluate/skeleton on @huukhanhnguyen/types.

See the Guide for the package's role.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

Skeleton

type

Resolved joint hierarchy from a skeletons[] chain. name = the chain's key (sole identity — no dual name field). A face's skin.skeleton references this name; skin.indices are ordinals into joints, so the ORDER of joints is an index space, not an implementation detail.

type Skeleton
// = {
    name: string;
    /** Joints in skin order (DFS pre-order from nested joint authoring). */
    joints: SkeletonJoint[];
}

SkeletonJoint

type

One skeleton joint — a local FRAME, plus optional animation REFERENCES. Authored as a nested joint node on the skeletons[] lane (parent implied by nesting; flat list after evaluateSkeletons DFS pre-order). parent names another joint in the SAME list; absent = a root, whose rest transform is measured in skeleton space.

position / rotation / scale are the joint's REST transform relative to its parent — the pose with no animation playing — composed T·R·S, the order glTF mandates. The three ARE one affine frame; they are stored decomposed because a rotation must be slerped when animated and because a matrix cannot be an animation target. Absent rotation genuinely means identity, absent scale genuinely means [1, 1, 1].

Bind data does NOT live here. An inverse bind matrix is world_rest(J)⁻¹ — a fact about the moment a MESH was attached, not a property of a joint: one skeleton admits a different bind array per attached mesh, so it cannot have a single value here. Where bind ≡ rest (everything this kernel binds itself, via faceSkeleton) it is derived, not stored; the glTF writer derives it the same way.

positionTrack / rotationTrack / scaleTrack are optional Track.key references (2026-08-14) — this joint's OWN animated channel, resolved against the model's track pool. Consumer-holds-the-reference, matching Maya's animCurve→attribute DG connection and Houdini's CHOP wiring: the track itself declares no target, the joint declares which track drives it. Absent = that channel never animates.

type SkeletonJoint
// = {
    name: string;
    parent?: string;
    position: Point;
    rotation?: Quaternion;
    scale?: Vector;
    positionTrack?: string;
    rotationTrack?: string;
    scaleTrack?: string;
}
Last updated: 📖 2 min readEdit on GitHub