Skip to content

Support multiple avatar rigs (avatar1-3) alongside humanoid - #124

Open
edib wants to merge 2 commits into
posecode-dev:mainfrom
edicate:main
Open

Support multiple avatar rigs (avatar1-3) alongside humanoid#124
edib wants to merge 2 commits into
posecode-dev:mainfrom
edicate:main

Conversation

@edib

@edib edib commented Aug 12, 2026

Copy link
Copy Markdown

Description

Previously the rig directive in a .posecode document only accepted the
literal value humanoid, and the renderer always showed one fixed character
(characterUrl) regardless of the loaded document. This adds avatar1,
avatar2, and avatar3 as valid rig names and wires that value all the way
through to character selection: the viewer resolves each loaded document's
rig against a new characterUrls map and hot-swaps the visible character
accordingly. A rig with no mapped character (or any load failure) falls back
to the zero-asset procedural figure — the scene never blanks.

What changed

  • posecode-parser: RIG_NAMES extended to humanoid | avatar1 | avatar2 | avatar3.
  • posecode-render: new characterUrls (rig name → GLB URL) option on
    createViewer. Viewer.load(ir) resolves the document's rig against it
    and 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 over characterUrls,
    so current callers are unaffected.
  • posecode-embed: the character attribute is now rig-driven by default
    (absent → each document's rig picks its hosted character); an explicit URL
    still pins one character regardless of rig, and character="off" still
    disables it entirely.
  • playground: a CHARACTER_URLS map (humanoid → xbot.glb, avatar1/2/3 → avatarN.glb) is wired into the viewer; added the three avatar GLB assets
    under public/models/.
  • Editor/tooling parity: hover docs, autocomplete (rig now suggests all
    four names), VS Code syntax highlighting, and the LSP completion-kind map
    updated for the new rig names.
  • Docs: spec/SPEC.md grammar + IR comment, spec/llm-authoring.md
    closed-vocabulary reference, and the posecode-render/posecode-embed/root
    READMEs updated to document characterUrls and the bone/T-pose requirements
    for a custom rig.
  • Unrelated fix found while testing: playground/play.html referenced its
    script/stylesheet with relative paths (./src/main.ts), which resolve
    incorrectly in vite dev when navigating directly to /play/<preset-slug>
    (the URL the landing page's own CTAs link to) — the browser requested
    /play/src/main.ts and got a 404/wrong-MIME response. Switched to
    root-absolute paths; production builds were unaffected since Vite rewrites
    these during bundling regardless.

Note for reviewers

avatar1.glb / avatar2.glb / avatar3.glb are new binary GLB assets.
xbot.glb's Adobe/Mixamo terms are documented in
docs/legal/THIRD_PARTY_NOTICES.md — worth confirming the source/license of
the three new avatars before merge and adding an equivalent notice if needed.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • My code follows the code style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new TypeScript/compiler warnings or errors:
    • Running npm run typecheck passes successfully
    • Running npm run build compiles without errors
  • I have run the unit test suite (npm test) and all tests pass (456/456)
  • If applicable, I have run the fidelity evals (npm run eval) and all checks pass (1620/1620)
  • If I added a new movement, I ran node scripts/generate-content-pages.mjs to regenerate the static pages — N/A, no new movement added

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

@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.

@a-baran-orhan

Copy link
Copy Markdown
Member

@edib I prepared and validated the follow-up fixes here: edicate#1

Because #124 has maintainer edits disabled, please merge that draft PR into edicate/posecode:main; #124 will update automatically and remain authored by you.

The follow-up separates avatar appearance from rig humanoid, hardens async character swapping/fallbacks, removes the duplicate avatar1 asset, reduces avatar3 from ~35 MB to 7.4 MB, adds race/parser/tooling tests and a changeset, fixes the release peer range, and removes unrelated diff noise.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants