Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 14 additions & 7 deletions demos/head-turn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Every build and runtime dependency is installed from the public npm registry (`h

| Package | Version | Role |
| --- | --- | --- |
| `@rig-c/parts` | `1.71.1` | Slices per-part depth sheets from `depth.jpg`, promotes `face` (`head`) and `topwear` (`chest`) to `13×16` depth-sampled surface grids (`360` triangles each), and emits the 2.5D `turn`, `tilt`, and `body_turn` animations and `yaw` / `pitch` / `body_yaw_dial` sliders |
| `@rig-c/parts` | `1.75.0` | Slices per-part depth sheets from `depth.jpg`, promotes `face` (`head`) and `topwear` (`chest`) to `13×16` depth-sampled surface grids (`360` triangles each), adds depth deform to the authored weighted hair meshes and drives an independent chest-bound neck unit, and emits the 2.5D `turn`, `tilt`, and `body_turn` animations and `yaw` / `pitch` / `body_yaw_dial` sliders |
| `@rig-c/pose` | `1.4.0` | Cleans and retargets the 4-way sign-test pose sequence (`pose#455`, 25 frames at 24 fps) onto the rig's `yaw`, `pitch`, and `body_yaw_dial` sliders as the `"clip"` animation |
| `rig-c` | `2.79.0` | Gates (`--profile rig-play`) and compiles `rig.json` + `motion.json` into `skeleton.model.json`, `skeleton.json`, `skeleton.atlas`, and polygon-packed `skeleton.png`, and provides `readModel` in the browser |
| `@rig-c/play` | `1.21.0` | Loads `skeleton.model.json` + `skeleton.png` (`loadModel`) and steps the runtime pose and animation mixer (`RigPlayer`) |
Expand All @@ -26,17 +26,22 @@ Every build and runtime dependency is installed from the public npm registry (`h
1. **Source art and confirmed depth atlas**
- Painting: [`bundle/look.png`](./bundle/look.png)
- Confirmed depth atlas: [`bundle/depth.jpg`](./bundle/depth.jpg) (`1284×1289`, SHA-256 `c814960c7e40dd1d5573a5e6d6e5d97eefeb309d015dea924359dc87f8e998a0`, white = near, `zScale = 109.86819166092819`)
2. **2.5D head and body turn configuration (`@rig-c/parts@1.71.1`)**
2. **2.5D head and body turn configuration (`@rig-c/parts@1.75.0`)**
- `config.turn`:
- `pivot: 55`, `counter: 0.1`, `grid: [13, 16]`
- Head roles: `face: "surface"` (`face_surface` under `faceshift`), `hair_back: "rear"`, `hairpin: "rear"` (`rear_shift`), and facial/hair features (`ear_r`, `ear_l`, `nose`, `mouth`, `eyewhite_r`, `eyewhite_l`, `iris_r`, `iris_l`, `lash_r`, `lash_l`, `brow_l`, `brow_r`, `hair_front`) as `"unit"`
- `"unitDepths": {"ear_r": -7.0432, "ear_l": -7.0432}` gives both unit ears the same calibrated depth; their translations match at each angle and reverse between opposite extremes.
- Head roles: `face: "surface"` (`face_surface` under `faceshift`); `hair_back`, `hair_front`, and `hairpin` as `"surface"` on their authored weighted meshes; facial features (`ear_r`, `ear_l`, `nose`, `mouth`, `eyewhite_r`, `eyewhite_l`, `iris_r`, `iris_l`, `lash_r`, `lash_l`, `brow_l`, `brow_r`) as `"unit"`
- `config.turn.body`:
- `pivot: 55`, `counter: 0.1`, `grid: [13, 16]`
- Body roles: `topwear: "surface"` (`topwear_surface` under `bodyshift`), `collar_back: "rear"` (`body_rear_shift`)
- Body roles: `topwear: "surface"` (`topwear_surface` under `bodyshift`), `collar_back: "rear"` (`body_rear_shift`), and `neck: "unit"` on its independent chest-bound mesh
- `"unitDepths": {"neck": 31.7338}` supplies the neck scalar depth; it has no head turn role or own depth sheet
- Weighted hair samples its own depth sheet at each vertex while retaining skinning and physics. The neck is assembled with `["neck", "full", "neck"]` and uses `neck_part` under `chest` at `[422, 734]`, with one segment `["neck_part", [422, 734], [422, 646]]` (`grid: 32`, `r: 5`). The generated `neck_unit` carries that mesh through body yaw independently of the head. Ears retain their calibrated depths and stay behind the face and in front of the back hair.
- **No rigid 2D spin (`narrowing: false`)**:
- `rig.json` generates `face` and `topwear` with `generator: { "kind": "grid", "cols": 13, "rows": 16, "depth": true }`.
- `motion.json` keys `faceshift`, `rear_shift`, `face_surface`, `turn_units`, `bodyshift`, `body_rear_shift`, and `topwear_surface` exclusively via `derive: { kind: "yaw" | "pitch", degrees, depth, narrowing: false }` and surface `deform` via `transform: { kind: "yaw" | "pitch", degrees, depth: true, narrowing: false }`.
- `motion.json` uses depth-derived translations and generated-grid transforms with `narrowing: false`. Authored weighted hair meshes carry explicit per-influence deform keys. The neck unit uses a scalar-depth body translation.
- In the compiled `skeleton.json` / `skeleton.model.json`, `animations.turn`, `animations.tilt`, and `animations.body_turn` carry only translation (`translatex` / `translatey`) and per-vertex `deform` offsets—zero `rotate` timelines and zero `scalex` narrowing timelines.
- The full-source neck removes the garment collar pixels embedded in the former head-source cut. Painted skin shading and collar outlines remain; no manual art cleanup is applied.

3. **4-way sign-test pose clip (`@rig-c/pose@1.4.0`)**
- 25 frames at 24 fps (`1.000 s` duration):
- Frames `0..4`: neutral (`yaw = 0°`, `pitch = 0°`, `body = 0°`)
Expand Down Expand Up @@ -65,17 +70,19 @@ Every build and runtime dependency is installed from the public npm registry (`h
mkdir -p build-env && cd build-env
npm init -y
PLAYWRIGHT_SKIP_BROWSER_GC=1 npm install --no-save \
@rig-c/parts@1.71.1 \
@rig-c/parts@1.75.0 \
@rig-c/pose@1.4.0 \
@rig-c/play@1.21.0 \
@rig-c/pixi@0.1.5 \
rig-c@2.79.0 \
pixi.js@8.22.0
```
2. **Reassemble the approved source layers using `@rig-c/parts@1.71.1` with the turn roles in the assemble config**:
2. **Reassemble the approved source layers using `@rig-c/parts@1.75.0` with the turn roles in the assemble config**:
- Set `assemble.yield_refused: true` to yield drift-refused front pixels only to an opaque behind holder matching the painting.
- Do not reuse PNGs assembled by an older version: moving head parts must keep their own fringe and seam colours.
- Then run `@rig-c/parts` (`rigStage`) on the cut parts + depth sheets cropped from `depth.jpg`:
- Configure `config.turn` (head) and `config.turn.body` (torso `topwear` + `collar_back`) with `pivot: 55`, `counter: 0.1`, `grid: [13, 16]`, and `zScale: 109.86819166092819`.
- Supply the `hairpin` depth sheet from its region of the same confirmed atlas, in addition to `face`, `hair_front`, `hair_back`, `topwear`, and `collar_back`. Omit the neck depth sheet: its body `unitDepths` value is `31.7338`. Keep the hair bindings and use the single `neck_part` segment above.
- Emit `rig-out/rig.json`, `rig-out/motion.json`, `rig-out/images/`, `rig-out/depth_sheets.json`, and `rig-out/mesh_report.json`.
3. **Clean and retarget the 4-way sign-test pose clip with `@rig-c/pose`**:
```bash
Expand Down
20 changes: 10 additions & 10 deletions demos/head-turn/bundle-manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"schema": 1,
"sha256": "3f5a0b5f4b9dc3e2ea1231a937726afa00963f81e2a5d8d2a6194684d8600087",
"sha256": "216adaab2d048229511faffbbb61ec0be5d445497bb921ce56199a759e8aeadd",
"files": [
{
"path": "README.md",
"bytes": 1575,
"sha256": "93ad01c5d59c89d52a57937ef75f81b8cc602167365f90f0b533b826844199c0"
"bytes": 2153,
"sha256": "1b65eb498f87d374752d7400532a28da86deb10a1004484c328ff54982618fbb"
},
{
"path": "THIRD_PARTY_LICENSES.txt",
Expand Down Expand Up @@ -40,22 +40,22 @@
{
"path": "skeleton.atlas",
"bytes": 1325,
"sha256": "9242be40bbecfcb61698249001f8d291fb94fe9eefe2a8a8354ba7b992f723d1"
"sha256": "58c6af37f73089f4efd5984fa22852f0e7ea3e590287a1a286fcad8f1dfc2f95"
},
{
"path": "skeleton.json",
"bytes": 689886,
"sha256": "a683ce9de7e570e2572c9ba7b79920b405ff2e4f7b40b46efd2bfa5ad301dfbd"
"bytes": 1731404,
"sha256": "41de4dc75bf3f814d33ad836a83007ba4a56a21dc2596e607cb21bfb25181eac"
},
{
"path": "skeleton.model.json",
"bytes": 1182610,
"sha256": "ce6ef0bdc4376acb96746c7260d242dedf47e15a6d81d4508a1e7729b8ba6e64"
"bytes": 2350956,
"sha256": "7e8d2b1b2abf96ef615e7cfb185c7efc6b59e84356c2a4fc2325695822f191c3"
},
{
"path": "skeleton.png",
"bytes": 1793991,
"sha256": "45b52e2a93561cadfe60f9b2f27aa3f9877be7ee209659028fe66e3e3a0d36ba"
"bytes": 1792284,
"sha256": "8e81f3b3829c98ac77bbc7b0a7017f7f8e86f141d0d4f8b88819957ff48eaef8"
}
]
}
6 changes: 5 additions & 1 deletion demos/head-turn/bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This directory holds the compiled runtime assets for [`/demos/head-turn/`](../):

- `skeleton.model.json`, `skeleton.json`, `skeleton.atlas`, `skeleton.png` — compiled 2.5D head and body turn rig produced by `@rig-c/parts@1.71.1`, `@rig-c/pose@1.4.0`, and `rig-c@2.79.0` (`--profile rig-play --pack --page-edges free --pack-shape polygon`).
- `skeleton.model.json`, `skeleton.json`, `skeleton.atlas`, `skeleton.png` — compiled 2.5D head and body turn rig produced by `@rig-c/parts@1.75.0`, `@rig-c/pose@1.4.0`, and `rig-c@2.79.0` (`--profile rig-play --pack --page-edges free --pack-shape polygon`).
- `runtime.js` — browser ESM bundle of the published runtime packages (`@rig-c/play@1.21.0`, `@rig-c/pixi@0.1.5`, `rig-c@2.79.0`, `pixi.js@8.22.0`).
- `app.js`, `index.html` — consumer page driving `pointer` mode (critically damped spring on `yaw_dial`, `pitch_dial`, `body_yaw_dial`, `gaze_x_dial`, `gaze_y_dial`) and `clip` mode (`@rig-c/pose` 4-way sign-test clip played by `@rig-c/play` and rendered on WebGL via `@rig-c/pixi`).
- `look.png`, `depth.jpg` — the source character painting and confirmed grayscale depth atlas (`1284×1289`, SHA-256 `c814960c7e40dd1d5573a5e6d6e5d97eefeb309d015dea924359dc87f8e998a0`).
Expand All @@ -11,3 +11,7 @@ This directory holds the compiled runtime assets for [`/demos/head-turn/`](../):
See [`../README.md`](../README.md), [`../bundle-manifest.json`](../bundle-manifest.json), and [`../package-manifest.json`](../package-manifest.json) for full package provenance (`name@version` + npm tarball `sha512` integrity) and step-by-step rebuild instructions.

The page sets its own player environment: `rig.environment({ wind: [0, 0], gravity: [0, 1] })`. Reassemble the approved source layers with turn roles before rig generation; do not reuse legacy assembled PNGs.

Weighted `hair_back`, `hair_front`, and `hairpin` use their own depth sheets with the `surface` role. The neck uses the `full:neck` drawing and one `neck_part` segment under `chest`. It is a body `unit` at scalar depth `31.7338`, with no head turn role or own depth sheet. Ears retain their order between back hair and face; `config.turn.unitDepths` remains `{"ear_r": -7.0432, "ear_l": -7.0432}`.

The full-source neck removes the garment collar pixels embedded in the former head-source cut. Painted skin shading and collar outlines remain; no manual art cleanup is applied.
18 changes: 9 additions & 9 deletions demos/head-turn/bundle/skeleton.atlas
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ bounds: 1163, 546, 123, 62
offsets: 0, 0, 123, 62
rotate: 0
ear_l
bounds: 662, 389, 85, 131
bounds: 662, 249, 85, 131
offsets: 0, 0, 85, 131
rotate: 0
ear_r
bounds: 662, 249, 85, 136
bounds: 327, 626, 85, 136
offsets: 0, 0, 85, 136
rotate: 0
eyewhite_l
Expand Down Expand Up @@ -47,31 +47,31 @@ bounds: 662, 2, 627, 243
offsets: 0, 0, 627, 243
rotate: 0
iris_l
bounds: 1163, 612, 77, 82
bounds: 662, 384, 77, 82
offsets: 0, 0, 77, 82
rotate: 0
iris_r
bounds: 655, 524, 76, 82
bounds: 662, 470, 76, 82
offsets: 0, 0, 76, 82
rotate: 0
lash_l
bounds: 1141, 817, 137, 100
bounds: 186, 658, 137, 100
offsets: 0, 0, 137, 100
rotate: 0
lash_r
bounds: 1141, 722, 140, 91
offsets: 0, 0, 140, 91
rotate: 0
mouth
bounds: 109, 2, 94, 26
bounds: 222, 626, 94, 26
offsets: 0, 0, 94, 26
rotate: 0
neck
bounds: 222, 626, 230, 137
offsets: 0, 0, 230, 137
bounds: 875, 474, 180, 227
offsets: 0, 0, 180, 227
rotate: 0
nose
bounds: 419, 626, 47, 50
bounds: 416, 626, 47, 50
offsets: 0, 0, 47, 50
rotate: 0
topwear
Expand Down
Loading
Loading