Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(motion-glb): stop AnimationClip.parse choking on the library's userData

nirholasdaf5f86689c4
diff --git a/api/_lib/motion-glb.js b/api/_lib/motion-glb.js
index a75dc9cdd..764280436 100644
--- a/api/_lib/motion-glb.js
+++ b/api/_lib/motion-glb.js
@@ -385,7 +385,16 @@ function prepareClip(source, gltf, { retarget, name }) {
return { clip: source, hipScale: 1, coverage: 1, droppedTracks: [] };
}
const basis = restBasisFromGltf(gltf);
- const parsed = AnimationClip.parse({ ...source, name: name || source.name || 'motion' });
+ // AnimationClip.parse reads `userData` with JSON.parse, so it wants a STRING,
+ // while toLibraryClip writes the object form the library serves. Hand parse
+ // only the fields it understands rather than depending on which shape arrived.
+ const parsed = AnimationClip.parse({
+ name: name || source.name || 'motion',
+ duration: source.duration,
+ tracks: source.tracks,
+ uuid: source.uuid,
+ blendMode: source.blendMode,
+ });
// Root translation is authored around the source rig's hip height; scale it
// onto this one, clamped exactly as retargetClipToRig clamps it so a