Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8f966f1
Add optional named clips to the character pack contract
rubenmarcus Nov 9, 2026
011b058
Require every extra-clip rule with synthetic mutants
rubenmarcus Nov 9, 2026
76ab7f7
Share the synthetic humanoid and let the pose test measure any clip
rubenmarcus Nov 9, 2026
208f9fb
Convert Mixamo and UAL clips to meshy-28 and bake them per character
rubenmarcus Nov 9, 2026
a5ddd11
Add the clip QA gate and contact sheets
rubenmarcus Nov 9, 2026
bf3ce1c
Check the animation conversion on synthetic skeletons
rubenmarcus Nov 9, 2026
ced4e4f
Document the animation conversion pipeline and the pilot
rubenmarcus Nov 9, 2026
6fbdf78
Spell out ranges in the animation conversion notes
rubenmarcus Nov 9, 2026
5f8c056
Keep heels, toes, hands and knees above the floor at bake time
rubenmarcus Nov 9, 2026
48c87d0
Close remaining floor and source-relative gaps found by the full library
rubenmarcus Nov 9, 2026
d397c8b
Build the animation library from the studio-assets catalog
rubenmarcus Nov 9, 2026
68add7e
Document the floor clamp, the library and the spine map comparison
rubenmarcus Nov 9, 2026
6e650fc
Extend the extra-clip vocabulary with the converter library names
rubenmarcus Nov 9, 2026
2a046be
Require the vocabulary to cover the converter set with mutants
rubenmarcus Nov 9, 2026
3e79d53
Bake the legacy client rigs: shoes on shins, ball locks, closed loops…
rubenmarcus Nov 9, 2026
13d10af
Snap facing to quarter turns, cap rest alignment, drop hips to reach …
rubenmarcus Nov 9, 2026
4d77293
Document the legacy client rig run and the packaging it implies
rubenmarcus Nov 9, 2026
2725317
Merge the pack optional-clips contract (PR #5) for its extra-clip voc…
rubenmarcus Nov 9, 2026
7203b11
Take the extra-clip vocabulary from the pack contract
rubenmarcus Nov 9, 2026
5b6cd53
Pack per-character clips: resampled keys, int16 rotations, gated as s…
rubenmarcus Nov 9, 2026
8be967f
Keep bent-bound legs, hold two-hand grips, tag bent-knee hips rise as…
rubenmarcus Nov 9, 2026
b2fb815
Check the two-hand grip hold; settle it in up to three passes
rubenmarcus Nov 9, 2026
f11a3bb
Document packs, the 130-character packed run, grip hold and bent-boun…
rubenmarcus Nov 9, 2026
643c5c3
Split packs by family, meshopt-encode them, read clips as three.js in…
rubenmarcus Nov 9, 2026
53d09a2
Document family packs, curated emotes and the round 4 library numbers
rubenmarcus Nov 9, 2026
46b2b1e
Turn a heel about its planted ball in the floor clamp
rubenmarcus Nov 9, 2026
ed671f6
Document the ball pivot of the floor clamp
rubenmarcus Nov 9, 2026
3e995dd
Fix the state clips the 0.2.0 pack audit found failing
rubenmarcus Nov 10, 2026
0e88708
Keep a hanging hem from lifting the body in the floor clamp
rubenmarcus Nov 11, 2026
95e378a
Gate floating on the body without its hanging cloth
rubenmarcus Nov 11, 2026
910c237
Check a Hips-skinned hem crossing the floor in a crouch
rubenmarcus Nov 11, 2026
9f6dd43
Document the hem region and the 130-character re-run
rubenmarcus Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
367 changes: 367 additions & 0 deletions docs/animation-conversion.md

Large diffs are not rendered by default.

35 changes: 29 additions & 6 deletions docs/character-pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ On top of the common fields (`schemaVersion`, `kind`, `id`, `version`, `source`,
| --- | --- |
| `model` | One package path ending in `.glb`: the rigged, skinned character. |
| `skeleton` | `"meshy-28"` (see below). |
| `animations` | Object keyed by state. Required: `idle`, `walk`, `run`, `shoot`, `death`, `crouch`, `crouchwalk`, `jump`. Optional: `idle1h`, `walk1h`, `walkfire`. No other keys. Each value is a distinct `.glb` path. |
| `animations` | Object keyed by state. Required: `idle`, `walk`, `run`, `shoot`, `death`, `crouch`, `crouchwalk`, `jump`. Optional: `idle1h`, `walk1h`, `walkfire`, plus one optional `extra` map of named clips (see below). No other keys. Each state value is a distinct `.glb` path. |
| `previews` | At least one portrait image path (`.png`, `.jpg`, `.jpeg` or `.webp`). |
| `rights` | `{ "status": "original" \| "public-domain" \| "political-satire", "basis": "<why this is clear>", "references": ["<citation>", ...] }`; `references` is optional. |
| `budgets` | `{ "triangles": <int ≤ 15000>, "bytes": <int ≤ 16777216> }`. `triangles` bounds the model; `bytes` bounds the sum of every `files[].bytes`. |
| `evidence` | Optional extra paths (for example a provenance sidecar). |

Every file in `files` must be declared by exactly one role (`model`, `animations.<state>`, `previews`, `evidence`) and every declared path must appear in `files`.
Every file in `files` must be declared by exactly one role (`model`, `animations.<state>`, `animations.extra.<name>`, `previews`, `evidence`) and every declared path must appear in `files`. Extra-clip files count toward `budgets.bytes` like any other file.

```json
{
Expand All @@ -28,7 +28,8 @@ Every file in `files` must be declared by exactly one role (`model`, `animations
"files": [{ "path": "model/capitao-caveira.glb", "sha256": "…", "bytes": 1 }],
"model": "model/capitao-caveira.glb",
"skeleton": "meshy-28",
"animations": { "idle": "animations/idle.glb", "walk": "animations/walk.glb", "…": "…" },
"animations": { "idle": "animations/idle.glb", "walk": "animations/walk.glb", "…": "…",
"extra": { "strafe_left": { "file": "animations/extra/strafe-left.glb", "duration": 0.9, "loop": true, "rootMotion": false, "source": "Mixamo Strafe Left retargeted to meshy-28" } } },
"previews": ["previews/portrait.jpg"],
"rights": { "status": "original", "basis": "Invented character; concept prompt forbids likeness of real people and existing characters." },
"budgets": { "triangles": 6000, "bytes": 8388608 }
Expand All @@ -42,9 +43,31 @@ Every file in `files` must be declared by exactly one role (`model`, `animations
- The model is a GLB 2 container with in-bounds buffer views and accessors, finite positions and in-range indices. Every primitive is a triangle list (mode 4), and the triangle count must not exceed `budgets.triangles`.
- The model has exactly one skin, and `inverseBindMatrices` holds one float `MAT4` per joint. Every skinned primitive has a `JOINTS_0` unsigned byte/short `VEC4` and a float or normalized `WEIGHTS_0` `VEC4` per vertex, and every joint index stays inside the skin.
- The skin is exactly meshy-28: 28 joints whose (name, nearest joint ancestor) pairs match the list below as a multiset.
- Each animation GLB contains an animation named exactly as its state that drives at least one meshy-28 bone through a `translation`, `rotation` or `scale` channel. A `weights` channel must target a mesh with morph targets. Every sampler has at least one float keyframe time and the output type and count that match its interpolation (and, for `weights`, the number of morph targets).
- Each animation GLB contains an animation named exactly as its state that drives at least one meshy-28 bone through a `translation`, `rotation` or `scale` channel. A `weights` channel must target a mesh with morph targets. Every sampler has at least one float keyframe time and the output type and count that match its interpolation (and, for `weights`, the number of morph targets). The same rules apply to every `animations.extra` clip, with the animation named exactly as its key.
- Each preview starts with the PNG, JPEG or WebP signature for its extension.


## Optional clips (`animations.extra`)

`animations.extra` is an optional map of named clips beyond the states, for movement set, weapon handling, damage reactions, melee, round outcomes and emotes. Keys match `^[a-z][a-z0-9_]{1,40}$` and must be either a name from the fixed vocabulary below or an `emote_` prefix followed by at least one character. Anything else — including state names and the bare `emote_` prefix — is rejected. The vocabulary is `extraClipNames`/`extraClipPrefixes` in `tools/lib/character-pack.mjs` (68 names: `coreExtraClipNames` plus `converterExtraClipNames`); the client mirrors it in `public/js/data/content-releases.js`.

- Locomotion (cardinals and diagonals; diagonals follow `<gait>_<fwd|back>_<left|right>`): `strafe_left`, `strafe_right`, `walk_back`, `walk_fwd_left`, `walk_fwd_right`, `walk_back_left`, `walk_back_right`, `run_back`, `run_left`, `run_right`, `run_fwd_left`, `run_fwd_right`, `run_back_left`, `run_back_right`
- Sprint: `sprint`, `sprint_back`, `sprint_left`, `sprint_right`, `sprint_fwd_left`, `sprint_fwd_right`, `sprint_back_left`, `sprint_back_right`
- Crouched locomotion and aim: `crouchwalk_left`, `crouchwalk_right`, `crouchwalk_back`, `crouchwalk_fwd_left`, `crouchwalk_fwd_right`, `crouchwalk_back_left`, `crouchwalk_back_right`, `crouch_aim`, `crouch_pistol`, `crouch_turn_left`, `crouch_turn_right`
- Turns (standing): `turn_left`, `turn_right`
- Jump phases: `jump_start`, `jump_loop`, `jump_land`, `jump_pistol`
- Aim, pistol and crouch fire: `idle_aim`, `shoot_pistol`, `shoot_crouch`, `run_pistol`, `run_back_pistol`, `strafe_left_pistol`, `strafe_right_pistol`, `walk_back_pistol`
- Weapon handling: `reload_rifle`, `reload_pistol`, `draw_rifle`, `holster_rifle`, `draw_pistol`, `holster_pistol`
- Damage reactions: `hit_front`, `hit_back`, `hit_left`, `hit_right`, `hit_head`
- Death variants: `death_front`, `death_right`, `death_headshot_front`, `death_headshot_back`, `death_crouch`
- Melee and utility: `grenade_throw`, `knife_idle`, `knife_stab`
- Round outcomes: `victory`, `defeat`
- Emotes: any key starting with `emote_` (for example `emote_danca`)

The converter group (`converterExtraClipNames`) is a snapshot of the names proposed by the animation conversion library (branch `feat/animation-conversion-20261109`, `tools/lib/animation-library.mjs`, 2026-11-09; every name is used by at least one key of its `library/index.json`). `assertExtraClipVocabulary` in `tools/lib/character-pack.mjs` enforces the single source: the vocabulary must equal the core names plus the converter set, with no duplicates, no state collisions and no pattern breaks; `tools/checks/character-pack-check.mjs` proves it against the real exports and synthetic mutants. The conversion tooling must import `extraClipNames` from `tools/lib/character-pack.mjs` instead of maintaining its own name list.

Each entry is an object with exactly five fields: `file` (a distinct `.glb` package path, declared in `files`), `duration` (seconds, positive), `loop` (boolean), `rootMotion` (boolean) and `source` (provenance string, for example the source animation and rig pipeline). `duration`, `loop` and `rootMotion` are declared metadata for the runtime; the GLB itself still carries the authoritative keyframes. A missing `extra` map is valid — optional means absent, not empty promises.

## meshy-28

The shared Meshy humanoid skeleton the runtime clips are baked against, taken from the client donor `public/models/characters/mst.glb` and identical in all 37 offline-rigged Creepypasta Season characters. Skin joint order, with the nearest joint ancestor in parentheses:
Expand All @@ -63,9 +86,9 @@ Photos of real people never enter either repository.

## Checks

`npm run check` builds a synthetic character pack (a programmatic 12-triangle skinned GLB and eleven one-channel clips, no real asset bytes), validates it, and requires each contract mutant to be rejected for its stated reason: missing states, unknown state, misnamed clip, clip driving no meshy-28 bone, clip channel without a path, clip without keyframes or with mismatched output, wrong skeleton id, renamed, reparented or missing bone, missing skin or weights, missing, mistyped or out-of-skin `JOINTS_0`, triangle strips, bad GLB magic or version, triangle and byte budgets (including the byte budget before hashing), bad rights, missing or invalid previews, undeclared files, and hash or size mutations.
`npm run check` builds a synthetic character pack (a programmatic 12-triangle skinned GLB, one-channel state clips and two extra clips, no real asset bytes), validates it, and requires each contract mutant to be rejected for its stated reason: missing states, unknown state, misnamed clip, clip driving no meshy-28 bone, clip channel without a path, clip without keyframes or with mismatched output, wrong skeleton id, renamed, reparented or missing bone, missing skin or weights, missing, mistyped or out-of-skin `JOINTS_0`, triangle strips, bad GLB magic or version, triangle and byte budgets (including the byte budget before hashing), bad rights, missing or invalid previews, undeclared files, hash or size mutations, and the extra-clip rules: unknown, pattern-violating, state-colliding or bare-prefix names, entries with missing or mistyped fields, non-GLB files, missing, duplicate or misnamed clip files, and extras pushing the pack over its byte budget.

`npm run check` also runs `tools/checks/character-rig-check.mjs`, the deterministic half of the Blender rig pipeline that produces these models (configs, `joints.json` validation, meshy-28 assembly and the pose test on a synthetic humanoid); see [character-rig.md](character-rig.md).
`npm run check` also runs `tools/checks/character-rig-check.mjs`, the deterministic half of the Blender rig pipeline that produces these models (configs, `joints.json` validation, meshy-28 assembly and the pose test on a synthetic humanoid); see [character-rig.md](character-rig.md). It also runs `tools/checks/animation-conversion-check.mjs`, the deterministic half of the clip conversion that produces the `animations` of a pack ([animation-conversion.md](animation-conversion.md)).

## Concept generation

Expand Down
4 changes: 2 additions & 2 deletions docs/character-rig.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Coordinates are clean-space metres: +Z up, the character faces −Y, its left is

## Pose test

`node tools/characters/rig-pose-test.mjs <model.glb> --clips=<dir> --out=<report.json> [--strict] [--bake=<pose>[@<fraction>]:<out.glb>]` skins on the CPU exactly like three.js (`Σ w · jointWorld · IBM · v`) and measures five synthetic poses (arms up 90°, arms forward 60°, a step with each leg, head turned 60°) and 8 instants of each of the 11 state clips (pass the clips retargeted to that model). Per pose: the longest edge stretch versus the bind pose, the 99th percentile, the upper-back region (between `Hips` and `neck`, behind `Spine01`), each hand (edges touching ≥ 25% hand weight, the client's `rig-maos-check` rule), the largest gap between vertices welded in the bind pose (UV seams), and the 10 worst vertices with their bones. `--bake` writes a static posed copy for renders (`tools/blender/character_rig/render_poses.py`, front/back/three-quarter with identical framing; `rig-review.mjs sheet` makes contact sheets).
`node tools/characters/rig-pose-test.mjs <model.glb> --clips=<dir> [--states=<a,b>] [--samples=<n>] --out=<report.json> [--strict] [--bake=<pose>[@<fraction>]:<out.glb>]` skins on the CPU exactly like three.js (`Σ w · jointWorld · IBM · v`) and measures five synthetic poses (arms up 90°, arms forward 60°, a step with each leg, head turned 60°) and 8 instants (`--samples`) of each of the 11 state clips (pass the clips retargeted to that model; `--states` measures other clips, which is how the [animation QA gate](animation-conversion.md) checks skin stretch). Per pose: the longest edge stretch versus the bind pose, the 99th percentile, the upper-back region (between `Hips` and `neck`, behind `Spine01`), each hand (edges touching ≥ 25% hand weight, the client's `rig-maos-check` rule), the largest gap between vertices welded in the bind pose (UV seams), and the 10 worst vertices with their bones. `--bake` writes a static posed copy for renders (`tools/blender/character_rig/render_poses.py`, front/back/three-quarter with identical framing; `rig-review.mjs sheet` makes contact sheets).

Thresholds (`POSE_THRESHOLDS`): body and upper back ≤ 3.5× (the donor reaches 3.04× on its own clips), hands ≤ 2.5× (the client hand gate), seams ≤ 5 mm, bind error ≤ 2 mm. `--strict` exits 1 on any failure.

Expand Down Expand Up @@ -112,6 +112,6 @@ The plush mascot keeps human-like clip motion: idle, walk, run, crouch, crouchwa
- The estimator assumes a T-pose (arms clearly away from the body in the front view). A-pose meshes need a `joints.json` override.
- Joint positions are a first estimate: always look at `joints-review.png` and `parts-review.png`.
- Heat weighting can fail on non-manifold meshes; the voxel proxy covers it, but check `weights.json` (`method`, `heat.unweightedVertices`).
- Hips translation and in-place motion come from `retarget-glb.mjs`; this pipeline does not author clips.
- This pipeline does not author clips: Mixamo and UAL clips are converted and baked onto a rig by [animation-conversion.md](animation-conversion.md) (`tools/animations/`).
- `Curl_L`/`Curl_R` carry no skin (hands are 100% `Hand`), as in the rigs from `rig-from-donor.mjs`: the client's grip curl rotates those bones but the fingers do not close around the weapon.
- The pipeline run (`rig-character.mjs`) fails when the pose test fails (`--strict`); `--no-clips` limits it to the synthetic poses.
18 changes: 17 additions & 1 deletion schemas/asset-pack.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,23 @@
"jump": { "$ref": "#/$defs/glbPath" },
"idle1h": { "$ref": "#/$defs/glbPath" },
"walk1h": { "$ref": "#/$defs/glbPath" },
"walkfire": { "$ref": "#/$defs/glbPath" }
"walkfire": { "$ref": "#/$defs/glbPath" },
"extra": {
"type": "object",
"propertyNames": { "pattern": "^[a-z][a-z0-9_]{1,40}$" },
"additionalProperties": {
"type": "object",
"required": ["file", "duration", "loop", "rootMotion", "source"],
"properties": {
"file": { "$ref": "#/$defs/glbPath" },
"duration": { "type": "number", "exclusiveMinimum": 0 },
"loop": { "type": "boolean" },
"rootMotion": { "type": "boolean" },
"source": { "type": "string", "minLength": 1 }
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
Expand Down
12 changes: 10 additions & 2 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ The public repository must not contain `.blend`, `.blend1`, `.glb`, `.fbx`, `.md
## Commands

```bash
# Structure, JSON, public asset boundary, tool syntax, and the synthetic character pack
# and concept prompt contracts (tools/checks/character-*-check.mjs)
# Structure, JSON, public asset boundary, tool syntax, and the synthetic character pack,
# concept prompt, rig and animation conversion contracts (tools/checks/*-check.mjs)
npm run check

# Source contracts without API calls
npm run check:asset-gen
npm run check:pistol-source

# Animation conversion (docs/animation-conversion.md): Mixamo FBX / UAL glTF -> meshy-28
# reference clips, bake onto a character, QA gate and contact sheet (private bytes stay outside)
node tools/animations/convert-clips.mjs --manifest=tools/animations/manifests/pilot-20261109.json \
--catalog=/path/to/studio-assets/animations/catalog.json --out=/path/to/work/reference
node tools/animations/bake-character.mjs --model=/path/to/character.glb --clips=/path/to/work/reference --out=/path/to/work/character
node tools/animations/clip-qa.mjs --model=/path/to/character.glb --clips=/path/to/work/character --out=/path/to/work/qa.json --strict
node tools/animations/clip-sheet.mjs --model=/path/to/character.glb --clips=/path/to/work/character --out=/path/to/work/sheet.png

# Valid-package, builder and mutant smoke tests (synthetic fixtures only)
npm run smoke:pack

Expand Down
Loading
Loading