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(rig-doctor): read the advertised convention count from rig-report instead of a hand-typed copy

nirholasd0cbc92ca6e5
diff --git a/pages/rig-doctor.html b/pages/rig-doctor.html
index 7e77b41ec..b0ed2acff 100644
--- a/pages/rig-doctor.html
+++ b/pages/rig-doctor.html
@@ -106,7 +106,7 @@
<button type="button" class="rd-sample" data-sample="/avatars/michelle.glb" data-sample-name="michelle.glb" data-tip="A Mixamo rig: every joint maps, full clip library plays">
Mixamo rig
</button>
- <button type="button" class="rd-sample" data-sample="/avatars/realistic-halfbody.glb" data-sample-name="realistic-halfbody.glb" data-tip="A halfbody avatar: hands rigged, legs missing entirely">
+ <button type="button" class="rd-sample" data-sample="/avatars/realistic-halfbody.glb" data-sample-name="realistic-halfbody.glb" data-tip="A halfbody avatar: torso and hands map, arms and legs do not">
Halfbody
</button>
<button type="button" class="rd-sample" data-sample="/avatars/fox.glb" data-sample-name="fox.glb" data-tip="A skinned but non-humanoid rig: nothing maps">
@@ -121,8 +121,8 @@
<ul class="rd-hero-facts">
<li><strong>0 bytes</strong> leave your machine</li>
- <li><strong>52</strong> canonical joints scored</li>
- <li><strong>11</strong> rig conventions recognised</li>
+ <li><strong id="rd-fact-joints">52</strong> canonical joints scored</li>
+ <li><strong id="rd-fact-conventions">12</strong> rig conventions recognised</li>
<li><strong>1</strong> click to download the repair</li>
</ul>
</div>
@@ -267,9 +267,9 @@
<h3>Most rigs are one rename away</h3>
<p>
Mixamo, Avaturn, Ready Player Me, Unreal, VRM, Daz, Rigify, Biped,
- HumanIK, Reallusion, and MakeHuman all name the same joints
- differently. The canonicalizer already knows every one of those
- dialects, and it can rewrite your file in place.
+ HumanIK, Reallusion, MikuMikuDance, and MakeHuman all name the same
+ joints differently. The canonicalizer already knows every one of
+ those dialects, and it can rewrite your file in place.
</p>
</article>
<article class="rd-explain-card">
diff --git a/src/rig-doctor-page.js b/src/rig-doctor-page.js
index 0a5e928b4..2e0b6d0bc 100644
--- a/src/rig-doctor-page.js
+++ b/src/rig-doctor-page.js
@@ -17,7 +17,7 @@
// the heaviest thing on the page, and a visitor who reads the explainer and
// leaves should not pay for them.
-import { analyzeGlb, manifestFromReport, formatBytes, CANONICAL_TOTAL } from './rig-report.js';
+import { analyzeGlb, manifestFromReport, formatBytes, CANONICAL_TOTAL, CONVENTION_COUNT } from './rig-report.js';
import { canonicalizeGLBBones } from './glb-canonicalize.js';
// Clips offered under the preview, chosen so each one exercises a different
@@ -57,6 +57,7 @@ const state = {
// ── Entry ────────────────────────────────────────────────────────────────────
function init() {
+ syncFacts();
wireDropZone();
wireSamples();
wireTabs();
@@ -73,6 +74,17 @@ function init() {
}
}
+// The hero counts are claims about the analyser, so they come from the analyser.
+// The markup carries the same numbers for a reader with no JavaScript, and these
+// two lines are what stop the pair drifting apart the next time a convention or
+// a canonical joint is added.
+function syncFacts() {
+ const conventions = $('rd-fact-conventions');
+ if (conventions) conventions.textContent = String(CONVENTION_COUNT);
+ const joints = $('rd-fact-joints');
+ if (joints) joints.textContent = String(CANONICAL_TOTAL);
+}
+
// ── Input ────────────────────────────────────────────────────────────────────
function wireDropZone() {
@@ -381,6 +393,10 @@ function renderRenames(report) {
const panel = $('rd-renames-panel');
if (!renames.length) {
panel.hidden = true;
+ // Clear as well as hide. A hidden panel that still holds the previous
+ // file's rows is a lie the moment anything unhides it, and it keeps a
+ // file the user has already replaced alive in the DOM.
+ $('rd-renames').innerHTML = '';
return;
}
panel.hidden = false;
@@ -409,6 +425,7 @@ function renderUnmapped(report) {
const panel = $('rd-unmapped-panel');
if (!list.length) {
panel.hidden = true;
+ $('rd-unmapped').innerHTML = '';
return;
}
panel.hidden = false;
diff --git a/src/rig-report.js b/src/rig-report.js
index 4da934cbd..36e9effd3 100644
--- a/src/rig-report.js
+++ b/src/rig-report.js
@@ -138,6 +138,13 @@ const CONVENTIONS = [
},
];
+/**
+ * How many authoring conventions the fingerprinter knows. The Rig Doctor page
+ * advertises this number in its hero, and a hand-typed copy of it went stale
+ * the first time a convention was added, so the page reads it from here.
+ */
+export const CONVENTION_COUNT = CONVENTIONS.length;
+
// Oculus/OVR viseme set — what the lip-sync pipeline drives. An avatar missing
// these can still animate; it just cannot speak with its mouth.
const OVR_VISEMES = ['viseme_sil', 'viseme_PP', 'viseme_FF', 'viseme_TH', 'viseme_DD', 'viseme_kk', 'viseme_CH', 'viseme_SS', 'viseme_nn', 'viseme_RR', 'viseme_aa', 'viseme_E', 'viseme_I', 'viseme_O', 'viseme_U'];
diff --git a/tests/rig-report.test.js b/tests/rig-report.test.js
index 777bd9eb7..f2f002c65 100644
--- a/tests/rig-report.test.js
+++ b/tests/rig-report.test.js
@@ -15,6 +15,7 @@ import {
formatBytes,
MIN_CANONICAL_BONES,
CANONICAL_TOTAL,
+ CONVENTION_COUNT,
LIMB_GROUPS,
} from '../src/rig-report.js';
@@ -207,3 +208,24 @@ describe('formatBytes', () => {
expect(formatBytes(5 * 1024 * 1024)).toBe('5.0 MB');
});
});
+
+// The /rig-doctor hero advertises "N rig conventions recognised" and "52
+// canonical joints scored". The page rewrites both from this module at runtime,
+// but the markup still carries them for a reader with JavaScript off, and that
+// static copy had already gone stale by one convention. These assertions fail
+// the moment the two disagree again.
+describe('the /rig-doctor hero facts match the analyser', () => {
+ const html = readFileSync(join(ROOT, 'pages/rig-doctor.html'), 'utf8');
+
+ it('states the number of conventions the fingerprinter actually implements', () => {
+ const m = html.match(/<strong id="rd-fact-conventions">(\d+)<\/strong>/);
+ expect(m, 'pages/rig-doctor.html lost its #rd-fact-conventions element').not.toBeNull();
+ expect(Number(m[1])).toBe(CONVENTION_COUNT);
+ });
+
+ it('states the size of the canonical skeleton it actually scores against', () => {
+ const m = html.match(/<strong id="rd-fact-joints">(\d+)<\/strong>/);
+ expect(m, 'pages/rig-doctor.html lost its #rd-fact-joints element').not.toBeNull();
+ expect(Number(m[1])).toBe(CANONICAL_TOTAL);
+ });
+});