glb-rig

A mesh file's triangles for rigging, read with no engine. The same BodyTriangles that loadRigTriangles (rig-build) gives from a Babylon scene, read straight from a GLB's bytes: in Bun or Node, in a worker, in a test, or in a headless export. Hand the result to bodyFromMarkers with a character file's markers and you have its RiggedBody with no scene at all.

import { glbRigTriangles } from 'tosijs-3d/glb-rig'
import { bodyFromMarkers } from 'tosijs-3d/rigged-body'

const bytes = new Uint8Array(await (await fetch(url)).arrayBuffer())
const tris = glbRigTriangles(bytes)
const body = bodyFromMarkers(tris, { markers, source: url })

What it gives, and how it agrees with the Babylon path (a test loads the same files both ways and compares them):

Only triangle lists are read (mode 4, the default); other primitives (lines, points, strips) are skipped. Compressed geometry (Draco, meshopt) is not read: it throws, naming the extension.

The rig from it is DETERMINISTIC: the same bytes and the same markers give the same weights, so a saved character exports the same every time.