Support multiple avatar rigs (avatar1-3) alongside humanoid - #124
Conversation
|
@edib is attempting to deploy a commit to the johndoe's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@edib I prepared and validated the follow-up fixes here: edicate#1 Because #124 has maintainer edits disabled, please merge that draft PR into The follow-up separates avatar appearance from Validation passed: 463 tests, typecheck, production/package builds, package checks, and 1620/1620 movement eval checks. One blocker still needs your input before merge: please confirm the source/license provenance for avatar2 and avatar3 so the correct third-party notice can be added. |
Description
Previously the
rigdirective in a.posecodedocument only accepted theliteral value
humanoid, and the renderer always showed one fixed character(
characterUrl) regardless of the loaded document. This addsavatar1,avatar2, andavatar3as valid rig names and wires that value all the waythrough to character selection: the viewer resolves each loaded document's
rigagainst a newcharacterUrlsmap and hot-swaps the visible characteraccordingly. A rig with no mapped character (or any load failure) falls back
to the zero-asset procedural figure — the scene never blanks.
What changed
RIG_NAMESextended tohumanoid | avatar1 | avatar2 | avatar3.characterUrls(rig name → GLB URL) option oncreateViewer.Viewer.load(ir)resolves the document'srigagainst itand swaps the driver skeleton/skinned character (disposing the old one and
resetting any active mocap clip layer so it retargets onto the new mesh).
The existing
characterUrl(single, fixed) still wins overcharacterUrls,so current callers are unaffected.
characterattribute is now rig-driven by default(absent → each document's
rigpicks its hosted character); an explicit URLstill pins one character regardless of
rig, andcharacter="off"stilldisables it entirely.
CHARACTER_URLSmap (humanoid → xbot.glb,avatar1/2/3 → avatarN.glb) is wired into the viewer; added the three avatar GLB assetsunder
public/models/.rignow suggests allfour names), VS Code syntax highlighting, and the LSP completion-kind map
updated for the new rig names.
spec/SPEC.mdgrammar + IR comment,spec/llm-authoring.mdclosed-vocabulary reference, and the posecode-render/posecode-embed/root
READMEs updated to document
characterUrlsand the bone/T-pose requirementsfor a custom rig.
playground/play.htmlreferenced itsscript/stylesheet with relative paths (
./src/main.ts), which resolveincorrectly in
vite devwhen navigating directly to/play/<preset-slug>(the URL the landing page's own CTAs link to) — the browser requested
/play/src/main.tsand got a 404/wrong-MIME response. Switched toroot-absolute paths; production builds were unaffected since Vite rewrites
these during bundling regardless.
Note for reviewers
avatar1.glb/avatar2.glb/avatar3.glbare new binary GLB assets.xbot.glb's Adobe/Mixamo terms are documented indocs/legal/THIRD_PARTY_NOTICES.md— worth confirming the source/license ofthe three new avatars before merge and adding an equivalent notice if needed.
Type of Change
Checklist
npm run typecheckpasses successfullynpm run buildcompiles without errorsnpm test) and all tests pass (456/456)npm run eval) and all checks pass (1620/1620)node scripts/generate-content-pages.mjsto regenerate the static pages — N/A, no new movement added