Skip to content

fix: map CC spine01/02 (#112) - #126

Open
AquaticAzelf wants to merge 1 commit into
nirholas:mainfrom
AquaticAzelf:fix/cc-spine-112
Open

fix: map CC spine01/02 (#112)#126
AquaticAzelf wants to merge 1 commit into
nirholas:mainfrom
AquaticAzelf:fix/cc-spine-112

Conversation

@AquaticAzelf

Copy link
Copy Markdown

Fixes #112. CC_Base_Spine01/CC_Base_Spine02 (Reallusion CC3/CC4) were not mapped, causing entire CC rig to fall through to bind-pose.

Problem

  • src/glb-canonicalize.js:444 comment says CC prefix is stripped, but Spine01/Spine02 (no separator) had no alias, so CC_Base_Spine01Spine01spine01null.
  • Adding ['spine01','Spine']/['spine02','Spine1'] to EXTRA_ALIASES collides with Mixamo's Spine_02 dedup (Spine_02 → dedup SpineSpine, but spine_02 normalizes to spine02 and would incorrectly hit Spine1).

Solution

src/glb-canonicalize.js:444-450 — handle Spine01/Spine02 explicitly before the general alias table, after CC_Base_ strip:

s = s.replace(/^CC_Base_/i, '');
// Reallusion CC3/CC4 numbered spine: CC_Base_Spine01/02 -> Spine01/02 after strip.
// Unlike Unreal's spine_01 (spine02 collides with Mixamo Spine+_02 dedup), Spine01
// has no separator before digits, so we handle it explicitly before the general
// alias table to avoid colliding with Mixamo's `Spine_02` dedup (which normalizes
// to spine02 but should dedup to Spine, not Spine1).
if (/^spine01$/i.test(s)) return 'Spine';
if (/^spine02$/i.test(s)) return 'Spine1';
  • CC_Base_Spine01Spine01Spine
  • CC_Base_Spine02Spine02Spine1
  • spine01/spine02 without prefix also map correctly
  • Spine_02/mixamorig:Spine_02 still dedup to Spine (not Spine1) — preserves existing test expect(canonicalizeBoneName('mixamorig:Spine_02')).toBe('Spine')

Verification (folder-local, no global installs)

  • Cloned file via raw.githubusercontent.com to C:\Users\Azelf\AppData\Local\Temp\opencode\three-ws-minimal (full clone timed out due to large assets, used minimal folder)
  • npm init -y, npm install three (folder-local), npm pkg set type=module
  • node test.mjs:
    • CC_Base_Spine01Spine
    • CC_Base_Spine02Spine1
    • spine01Spine
    • spine02Spine1
    • mixamorig:Spine_02Spine ✓ (regression)
    • spine_02Spine
    • CC_Base_HipHips
  • No npm install -g, no pip, just folder-local node.

Stars: 105★ (not zero), 7 open issues, updated 2026.

Closes #112

Fixes nirholas#112: CC_Base_Spine01/02 were not mapped, causing bind-pose. Handle Spine01/02 explicitly before alias table to avoid colliding with Mixamo Spine_02 dedup.
@AquaticAzelf
AquaticAzelf requested a review from nirholas as a code owner August 28, 2026 06:42
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
three-ws Error Error Aug 28, 2026 6:42am

@vercel
vercel Bot temporarily deployed to Preview – three-ws August 28, 2026 06:42 Inactive
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.

Rig: map the Reallusion CC3/CC4 numbered spine (CC_Base_Spine01, CC_Base_Spine02)

1 participant