Skip to content

Code-first video & image, rendered natively on WebGPU.

feat(dna): DNA characters with a RigLogic-exact evaluator; sparse morphs and eight skin influences; MakeHuman removed

okanasl8d124af5e289
diff --git a/.changeset/dna-body-correctives.md b/.changeset/dna-body-correctives.md
new file mode 100644
index 00000000..020d7a94
--- /dev/null
+++ b/.changeset/dna-body-correctives.md
@@ -0,0 +1,5 @@
+---
+"framefields": minor
+---
+
+`RigEvaluator` evaluates DNA body correctives: RBF solvers (additive and interpolative, every distance method and kernel) turn joint rotations into corrective pose controls, and twist/swing spreads a joint's rotation over helper joints, matching Epic's RigLogic. The DNA reader reads the RBF, twist/swing and joint metadata layers.
diff --git a/.changeset/dna-reader.md b/.changeset/dna-reader.md
new file mode 100644
index 00000000..bce0a091
--- /dev/null
+++ b/.changeset/dna-reader.md
@@ -0,0 +1,5 @@
+---
+"framefields": minor
+---
+
+`framefields/dna`: read DNA character files (the rig format MetaHuman characters export to; file versions 2.1 to 2.8) and write them as GLB files: joints at their neutral pose with rest orientations, the meshes of a LOD with skin weights and blend shapes as named morph targets, axes and units converted to glTF. Based on OpenRigLogic (MIT, Epic Games). Forge skeletons take rest orientations (`orient`).
diff --git a/.changeset/dna-rig-evaluator.md b/.changeset/dna-rig-evaluator.md
new file mode 100644
index 00000000..324a33e5
--- /dev/null
+++ b/.changeset/dna-rig-evaluator.md
@@ -0,0 +1,5 @@
+---
+"framefields": minor
+---
+
+`RigEvaluator` in `framefields/dna` evaluates a DNA character's rig: GUI and raw controls, pose-space combinations, joint deltas per LOD, blend shape weights and wrinkle-map (animated map) weights, matching Epic's RigLogic. `human()` and the MakeHuman assets are removed: realistic humans come from DNA files.
diff --git a/.changeset/forge-human-eyes.md b/.changeset/forge-human-eyes.md
deleted file mode 100644
index 6cbb2346..00000000
--- a/.changeset/forge-human-eyes.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"framefields": minor
----
-
-`human()` returns eyes: MakeHuman's eyeballs fitted to the shaped head, skinned to `LeftEye` / `RightEye` joints that pivot at each eyeball's center (so `lookAt` aims the gaze), with the CC0 iris texture as `eyeTexture`.
diff --git a/.changeset/forge-human-face.md b/.changeset/forge-human-face.md
deleted file mode 100644
index 8348e105..00000000
--- a/.changeset/forge-human-face.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"framefields": minor
----
-
-Faces for `human()`: facial blend shapes under ARKit names (blinks, brows, jaw, smiles, frowns, pucker and more, split into sides), teeth and tongue that move with the jaw, per-layer `morphs` that drive any morph target by name, Loop subdivision (`subdivide`) that carries blend shapes and skin weights exactly, and sparse morph targets in written GLBs.
diff --git a/.changeset/forge-human-skin.md b/.changeset/forge-human-skin.md
deleted file mode 100644
index fb02e422..00000000
--- a/.changeset/forge-human-skin.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"framefields": minor
----
-
-Skin textures for `human()`: `addHuman` bakes a base color (blush, red lips, mottling) and a roughness map into the body's UVs, plus a tiling normal map of pores and creases (`skinTextures`, `poreNormalMap`). The GLB writer gains texture transforms on texture slots, generated tangents for normal-mapped primitives, and `encodePng`.
diff --git a/.changeset/forge-human.md b/.changeset/forge-human.md
deleted file mode 100644
index de3d213d..00000000
--- a/.changeset/forge-human.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-"framefields": minor
----
-
-`framefields/forge` builds realistic humans: `human({ sex, age, muscle, weight, proportions, ethnicity, height, targets })` shapes MakeHuman's CC0 base mesh with its macro and feature targets, places a Mixamo-named skeleton from the shaped body and skins it with MakeHuman's painted weights. The assets download on first use from a pinned commit, verified by SHA-256, and only the targets a body needs.
-
-The humanoid skeleton preset now places the hip joints at anatomical width (about 9 cm from the midline on a 180 cm figure, was 16).
diff --git a/.changeset/forge-humanoid-hips.md b/.changeset/forge-humanoid-hips.md
new file mode 100644
index 00000000..e712e5c2
--- /dev/null
+++ b/.changeset/forge-humanoid-hips.md
@@ -0,0 +1,5 @@
+---
+"framefields": minor
+---
+
+The humanoid skeleton preset places the hip joints at anatomical width (about 9 cm from the midline on a 180 cm figure, was 16).
diff --git a/.changeset/forge-morphs-subdivide.md b/.changeset/forge-morphs-subdivide.md
new file mode 100644
index 00000000..42bf9bc7
--- /dev/null
+++ b/.changeset/forge-morphs-subdivide.md
@@ -0,0 +1,5 @@
+---
+"framefields": minor
+---
+
+Per-layer `morphs` drive any morph target by name. The forge gains Loop subdivision (`subdivide`) that carries blend shapes and skin weights exactly, and writes morph targets that move few vertices as sparse accessors.
diff --git a/.changeset/forge-texture-transforms.md b/.changeset/forge-texture-transforms.md
new file mode 100644
index 00000000..45ac49e6
--- /dev/null
+++ b/.changeset/forge-texture-transforms.md
@@ -0,0 +1,5 @@
+---
+"framefields": minor
+---
+
+The GLB writer gains texture transforms on texture slots (`transform: { scale, offset, rotation }`), generated tangents for normal-mapped primitives, and `encodePng` for textures made in code.
diff --git a/.changeset/glass-scene-refraction.md b/.changeset/glass-scene-refraction.md
index 0dfcd20d..51a4f369 100644
--- a/.changeset/glass-scene-refraction.md
+++ b/.changeset/glass-scene-refraction.md
@@ -5,5 +5,3 @@
Glass refracts the 3D scene behind it, not only the layers under the 3D batch. glTF materials with `KHR_materials_transmission` render as glass with their IOR, bending by their `KHR_materials_volume` thickness through the refracted ray, so the bend follows the object's size on screen.
Joint drivers (`drive: [{ joint, from, rotate: { x, y, z } }]`): a joint turns by a share of another joint's turn, after look-ats and before IK. Model files carry their own drivers (forge's `GltfDocument.addDriver`).
-
-`human()` adds glass corneas over the eyes and lid drivers, so eyelids follow a gaze aimed with `lookAt`; `addHuman(doc, h)` writes the whole character with default skin, eye and cornea materials.
diff --git a/.changeset/sparse-morphs-eight-influences.md b/.changeset/sparse-morphs-eight-influences.md
new file mode 100644
index 00000000..f9208d10
--- /dev/null
+++ b/.changeset/sparse-morphs-eight-influences.md
@@ -0,0 +1,5 @@
+---
+"framefields": minor
+---
+
+Sparse morph targets stay sparse from the glTF file to the GPU: the morph pass gathers each vertex's deltas from entries that exist, so meshes with hundreds of corrective shapes fit in memory. Skins take up to eight influences per vertex (glTF `JOINTS_1` / `WEIGHTS_1`), in the forge writer, the loader and the renderer. DNA characters keep eight influences, get a material per mesh role (skin, teeth, eyes, eye shell, lashes, …), and `dnaMaterials` finds an export folder's textures.
diff --git a/CLAUDE.md b/CLAUDE.md
index b6ff12c0..a09fd636 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -20,7 +20,8 @@ Code-first video engine on native WebGPU (Dawn) in Node, no browser. pnpm + turb
- `packages/renderer`: headless Node renderer (Dawn, WebCodecs/mediabunny).
- `packages/vision-sam`: SAM 2.1 Tiny/Small and SAM 3 trackers (Apache-2.0 code; SAM 3 weights need runtime SAM License acceptance), private; `framefields` bundles it as a lazy chunk (`clip-vision.ts` imports it dynamically for `comp.vision(..., { sam2 | sam3 })`; `index.ts` re-exports types only) and exposes the trackers as `framefields/sam`. No weights ship; `packages/framefields/NOTICE.md` covers their licenses. Pins in `src/models/registry.ts`.
- `packages/storage`: content-addressed assets on any S3-compatible bucket (R2 first): manifest format, SigV4 client (aws4fetch), verified downloads, and the locator the preview uses to redirect missing pinned files to their bucket. Shared by the CLI (`framefields/storage`), the preview and the render worker, which fetches pinned assets after LFS.
-- `packages/forge`: rigged characters built in code (`framefields/forge`): `GltfDocument` GLB writer (materials + KHR extensions, skins, named morphs, clips), `Skeleton` / `humanoidSkeleton` (Mixamo names), `boneGizmo`, `sculpt` (SDF parts bound to joints → narrow-band manifold Surface Nets → QEM simplification → border cuts → skin weights from the field), and `human()` (MakeHuman's CC0 base mesh + targets + painted weights, lazily downloaded and SHA-256 pinned like vision models; `pnpm --filter @framefields/forge pin:makehuman` regenerates the pins). Pure TypeScript, no GPU; tests validate output with the Khronos validator and read it back through the engine loader. Plan: `specs/character-forge.md`.
+- `packages/forge`: rigged characters built in code (`framefields/forge`): `GltfDocument` GLB writer (materials + KHR extensions, skins, named morphs, clips), `Skeleton` / `humanoidSkeleton` (Mixamo names), `boneGizmo`, `sculpt` (SDF parts bound to joints → narrow-band manifold Surface Nets → QEM simplification → border cuts → skin weights from the field), `subdivide` (Loop, carrying blend shapes and weights). Realistic humans come from DNA files (`packages/dna`), not from the forge. Pure TypeScript, no GPU; tests validate output with the Khronos validator and read it back through the engine loader. Plan: `specs/character-forge.md`.
+- `packages/dna`: DNA character files (the MetaHuman rig format) read in TypeScript (`readDna`, file versions 2.1–2.8) and written as GLB through the forge (`dnaToGlb`: neutral pose with rest orientations, LOD meshes, skin, blend shapes), exposed as `framefields/dna`. Ported from OpenRigLogic (MIT, notice in `packages/framefields/NOTICE.md`); no DNA files ship. Parity fixtures in `packages/dna/fixtures` come from Epic's reader (`oracle.cpp` rebuilds them). Plan: `specs/dna-face-rig.md`.
- `packages/core`: shared types, `Effect` base, signals, `emojiPresentation` (the one UTS #51 rule used by layout, preload and lint).
- Others: `renderers`, `media`, `node-sdk`, `server-utils`, `client-utils`, `tensor-webgpu`, `vision`, `tsconfig`.
- `nodes/node-*`: one VFX/audio/layout node each (`src/shared/`, `src/renderers/`, `src/index.ts`). Only `node-compositor` has a `SKILL.md`; update it when Compositor behavior changes (guarded by `skillmd-check.test.ts`). Effect renderers declare `reach` and `maxPixelScale` (node-sdk) when they can: without `maxPixelScale` a scaled-up leaf using the effect stays at layout resolution.
diff --git a/packages/dna/fixtures/oracle-eval.json b/packages/dna/fixtures/oracle-eval.json
new file mode 100644
index 00000000..0882c68f
--- /dev/null
+++ b/packages/dna/fixtures/oracle-eval.json
@@ -0,0 +1,1167 @@
+[
+ {
+ "lod": 0,
+ "gui": [0.286536962, 1.09619188],
+ "quats": [
+ 0.155305982, 0.58949095, -0.622180045, 0.491194993, -0.173879862,
+ -0.558974743, -0.539365113, 0.605308473
+ ],
+ "rawControls": [
+ 0.286536962, 0, 0, 0.155305982, 0.58949095, -0.622180045, 0.491194993,
+ -0.173879862, -0.558974743, -0.539365113, 0.605308473
+ ],
+ "psdControls": [0],
+ "rbfControls": [0, 0, 0, 0.0454799123, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83.8458176,
+ 60.5716476, 132.889954, 0, 0, 0, 0, 0, 0.214902729, -16.0271492, 0, 0,
+ -0.143268481, 3.43844366, 0, 0.136439741, 0.0113699781, 0, -24.0407257, 0,
+ 0, 0, 0, 0
+ ],
+ "blendShapes": [0.286536962, 0],
+ "animatedMaps": [0.286536962, 0.100000001]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 1.16736603, 0.637500942, 0.542229116, 0.657407224, 0.726043165,
+ 0.932900786, 0.935774863, 0.501692832, 0.568929613, 1.02257216, 0.4349567
+ ],
+ "quats": [
+ -0.0316861905, -0.69918412, 0.426881522, 0.572634041, -0.201020792,
+ -0.454995811, 0.682546198, -0.535443902
+ ],
+ "rawControls": [
+ 1.16736603, 0.637500942, 0.542229116, -0.0316861905, -0.69918412,
+ 0.426881522, 0.572634041, -0.201020792, -0.454995811, 0.682546198,
+ -0.535443902
+ ],
+ "psdControls": [0.518507361],
+ "rbfControls": [0.0998030528, 0, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11.5943956, 0, 0, 0, 0, 0, 0, 0, 0,
+ 100.369339, -61.1224213, -124.076668, 0, 0, 0, 0, 0, 0, 20.5775585, 0, 0,
+ -0.583683014, 14.0083923, 0, 0.199606106, 0, 0, 30.866333, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [1.16736603, 0],
+ "animatedMaps": [0, 0.610000789]
+ },
+ {
+ "lod": 0,
+ "gui": [0.545733511, 0.54758817],
+ "quats": [
+ -0.626201987, -0.61658895, 0.194248274, 0.435840249, -0.640756726,
+ 0.162814975, 0.657550991, -0.361315459
+ ],
+ "rawControls": [
+ 0.545733511, 0.54758817, 0.523794055, -0.626201987, -0.61658895,
+ 0.194248274, 0.435840249, -0.640756726, 0.162814975, 0.657550991,
+ -0.361315459
+ ],
+ "psdControls": [0.430235147],
+ "rbfControls": [0.0440073535, 0.137581393, 0, 0.11302723, 0.164333671],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.535691142, 0, 0, 9.62349796, 3.06798506, 0,
+ 0, 0, 0, 0, 0, 0, 123.772263, -36.5325279, -94.7798615, 0, 0, 0, 0, 0,
+ 0.301741362, 60.5818405, 0, 0, -0.272866756, 6.54880238, 0.0430235155,
+ 0.289515018, 0.234628886, 0, 90.8727646, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.545733511, 0.430235147],
+ "animatedMaps": [0.545733511, 0.53807056]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.708614469, 0.423286229, 0.375314444, 0.614958465, 0.854025304,
+ 0.371708125, 0.189836174, 1.04896402, 0.750691414, 0.45517689, 1.19562638
+ ],
+ "quats": [
+ -0.0264224168, -0.550800979, -0.421497434, 0.719902813, 0.25629884,
+ -0.0210500807, -0.947027504, -0.192371219
+ ],
+ "rawControls": [
+ 0.708614469, 0.423286229, 0.375314444, -0.0264224168, -0.550800979,
+ -0.421497434, 0.719902813, 0.25629884, -0.0210500807, -0.947027504,
+ -0.192371219
+ ],
+ "psdControls": [0.238298163],
+ "rbfControls": [0.0181994643, 0.00392340543, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.30404711, 0, 0, 0, 0, 0, 0, 0, 0,
+ -44.2599602, -62.7881622, 71.0734558, 0, 0, 0, 0, 0, 0, -53.1090698, 0, 0,
+ -0.354307234, 8.5033741, 0, 0.0324755237, 0, 0, -79.6636124, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.708614469, 0],
+ "animatedMaps": [0.708614469, 0.438629001]
+ },
+ {
+ "lod": 0,
+ "gui": [0.214277178, 0.00245361333],
+ "quats": [
+ 0.397490501, 0.539358795, -0.736972511, 0.0892457291, 0.504015565,
+ 0.797666788, -0.268076807, -0.194501176
+ ],
+ "rawControls": [
+ 0.214277178, 0.00245361333, 0.251226813, 0.397490501, 0.539358795,
+ -0.736972511, 0.0892457291, 0.504015565, 0.797666788, -0.268076807,
+ -0.194501176
+ ],
+ "psdControls": [0.000924620195],
+ "rbfControls": [0.0192825682, 0, 0, 0.032572791, 0.300000012],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.126840219, 0, 0, -1.20428789, 1.88235176, 0,
+ 0, 0, 0, 0, 0, 0, 113.218323, 32.1768913, -157.834793, 0, 0, 0, 0, 0,
+ 0.160476729, -68.8982315, 0, 0, -0.107138589, 2.57132626, 9.24620181e-5,
+ 0.136283517, 0.00814319775, 0, -103.347351, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.214277178, 0.000924620195],
+ "animatedMaps": [0.214277178, 0.101962894]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.766041636, 0.994339347, 0.60434413, 0.578179002, 0.942848921,
+ 1.14863193, 0.389326662, 1.06179845, 0.248553097, 0.332749128, 1.13962126
+ ],
+ "quats": [
+ 0.35132587, -0.476139843, -0.73228538, -0.33707425, 0.642174244,
+ 0.512193978, -0.57003063, 0.0182906892
+ ],
+ "rawControls": [
+ 0.766041636, 0.994339347, 0.60434413, 0.35132587, -0.476139843,
+ -0.73228538, -0.33707425, 0.642174244, 0.512193978, -0.57003063,
+ 0.0182906892
+ ],
+ "psdControls": [0.901384711],
+ "rbfControls": [0.0685454533, 0.0271599144, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.5692215, 0, 0, 0, 0, 0, 0, 0, 0,
+ -86.2212143, 61.7964172, -159.83252, 0, 0, 0, 0, 0, 0, 88.3685074, 0, 0,
+ -0.383020818, 9.19249916, 0, 0.109930992, 0, 0, 132.552765, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.766041636, 0],
+ "animatedMaps": [0.766041636, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [0.907661557, 0.500799477],
+ "quats": [
+ -0.324434906, -0.281723261, -0.561551332, 0.707130969, -0.732510388,
+ 0.443331569, 0.495017797, -0.147793889
+ ],
+ "rawControls": [
+ 0.907661557, 0.500799477, 0.500399709, -0.324434906, -0.281723261,
+ -0.561551332, 0.707130969, -0.732510388, 0.443331569, 0.495017797,
+ -0.147793889
+ ],
+ "psdControls": [0.375899881],
+ "rbfControls": [0.00489025842, 0.137661785, 0, 0.182358652, 0.150062293],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.500599623, 0, 0, 8.64169025, 3.00119805, 0,
+ 0, 0, 0, 0, 0, 0, 10.1153889, -46.7038841, 48.928051, 0, 0, 0, 0, 0,
+ 0.58677125, 78.5929489, 0, 0, -0.453830779, 10.8919392, 0.0375899896,
+ 0.419194698, 0.252082348, 0, 117.889435, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.907661557, 0.375899881],
+ "animatedMaps": [0.907661557, 0.500639617]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.32230404, 0.62865144, 0.404157698, 0.120603137, 0.463143408,
+ 0.559077322, 0.900692701, 1.0337584, 0.928557456, 0.277921796, 0.822685421
+ ],
+ "quats": [
+ 0.143725887, -0.716614068, 0.409901679, 0.545699418, 0.101181448,
+ 0.567303836, -0.71388793, 0.39786014
+ ],
+ "rawControls": [
+ 0.32230404, 0.62865144, 0.404157698, 0.143725887, -0.716614068,
+ 0.409901679, 0.545699418, 0.101181448, 0.567303836, -0.71388793,
+ 0.39786014
+ ],
+ "psdControls": [0.381111503],
+ "rbfControls": [0.0884865969, 0, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11.6955748, 0, 0, 0, 0, 0, 0, 0, 0,
+ 117.102295, -68.6698456, -150.067596, 0, 0, 0, 0, 0, 0, 14.2686481, 0, 0,
+ -0.16115202, 3.8676486, 0, 0.176973194, 0, 0, 21.4029713, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.32230404, 0],
+ "animatedMaps": [0.32230404, 0.602921188]
+ },
+ {
+ "lod": 0,
+ "gui": [0.5228315, 1.19410551],
+ "quats": [
+ 0.627173841, -0.46322301, -0.332741678, 0.530434132, 0.358151555,
+ 0.556825399, 0.519271016, -0.540398538
+ ],
+ "rawControls": [
+ 0.5228315, 0, 0, 0.627173841, -0.46322301, -0.332741678, 0.530434132,
+ 0.358151555, 0.556825399, 0.519271016, -0.540398538
+ ],
+ "psdControls": [0],
+ "rbfControls": [0.0182286389, 0, 0, 0.106531441, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ -93.7444077, -29.3210812, 73.1963959, 0, 0, 0, 0, 0, 0.39212364,
+ -33.5346146, 0, 0, -0.26141575, 6.27397823, 0, 0.356051594, 0.0266328603,
+ 0, -50.301918, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.5228315, 0],
+ "animatedMaps": [0.5228315, 0.100000001]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 1.06041634, 0.286010742, 1.17670476, 0.289105654, 1.10928118, 1.0008992,
+ 0.777425647, 0.674816787, 0.446305305, 0.223177031, 0.0322937258
+ ],
+ "quats": [
+ -0.625832319, -0.46601969, 0.337557495, -0.52651155, -0.223594785,
+ -0.0145392865, 0.823986232, -0.520423651
+ ],
+ "rawControls": [
+ 1.06041634, 0.286010742, 1.17670476, -0.625832319, -0.46601969,
+ 0.337557495, -0.52651155, -0.223594785, -0.0145392865, 0.823986232,
+ -0.520423651
+ ],
+ "psdControls": [0.429016113],
+ "rbfControls": [0.00744396122, 0.0811383352, 0, 0, 0.0325497538],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.12373924, 0, 0, 0, 0, 0, 0, 0, 0,
+ -101.738312, 71.658493, -40.3711586, 0, 0, 0, 0, 0, 0, 23.2502937, 0, 0,
+ -0.53020817, 12.7249966, 0, -0.0662504137, 0, 0, 34.8754387, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [1.06041634, 0],
+ "animatedMaps": [0, 0.328808606]
+ },
+ {
+ "lod": 0,
+ "gui": [0.66446358, 0.608002722],
+ "quats": [
+ -0.189275682, 0.0786052868, -0.908566117, 0.364010185, -0.544580042,
+ -0.1190698, -0.656698585, 0.507938921
+ ],
+ "rawControls": [
+ 0.66446358, 0.391997278, 0.554001331, -0.189275682, 0.0786052868,
+ -0.908566117, 0.364010185, -0.544580042, -0.1190698, -0.656698585,
+ 0.507938921
+ ],
+ "psdControls": [0.3257505],
+ "rbfControls": [
+ 0.0139222313, 0.181590691, 0.165715367, 0.143913075, 0.0672216937
+ ],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.472999305, 0, 0, 6.04719067, 3.50350928, 0,
+ 0, 0, 0, 0, 0, 0, 23.8532639, -1.80385303, 95.0979385, 0, 0, 0, 0, 0,
+ 0.416910082, -46.9938278, 0, 0, -0.33223179, 7.97356319, 0.0325750522,
+ 0.360850662, -0.105924085, 0, -70.4907455, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.66446358, 0.3257505],
+ "animatedMaps": [0.66446358, 0.413597822]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.8982023, 0.517810345, 0.140155733, 1.09451759, 0.101782039, 0.704133034,
+ 0.182986677, 1.01401341, 0.447885871, 0.76731962, 0.554896355
+ ],
+ "quats": [
+ -0.596046925, -0.405836225, 0.470150948, -0.508903861, -0.842667699,
+ 0.498122633, 0.107582264, 0.173813418
+ ],
+ "rawControls": [
+ 0.8982023, 0.517810345, 0.140155733, -0.596046925, -0.405836225,
+ 0.470150948, -0.508903861, -0.842667699, 0.498122633, 0.107582264,
+ 0.173813418
+ ],
+ "psdControls": [0.108861133],
+ "rbfControls": [0.00209879153, 0.0589315817, 0, 0, 0.145004734],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9.9820118, 0, 0, 0, 0, 0, 0, 0, 0,
+ -70.376709, 76.9427795, -1.2642287, 0, 0, 0, 0, 0, 0, -78.3452835, 0, 0,
+ -0.44910115, 10.7784271, 0, -0.0547339991, 0, 0, -117.517944, 0, 0, 0, 0,
+ 0
+ ],
+ "blendShapes": [0.8982023, 0],
+ "animatedMaps": [0.8982023, 0.514248312]
+ },
+ {
+ "lod": 0,
+ "gui": [0.915960968, 0.638820827],
+ "quats": [
+ -0.325357735, -0.453569382, 0.698282421, 0.448128283, -0.704924107,
+ -0.261014462, 0.0273289736, -0.658943474
+ ],
+ "rawControls": [
+ 0.915960968, 0.361179173, 0.569410443, -0.325357735, -0.453569382,
+ 0.698282421, 0.448128283, -0.704924107, -0.261014462, 0.0273289736,
+ -0.658943474
+ ],
+ "psdControls": [0.308488816],
+ "rbfControls": [0.100990541, 0.214604929, 0, 0.183108702, 0.0192055926],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.465294808, 0, 0, 5.30199766, 3.65360069, 0,
+ 0, 0, 0, 0, 0, 0, 76.9105988, -24.2817745, -104.129913, 0, 0, 0, 0, 0,
+ 0.609848499, 46.9309082, 0, 0, -0.457980484, 10.9915314, 0.0308488812,
+ 0.536702275, 0.367684573, 0, 70.396347, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.915960968, 0.308488816],
+ "animatedMaps": [0.915960968, 0.388943344]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.629078686, 1.09186184, 0.512747824, 1.10433149, 0.00912380219,
+ 1.18707812, 0.294231117, 0.516803741, 1.12357461, 0.29589045, 0.163111508
+ ],
+ "quats": [
+ 0.586118579, -0.478032351, -0.222267359, -0.615261972, 0.0737782493,
+ -0.56766516, 0.322422475, 0.753894329
+ ],
+ "rawControls": [
+ 0.629078686, 1.09186184, 0.512747824, 0.586118579, -0.478032351,
+ -0.222267359, -0.615261972, 0.0737782493, -0.56766516, 0.322422475,
+ 0.753894329
+ ],
+ "psdControls": [0.769121766],
+ "rbfControls": [0.0627372935, 0.0632931814, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21.580862, 0, 0, 0, 0, 0, 0, 0, 0,
+ 84.6681747, 64.848114, 34.1552887, 0, 0, 0, 0, 0, 0, 5.5893302, 0, 0,
+ -0.314539343, 7.54894447, 0, 0.0621814057, 0, 0, 8.38399506, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.629078686, 0],
+ "animatedMaps": [0.629078686, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [0.523932338, 0.0708033144],
+ "quats": [
+ 0.607108474, -0.076044105, -0.790616751, 0.0236986242, 0.705974162,
+ -0.60922277, -0.300756305, 0.19998455
+ ],
+ "rawControls": [
+ 0.523932338, 0.0708033144, 0.285401642, 0.607108474, -0.076044105,
+ -0.790616751, 0.0236986242, 0.705974162, -0.60922277, -0.300756305,
+ 0.19998455
+ ],
+ "psdControls": [0.0303110741],
+ "rbfControls": [0.0279700253, 0, 0, 0.106845394, 0.300000012],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.178102478, 0, 0, 0.0799913555, 2.07989001, 0,
+ 0, 0, 0, 0, 0, 0, -91.0799103, 35.3068123, 119.433769, 0, 0, 0, 0, 0,
+ 0.385371476, 74.1839218, 0, 0, -0.261966169, 6.28718805, 0.00303110736,
+ 0.376476258, 0.0267113484, 0, 111.275887, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.523932338, 0.0303110741],
+ "animatedMaps": [0.523932338, 0.15664266]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 1.0337981, 1.16979349, 0.746870995, 0.130010247, 0.0133060459,
+ 0.237080753, 1.1277591, 0.698950768, 0.971901417, 0.83060199, 0.879659891
+ ],
+ "quats": [
+ -0.528544247, 0.243979365, -0.426339477, -0.692350864, 0.717462599,
+ 0.097225368, -0.232831657, 0.649295151
+ ],
+ "rawControls": [
+ 1.0337981, 1.16979349, 0.746870995, -0.528544247, 0.243979365,
+ -0.426339477, -0.692350864, 0.717462599, 0.097225368, -0.232831657,
+ 0.649295151
+ ],
+ "psdControls": [1],
+ "rbfControls": [0.153400153, 0.0101931002, 0, 0, 0.272682667],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22.6615143, 0, 0, 0, 0, 0, 0, 0, 0,
+ -40.4905128, -45.5788536, -24.3355713, 0, 0, 0, 0, 0, 0, 47.8552742, 0, 0,
+ -0.516899049, 12.4055767, 0, 0.296607196, 0, 0, 71.7829285, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [1.0337981, 0],
+ "animatedMaps": [0, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [0.99269861, 0.678209186],
+ "quats": [
+ -0.678951383, -0.124429591, 0.454263985, 0.563193142, 0.367896676,
+ -0.275205255, 0.612026155, -0.643690944
+ ],
+ "rawControls": [
+ 0.99269861, 0.321790814, 0.589104593, -0.678951383, -0.124429591,
+ 0.454263985, 0.563193142, 0.367896676, -0.275205255, 0.612026155,
+ -0.643690944
+ ],
+ "psdControls": [0.28435266],
+ "rbfControls": [0.0974207669, 0.24707599, 0, 0.188780755, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.455447704, 0, 0, 4.34335136, 3.8495791, 0, 0,
+ 0, 0, 0, 0, 0, 65.6084518, 5.54234362, -44.9247551, 0, 0, 0, 0, 0,
+ 0.673435807, -29.7497978, 0, 0, -0.496349305, 11.9123831, 0.0284352656,
+ 0.514107764, 0.417809188, 0, -44.6246948, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.99269861, 0.28435266],
+ "animatedMaps": [0.99269861, 0.357432663]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 1.17467237, 0.281937957, 0.633712053, 1.04779029, 0.497223914,
+ 0.772749841, 0.872576535, 1.01760364, 0.579327047, 0.314725488,
+ 0.313414216
+ ],
+ "quats": [
+ -0.270672619, -0.25298351, 0.495458663, 0.785656691, -0.199693978,
+ -0.829624057, 0.488439858, -0.182408616
+ ],
+ "rawControls": [
+ 1.17467237, 0.281937957, 0.633712053, -0.270672619, -0.25298351,
+ 0.495458663, 0.785656691, -0.199693978, -0.829624057, 0.488439858,
+ -0.182408616
+ ],
+ "psdControls": [0.268001229],
+ "rbfControls": [0.2955935, 0, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3.27420259, 0, 0, 0, 0, 0, 0, 0, 0,
+ 35.1526566, -20.2817822, -51.2350578, 0, 0, 0, 0, 0, 0, 47.5901527, 0, 0,
+ -0.587336183, 14.0960684, 0, 0.591187, 0, 0, 71.385231, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [1.17467237, 0],
+ "animatedMaps": [0, 0.325550377]
+ },
+ {
+ "lod": 0,
+ "gui": [0.792193949, 0.966062903],
+ "quats": [
+ -0.572604537, 0.673827112, 0.462832808, -0.0621844232, -0.170099616,
+ -0.337652683, -0.837698042, -0.394105107
+ ],
+ "rawControls": [
+ 0.792193949, 0.0339370966, 0.733031452, -0.572604537, 0.673827112,
+ 0.462832808, -0.0621844232, -0.170099616, -0.337652683, -0.837698042,
+ -0.394105107
+ ],
+ "psdControls": [0.0373154394],
+ "rbfControls": [0.0123773757, 0.275000006, 0, 0.16842562, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.383484274, 0, 0, -2.87446904, 5.42310524, 0,
+ 0, 0, 0, 0, 0, 0, -139.619324, 9.48774719, 129.371765, 0, 0, 0, 0, 0,
+ 0.584816635, 23.3455009, 0, 0, -0.396096975, 9.50632763, 0.0037315439,
+ 0.255031615, 0.454606414, 0, 35.0182495, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.792193949, 0.0373154394],
+ "animatedMaps": [0.792193949, 0.127149686]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.535584867, 0.274879456, 0.833551586, 0.0823237225, 1.00544846,
+ 1.16988003, 0.848474741, 0.0393512994, 0.729727149, 1.03993201, 0.21076034
+ ],
+ "quats": [
+ 0.577298582, -0.286117524, -0.299319267, -0.703754961, 0.513447762,
+ -0.228567705, -0.815013111, -0.141002834
+ ],
+ "rawControls": [
+ 0.535584867, 0.274879456, 0.833551586, 0.577298582, -0.286117524,
+ -0.299319267, -0.703754961, 0.513447762, -0.228567705, -0.815013111,
+ -0.141002834
+ ],
+ "psdControls": [0.343689322],
+ "rbfControls": [0.110457748, 0.0475647934, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.36089897, 0, 0, 0, 0, 0, 0, 0, 0,
+ 52.015274, 46.452198, -6.41780949, 0, 0, 0, 0, 0, 0, -74.6440201, 0, 0,
+ -0.267792434, 6.42701817, 0, 0.173350707, 0, 0, -111.966034, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.535584867, 0],
+ "animatedMaps": [0.535584867, 0.319903582]
+ },
+ {
+ "lod": 0,
+ "gui": [0.485489279, 0.58809036],
+ "quats": [
+ 0.555862248, -0.30701527, 0.336890191, -0.695171714, 0.181046605,
+ -0.0740219429, 0.298284113, -0.934221327
+ ],
+ "rawControls": [
+ 0.485489279, 0.58809036, 0.54404521, 0.555862248, -0.30701527,
+ 0.336890191, -0.695171714, 0.181046605, -0.0740219429, 0.298284113,
+ -0.934221327
+ ],
+ "psdControls": [0.479921609],
+ "rbfControls": [
+ 0.010005394, 0.122308783, 0.190307498, 0.095845364, 0.194189891
+ ],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.566067815, 0, 0, 10.4813461, 3.1204958, 0, 0,
+ 0, 0, 0, 0, 0, 63.3141937, 21.832119, 47.5996933, 0, 0, 0, 0, 0,
+ 0.244136572, -10.9676313, 0, 0, -0.24274464, 5.82587147, 0.0479921624,
+ 0.280391842, -0.268344253, 0, -16.4514484, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.485489279, 0.479921609],
+ "animatedMaps": [0.485489279, 0.5704723]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.282050312, 0.528056681, 1.08861589, 1.04112875, 0.349136859,
+ 0.523416996, 0.218545184, 0.299785286, 0.819173217, 1.02076375, 1.025033
+ ],
+ "quats": [
+ 0.394191056, 0.693019271, -0.536169887, 0.277235568, 0.47437185,
+ -0.295133859, -0.655474186, 0.508154333
+ ],
+ "rawControls": [
+ 0.282050312, 0.528056681, 1.08861589, 0.394191056, 0.693019271,
+ -0.536169887, 0.277235568, 0.47437185, -0.295133859, -0.655474186,
+ 0.508154333
+ ],
+ "psdControls": [0.792085052],
+ "rbfControls": [0.0040988992, 0.0145295262, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.49430895, 0, 0, 0, 0, 0, 0, 0, 0,
+ 136.903687, 48.8280945, -161.070969, 0, 0, 0, 0, 0, 0, 43.0307617, 0, 0,
+ -0.141025156, 3.38460374, 0, -0.00633172784, 0, 0, 64.5461349, 0, 0, 0, 0,
+ 0
+ ],
+ "blendShapes": [0.282050312, 0],
+ "animatedMaps": [0.282050312, 0.522445381]
+ },
+ {
+ "lod": 0,
+ "gui": [1.12232447, 0.209558278],
+ "quats": [
+ -0.0268620197, -0.486047626, -0.175867364, -0.855632424, -0.242713526,
+ -0.336580127, 0.632377386, -0.654142797
+ ],
+ "rawControls": [
+ 0, 0.209558278, 0.354779124, -0.0268620197, -0.486047626, -0.175867364,
+ -0.855632424, -0.242713526, -0.336580127, 0.632377386, -0.654142797
+ ],
+ "psdControls": [0.111520357],
+ "rbfControls": [0.107618883, 0, 0.36835739, 0.0107843745, 0.300000012],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.282168686, 0, 0, 2.75183082, 2.43780255, 0,
+ 0, 0, 0, 0, 0, 0, -16.4791965, 57.2346001, -25.3212299, 0, 0, 0, 0, 0,
+ -0.0278800894, 20.3568916, 0, 0, 0, 0, 0.0111520356, 0.43176958,
+ -0.918197393, 0, 30.5353413, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0, 0.111520357],
+ "animatedMaps": [0, 0.267646641]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.352558583, 0.929839492, 0.570264399, 0.465752602, 0.717927039,
+ 0.941281796, 0.224707261, 0.752101719, 0.871831596, 0.625475585,
+ 0.0377511978
+ ],
+ "quats": [
+ -0.518909335, 0.601738513, 0.321437299, -0.515094161, -0.155003443,
+ -0.417876273, 0.642677486, 0.623152435
+ ],
+ "rawControls": [
+ 0.352558583, 0.929839492, 0.570264399, -0.518909335, 0.601738513,
+ 0.321437299, -0.515094161, -0.155003443, -0.417876273, 0.642677486,
+ 0.623152435
+ ],
+ "psdControls": [0.795381486],
+ "rbfControls": [0.0189302657, 0.00155700557, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18.1316128, 0, 0, 0, 0, 0, 0, 0, 0,
+ -105.598938, -38.1298218, 92.6411133, 0, 0, 0, 0, 0, 0, -13.9683218, 0, 0,
+ -0.176279292, 4.23070288, 0, 0.0363035277, 0, 0, -20.9524784, 0, 0, 0, 0,
+ 0
+ ],
+ "blendShapes": [0.352558583, 0],
+ "animatedMaps": [0.352558583, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [0.0221036207, 0.313445807],
+ "quats": [
+ -0.365932077, 0.770541549, -0.411624342, -0.32081902, -0.25233829,
+ -0.901133597, 0.227621511, 0.269206256
+ ],
+ "rawControls": [
+ 0.0221036207, 0.313445807, 0.406722903, -0.365932077, 0.770541549,
+ -0.411624342, -0.32081902, -0.25233829, -0.901133597, 0.227621511,
+ 0.269206256
+ ],
+ "psdControls": [0.19122839],
+ "rbfControls": [0.0453514457, 0, 0, 0.0121519389, 0.277525812],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.360084355, 0, 0, 4.80898666, 2.66796494, 0,
+ 0, 0, 0, 0, 0, 0, 151.152344, -48.9700775, 158.773972, 0, 0, 0, 0, 0,
+ -0.0312293824, -43.1475601, 0, 0, -0.0110518103, 0.265243441, 0.019122839,
+ 0.127158701, 0.00303798472, 0, -64.7213364, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.0221036207, 0.19122839],
+ "animatedMaps": [0.0221036207, 0.350756645]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.565777063, 1.16704941, 0.470529139, 0.239060715, 0.530492127,
+ 0.0332113281, 1.03505325, 1.04030275, 0.572963476, 0.369279325,
+ 0.187240943
+ ],
+ "quats": [
+ 0.722105563, 0.577569366, -0.380352199, -0.0175933354, 0.789051235,
+ -0.565129995, -0.0524965338, 0.235096171
+ ],
+ "rawControls": [
+ 0.565777063, 1.16704941, 0.470529139, 0.722105563, 0.577569366,
+ -0.380352199, -0.0175933354, 0.789051235, -0.565129995, -0.0524965338,
+ 0.235096171
+ ],
+ "psdControls": [0.705793738],
+ "rbfControls": [0.0170884728, 0.0100488458, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23.1057243, 0, 0, 0, 0, 0, 0, 0, 0,
+ 150.056519, 16.20961, -114.466537, 0, 0, 0, 0, 0, 0, 73.408699, 0, 0,
+ -0.282888532, 6.78932476, 0, 0.0241280999, 0, 0, 110.113037, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.565777063, 0],
+ "animatedMaps": [0.565777063, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [0.614694118, 1.19522023],
+ "quats": [
+ -0.442441791, -0.453041881, 0.319483906, 0.704931498, -0.595601797,
+ 0.323709697, -0.0251828618, -0.734735608
+ ],
+ "rawControls": [
+ 0.614694118, 0, 0, -0.442441791, -0.453041881, 0.319483906, 0.704931498,
+ -0.595601797, 0.323709697, -0.0251828618, -0.734735608
+ ],
+ "psdControls": [0],
+ "rbfControls": [0.130431116, 0, 0, 0.131723925, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67.2628708,
+ -38.4828033, -59.2865067, 0, 0, 0, 0, 0, 0.461020589, 39.0294075, 0, 0,
+ -0.307347059, 7.37632942, 0, 0.656033993, 0.0329309814, 0, 58.5441055, 0,
+ 0, 0, 0, 0
+ ],
+ "blendShapes": [0.614694118, 0],
+ "animatedMaps": [0.614694118, 0.100000001]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.57409066, 0.998165965, 0.413446933, 0.239330083, 0.0320722125,
+ 0.886126935, 0.676848888, 0.151182115, 0.749809325, 1.11295033,
+ 0.219158441
+ ],
+ "quats": [
+ 0.777543664, -0.228355139, -0.551674604, -0.197319239, 0.179191187,
+ 0.0596133657, 0.361157477, -0.913182378
+ ],
+ "rawControls": [
+ 0.57409066, 0.998165965, 0.413446933, 0.777543664, -0.228355139,
+ -0.551674604, -0.197319239, 0.179191187, 0.0596133657, 0.361157477,
+ -0.913182378
+ ],
+ "psdControls": [0.619032979],
+ "rbfControls": [0.0364302397, 0.0096512856, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.7531853, 0, 0, 0, 0, 0, 0, 0, 0,
+ 159.934921, 74.184082, 59.1778526, 0, 0, 0, 0, 0, 0, -11.1019287, 0, 0,
+ -0.28704533, 6.88908768, 0, 0.063209191, 0, 0, -16.6528912, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.57409066, 0],
+ "animatedMaps": [0.57409066, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [0.238228023, 0.452801973],
+ "quats": [
+ 0.345724195, -0.551958084, 0.753310978, -0.0913210437, -0.873508275,
+ 0.0127660604, -0.168671772, 0.456475735
+ ],
+ "rawControls": [
+ 0.238228023, 0.452801973, 0.476400971, 0.345724195, -0.551958084,
+ 0.753310978, -0.0913210437, -0.873508275, 0.0127660604, -0.168671772,
+ 0.456475735
+ ],
+ "psdControls": [0.323572963],
+ "rbfControls": [0.0197672267, 0.117984578, 0, 0.0364897847, 0.156988204],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.464601457, 0, 0, 7.64475393, 2.92586136, 0,
+ 0, 0, 0, 0, 0, 0, 108.07637, -6.26936913, 146.517563, 0, 0, 0, 0, 0,
+ 0.0977777764, -62.4094467, 0, 0, -0.119114012, 2.85873628, 0.0323572978,
+ 0.0310192257, 0.186099306, 0, -93.6141739, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.238228023, 0.323572963],
+ "animatedMaps": [0.238228023, 0.46224159]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.302244902, 0.579596043, 0.438697487, 0.381438106, 0.811811745,
+ 0.810112834, 0.133219674, 0.964008987, 0.104614235, 0.18130374,
+ 0.516860843
+ ],
+ "quats": [
+ -0.528503418, -0.531722546, -0.451012135, -0.484296709, 0.745521069,
+ 0.457634151, -0.458491236, 0.156700656
+ ],
+ "rawControls": [
+ 0.302244902, 0.579596043, 0.438697487, -0.528503418, -0.531722546,
+ -0.451012135, -0.484296709, 0.745521069, 0.457634151, -0.458491236,
+ 0.156700656
+ ],
+ "psdControls": [0.381401002],
+ "rbfControls": [0.0663388222, 0.0202966165, 0.137086436, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.5426369, 0, 0, 0, 0, 0, 0, 0, 0,
+ -97.1804733, 28.3893337, -91.7897491, 0, 0, 0, 0, 0, 0, 78.1298141, 0, 0,
+ -0.151122451, 3.62693882, 0, 0.180924237, 0, 0, 117.19474, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.302244902, 0],
+ "animatedMaps": [0.302244902, 0.563676834]
+ },
+ {
+ "lod": 0,
+ "gui": [1.12270081, 0.232559264],
+ "quats": [
+ -0.476657331, 0.208571389, -0.590149283, -0.617267847, 0.53519702,
+ 0.144579634, -0.580529273, 0.596361041
+ ],
+ "rawControls": [
+ 0, 0.232559264, 0.366279632, -0.476657331, 0.208571389, -0.590149283,
+ -0.617267847, 0.53519702, 0.144579634, -0.580529273, 0.596361041
+ ],
+ "psdControls": [0.127772585],
+ "rbfControls": [0.155830637, 0, 0, 0.0107843745, 0.300000012],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.299419463, 0, 0, 3.20310473, 2.49155211, 0,
+ 0, 0, 0, 0, 0, 0, -28.0444489, -46.5372581, -46.6893768, 0, 0, 0, 0, 0,
+ -0.0319431461, 41.9060059, 0, 0, 0, 0, 0.0127772586, 0.344014406,
+ 0.00269609364, 0, 62.8590088, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0, 0.127772585],
+ "animatedMaps": [0, 0.286047429]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.415757298, 1.06687713, 0.977570474, 0.370096505, 0.804642797,
+ 0.722216427, 0.809880435, 1.00457406, 1.19876897, 0.848178208, 0.897381186
+ ],
+ "quats": [
+ -0.117718451, -0.544309914, -0.650398076, -0.516576588, 0.669899225,
+ 0.644288242, 0.367981195, -0.0267855544
+ ],
+ "rawControls": [
+ 0.415757298, 1.06687713, 0.977570474, -0.117718451, -0.544309914,
+ -0.650398076, -0.516576588, 0.669899225, 0.644288242, 0.367981195,
+ -0.0267855544
+ ],
+ "psdControls": [1],
+ "rbfControls": [0.10721793, 0.029896345, 0.258403599, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.4496918, 0, 0, 0, 0, 0, 0, 0, 0,
+ -75.7788696, 43.0236702, -110.798668, 0, 0, 0, 0, 0, 0, -87.7102737, 0, 0,
+ -0.207878649, 4.98908758, 0, 0.313741326, 0, 0, -131.565414, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.415757298, 0],
+ "animatedMaps": [0.415757298, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [1.07662237, 0.683598399],
+ "quats": [
+ -0.172688037, -0.68929714, -0.158204779, -0.685579777, 0.415348262,
+ 0.378221482, 0.584556937, 0.58542937
+ ],
+ "rawControls": [
+ 0, 0.316401601, 0.5917992, -0.172688037, -0.68929714, -0.158204779,
+ -0.685579777, 0.415348262, 0.378221482, 0.584556937, 0.58542937
+ ],
+ "psdControls": [0.280869335],
+ "rbfControls": [0.0508965924, 0.250712276, 0.224623784, 0.0107843745, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.4541004, 0, 0, 4.21164417, 3.87675548, 0, 0,
+ 0, 0, 0, 0, 0, -91.3467865, 71.0534592, -90.5099487, 0, 0, 0, 0, 0,
+ -0.0702173337, 35.3547974, 0, 0, 0, 0, 0.0280869342, -0.0042540729,
+ -0.182794929, 0, 53.0321999, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0, 0.280869335],
+ "animatedMaps": [0, 0.353121281]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 1.14752614, 0.624254644, 0.486314774, 0.604373872, 0.904123783,
+ 0.122125126, 0.71428746, 0.36995244, 1.05122459, 0.216595471, 0.844763219
+ ],
+ "quats": [
+ 0.55306977, -0.311887205, -0.725122988, 0.266527474, 0.864047945,
+ 0.365271211, 0.303129762, -0.167661726
+ ],
+ "rawControls": [
+ 1.14752614, 0.624254644, 0.486314774, 0.55306977, -0.311887205,
+ -0.725122988, 0.266527474, 0.864047945, 0.365271211, 0.303129762,
+ -0.167661726
+ ],
+ "psdControls": [0.455376357],
+ "rbfControls": [0.0129767573, 0.0104779219, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11.4196482, 0, 0, 0, 0, 0, 0, 0, 0,
+ -86.4480286, 1.37088728, 102.2509, 0, 0, 0, 0, 0, 0, -79.0186768, 0, 0,
+ -0.573763072, 13.7703133, 0, 0.0154755926, 0, 0, -118.528, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [1.14752614, 0],
+ "animatedMaps": [0, 0.599403739]
+ },
+ {
+ "lod": 0,
+ "gui": [0.465601891, 0.729495943],
+ "quats": [
+ -0.642190814, -0.0749957487, -0.374752164, -0.664475322, -0.584925175,
+ -0.403516352, -0.530655444, 0.461997688
+ ],
+ "rawControls": [
+ 0.465601891, 0.270504057, 0.614748001, -0.642190814, -0.0749957487,
+ -0.374752164, -0.664475322, -0.584925175, -0.403516352, -0.530655444,
+ 0.461997688
+ ],
+ "psdControls": [0.249437749],
+ "rbfControls": [0.118004501, 0.275000006, 0, 0.0901774541, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.442626029, 0, 0, 3.08465409, 4.11173439, 0,
+ 0, 0, 0, 0, 0, 0, -58.099556, -6.45400286, -33.6901665, 0, 0, 0, 0, 0,
+ 0.286841989, -51.696888, 0, 0, -0.232800946, 5.58722258, 0.0249437746,
+ 0.231541365, 0.435044378, 0, -77.5453415, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.465601891, 0.249437749],
+ "animatedMaps": [0.465601891, 0.31640324]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.274133086, 0.477973729, 0.792906463, 0.0188220982, 0.634179354,
+ 0.0882995427, 1.0872879, 0.936182201, 0.495520175, 0.385159433, 0.6549685
+ ],
+ "quats": [
+ 0.477913618, 0.719715297, -0.193864673, 0.464784801, -0.717810869,
+ 0.442561597, 0.344826877, 0.412287652
+ ],
+ "rawControls": [
+ 0.274133086, 0.477973729, 0.792906463, 0.477913618, 0.719715297,
+ -0.193864673, 0.464784801, -0.717810869, 0.442561597, 0.344826877,
+ 0.412287652
+ ],
+ "psdControls": [0.568482697],
+ "rbfControls": [0.00871269684, 0.0262422413, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7.30039072, 0, 0, 0, 0, 0, 0, 0, 0,
+ -164.163254, 61.8857765, -122.996315, 0, 0, 0, 0, 0, 0, -60.128315, 0, 0,
+ -0.137066543, 3.28959703, 0, -0.00881684758, 0, 0, -90.1924591, 0, 0, 0,
+ 0, 0
+ ],
+ "blendShapes": [0.274133086, 0],
+ "animatedMaps": [0.274133086, 0.482378989]
+ },
+ {
+ "lod": 0,
+ "gui": [0.33959043, 0.621266484],
+ "quats": [
+ 0.118679516, -0.600758433, 0.561587572, -0.556438565, 0.247279972,
+ -0.51948595, -0.14484641, 0.804988444
+ ],
+ "rawControls": [
+ 0.33959043, 0.378733516, 0.560633242, 0.118679516, -0.600758433,
+ 0.561587572, -0.556438565, 0.247279972, -0.51948595, -0.14484641,
+ 0.804988444
+ ],
+ "psdControls": [0.318495899],
+ "rbfControls": [0, 0.19456701, 0.233232126, 0.0570291094, 0.0480792597],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.469683379, 0, 0, 5.72699213, 3.56775737, 0,
+ 0, 0, 0, 0, 0, 0, 81.7310181, 49.0823631, 109.703293, 0, 0, 0, 0, 0,
+ 0.175068855, 17.0761433, 0, 0, -0.169795215, 4.07508516, 0.0318495892,
+ 0.0931363776, -0.276972502, 0, 25.6142159, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.33959043, 0.318495899],
+ "animatedMaps": [0.33959043, 0.402986825]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.644818008, 0.00183112628, 0.255848706, 0.0601723231, 0.687196195,
+ 1.16314745, 1.11071718, 0.767554998, 1.11877823, 0.147848874, 0.0715970322
+ ],
+ "quats": [
+ 0.681821465, -0.665093601, -0.144768998, 0.267977566, 0.400752217,
+ 0.222363055, 0.405628741, -0.790833533
+ ],
+ "rawControls": [
+ 0.644818008, 0.00183112628, 0.255848706, 0.681821465, -0.665093601,
+ -0.144768998, 0.267977566, 0.400752217, 0.222363055, 0.405628741,
+ -0.790833533
+ ],
+ "psdControls": [0.000702736899],
+ "rbfControls": [0.0160494987, 0.00157584436, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.24051273, 0, 0, 0, 0, 0, 0, 0, 0,
+ -147.465988, -23.7500439, 108.394386, 0, 0, 0, 0, 0, 0, -26.8734589, 0, 0,
+ -0.322409004, 7.73781586, 0, 0.030523153, 0, 0, -40.3101768, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.644818008, 0],
+ "animatedMaps": [0.644818008, 0.101464905]
+ },
+ {
+ "lod": 0,
+ "gui": [0.632575512, 0.439296067],
+ "quats": [
+ 0.440924883, 0.514741063, 0.0530072376, 0.733360112, -0.495465606,
+ -0.468901277, 0.43251431, 0.589556515
+ ],
+ "rawControls": [
+ 0.632575512, 0.439296067, 0.469648033, 0.440924883, 0.514741063,
+ 0.0530072376, 0.733360112, -0.495465606, -0.468901277, 0.43251431,
+ 0.589556515
+ ],
+ "psdControls": [0.309471816],
+ "rbfControls": [
+ 0.0506628677, 0.10865701, 0.0957591534, 0.136253461, 0.162904739
+ ],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.454472065, 0, 0, 7.3660965, 2.90341663, 0, 0,
+ 0, 0, 0, 0, 0, -68.5013046, 55.3314362, -44.8613243, 0, 0, 0, 0, 0,
+ 0.397063673, -40.0438194, 0, 0, -0.316287756, 7.59090614, 0.0309471823,
+ 0.449308664, -0.0423489995, 0, -60.065731, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.632575512, 0.309471816],
+ "animatedMaps": [0.632575512, 0.451436847]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.298351288, 0.680984139, 0.278056473, 0.645792723, 0.0537923835,
+ 1.07883203, 0.753628552, 0.638346374, 0.170050412, 1.07003736, 0.558121681
+ ],
+ "quats": [
+ -0.534918189, -0.188765988, -0.685039282, 0.457111716, -0.498876929,
+ 0.596137345, -0.591838896, 0.213234276
+ ],
+ "rawControls": [
+ 0.298351288, 0.680984139, 0.278056473, -0.534918189, -0.188765988,
+ -0.685039282, 0.457111716, -0.498876929, 0.596137345, -0.591838896,
+ 0.213234276
+ ],
+ "psdControls": [0.284028083],
+ "rbfControls": [0.00213075127, 0.00575428829, 0.108532667, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13.0814838, 0, 0, 0, 0, 0, 0, 0, 0,
+ 28.1854057, -55.6091537, 60.441124, 0, 0, 0, 0, 0, 0, -66.8567429, 0, 0,
+ -0.149175644, 3.58021545, 0, 0.0527735464, 0, 0, -100.28511, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.298351288, 0],
+ "animatedMaps": [0.298351288, 0.644787312]
+ },
+ {
+ "lod": 0,
+ "gui": [1.18924832, 0.665288627],
+ "quats": [
+ 0.719889641, 0.688139677, -0.0644612536, -0.0637770966, 0.793470025,
+ 0.0922877789, -0.241503999, -0.550966442
+ ],
+ "rawControls": [
+ 0, 0.334711373, 0.582644343, 0.719889641, 0.688139677, -0.0644612536,
+ -0.0637770966, 0.793470025, 0.0922877789, -0.241503999, -0.550966442
+ ],
+ "psdControls": [0.292526543],
+ "rbfControls": [0.011556847, 0.238477573, 0, 0.0107843745, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.458677858, 0, 0, 4.65858507, 3.78477955, 0,
+ 0, 0, 0, 0, 0, 0, 170.558228, -4.58949089, -114.80899, 0, 0, 0, 0, 0,
+ -0.0731316358, -55.2248306, 0, 0, 0, 0, 0.0292526539, -0.183010757,
+ 0.360412449, 0, -82.8372421, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0, 0.292526543],
+ "animatedMaps": [0, 0.367769092]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.0999491289, 0.195158675, 0.812806726, 1.01261973, 0.420577466,
+ 0.0359534025, 0.477812588, 0.135317162, 0.323836416, 0.123398073,
+ 0.352078497
+ ],
+ "quats": [
+ 0.508971572, -0.453364044, 0.197989345, 0.704421103, -0.0258567538,
+ -0.178523421, 0.670926154, -0.719248891
+ ],
+ "rawControls": [
+ 0.0999491289, 0.195158675, 0.812806726, 0.508971572, -0.453364044,
+ 0.197989345, 0.704421103, -0.0258567538, -0.178523421, 0.670926154,
+ -0.719248891
+ ],
+ "psdControls": [0.237939432],
+ "rbfControls": [0.100113079, 0.000205698016, 0, 0, 0.138007492],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.55295825, 0, 0, 0, 0, 0, 0, 0, 0,
+ -60.9636002, -60.9133224, 17.2739563, 0, 0, 0, 0, 0, 0, 2.05887771, 0, 0,
+ -0.0499745645, 1.19938958, 0, 0.200020462, 0, 0, 3.08831596, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.0999491289, 0],
+ "animatedMaps": [0.0999491289, 0.25612694]
+ },
+ {
+ "lod": 0,
+ "gui": [0.853938341, 0.783671558],
+ "quats": [
+ -0.516591191, 0.526201606, -0.63989079, -0.21629864, -0.499890089,
+ 0.34348163, -0.340654552, 0.718390346
+ ],
+ "rawControls": [
+ 0.853938341, 0.216328442, 0.641835809, -0.516591191, 0.526201606,
+ -0.63989079, -0.21629864, -0.499890089, 0.34348163, -0.340654552,
+ 0.718390346
+ ],
+ "psdControls": [0.208271012],
+ "rbfControls": [0.0461922921, 0.275000006, 0, 0.176739439, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.429082125, 0, 0, 1.74220276, 4.39722633, 0,
+ 0, 0, 0, 0, 0, 0, 126.723114, -54.156311, 151.617157, 0, 0, 0, 0, 0,
+ 0.588385999, -34.8320236, 0, 0, -0.426969171, 10.2472601, 0.0208271015,
+ 0.347602874, 0.456684887, 0, -52.2480469, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.853938341, 0.208271012],
+ "animatedMaps": [0.853938341, 0.273062766]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.57740432, 0.218265235, 1.10395658, 1.15887392, 0.0642027855,
+ 0.280145019, 0.691052556, 0.228877693, 0.536454082, 1.10606325,
+ 0.118817575
+ ],
+ "quats": [
+ 0.24430351, -0.222009882, 0.610368133, -0.720054269, -0.378102511,
+ 0.363692522, -0.603951395, 0.600007415
+ ],
+ "rawControls": [
+ 0.57740432, 0.218265235, 1.10395658, 0.24430351, -0.222009882,
+ 0.610368133, -0.720054269, -0.378102511, 0.363692522, -0.603951395,
+ 0.600007415
+ ],
+ "psdControls": [0.327397853],
+ "rbfControls": [0, 0.0548306927, 0.23031728, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.172284484, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33.4616089, 15.829524, 60.9474983, 0, 0, 0, 0, 0, 0, -32.2176132, 0, 0,
+ -0.28870216, 6.92885208, 0, 0.0603279471, 0, 0, -48.3264198, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.57740432, 0],
+ "animatedMaps": [0.57740432, 0.274612188]
+ },
+ {
+ "lod": 0,
+ "gui": [0.289680362, 0.180432275],
+ "quats": [
+ 0.257647395, 0.277939737, -0.621192038, -0.685921192, 0.0158271473,
+ -0.445251465, -0.854672492, -0.26652509
+ ],
+ "rawControls": [
+ 0.289680362, 0.180432275, 0.34021613, 0.257647395, 0.277939737,
+ -0.621192038, -0.685921192, 0.0158271473, -0.445251465, -0.854672492,
+ -0.26652509
+ ],
+ "psdControls": [0.0920789614],
+ "rbfControls": [0.22998625, 0, 0, 0.0461158715, 0.300000012],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.26032421, 0, 0, 2.18380165, 2.36746311, 0, 0,
+ 0, 0, 0, 0, 0, 40.1255341, -20.7301922, -66.6432343, 0, 0, 0, 0, 0,
+ 0.194240525, -3.39842319, 0, 0, -0.144840181, 3.47616434, 0.00920789596,
+ 0.598320127, 0.0115289679, 0, -5.09763575, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.289680362, 0.0920789614],
+ "animatedMaps": [0.289680362, 0.244345829]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 1.02489662, 0.708650351, 0.119691759, 0.275359094, 0.0428633466,
+ 0.247738421, 0.301843643, 0.984621346, 0.779608846, 1.02246809,
+ 0.0855234191
+ ],
+ "quats": [
+ -0.44027102, 0.170514673, -0.677932203, -0.563466191, -0.610268295,
+ -0.738997936, -0.153629676, -0.240525961
+ ],
+ "rawControls": [
+ 1.02489662, 0.708650351, 0.119691759, -0.44027102, 0.170514673,
+ -0.677932203, -0.563466191, -0.610268295, -0.738997936, -0.153629676,
+ -0.240525961
+ ],
+ "psdControls": [0.127229407],
+ "rbfControls": [0.147179693, 0.00707534002, 0.104691677, 0, 0.186262116],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13.9562368, 0, 0, 0, 0, 0, 0, 0, 0,
+ -21.835041, -43.5574226, -59.5043678, 0, 0, 0, 0, 0, 0, 68.4890442, 0, 0,
+ -0.512448311, 12.2987595, 0, 0.339629889, 0, 0, 102.733566, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [1.02489662, 0],
+ "animatedMaps": [0, 0]
+ },
+ {
+ "lod": 0,
+ "gui": [0.691620588, 0.054342486],
+ "quats": [
+ 0.660790563, 0.733216643, 0.139903426, 0.0785884634, -0.364146441,
+ -0.664562345, 0.259824008, -0.598536372
+ ],
+ "rawControls": [
+ 0.691620588, 0.054342486, 0.277171254, 0.660790563, 0.733216643,
+ 0.139903426, 0.0785884634, -0.364146441, -0.664562345, 0.259824008,
+ -0.598536372
+ ],
+ "psdControls": [0.0225932635],
+ "rbfControls": [0.0118719656, 0, 0, 0.149973482, 0.300000012],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.165756866, 0, 0, -0.231226787, 2.03359795, 0,
+ 0, 0, 0, 0, 0, 0, -164.471069, 3.4416914, -120.844093, 0, 0, 0, 0, 0,
+ 0.513067126, 31.3161278, 0, 0, -0.345810294, 8.29944706, 0.0022593264,
+ 0.473664373, 0.0374933705, 0, 46.9741707, 0, 0, 0, 0, 0
+ ],
+ "blendShapes": [0.691620588, 0.0225932635],
+ "animatedMaps": [0.691620588, 0.143473998]
+ },
+ {
+ "lod": 1,
+ "raw": [
+ 0.852707267, 1.19184208, 0.308484584, 0.597555697, 0.350150526,
+ 0.593521714, 0.846252084, 0.0517903119, 0.957521856, 0.909278333,
+ 0.0268733036
+ ],
+ "quats": [
+ -0.251632333, 0.960732102, 0.108770929, 0.0429397449, 0.340674251,
+ -0.701071739, 0.329677999, 0.532683611
+ ],
+ "rawControls": [
+ 0.852707267, 1.19184208, 0.308484584, -0.251632333, 0.960732102,
+ 0.108770929, 0.0429397449, 0.340674251, -0.701071739, 0.329677999,
+ 0.532683611
+ ],
+ "psdControls": [0.462726891],
+ "rbfControls": [0.00873098522, 0.0320259482, 0, 0, 0],
+ "joints": [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23.6825981, 0, 0, 0, 0, 0, 0, 0, 0,
+ -172.207733, 6.49180126, 159.935989, 0, 0, 0, 0, 0, 0, 32.6006699, 0, 0,
+ -0.426353633, 10.2324867, 0, -0.0145639777, 0, 0, 48.9010048, 0, 0, 0, 0,
+ 0
+ ],
+ "blendShapes": [0.852707267, 0],
+ "animatedMaps": [0.852707267, 0]
+ }
+]
diff --git a/packages/dna/fixtures/oracle.cpp b/packages/dna/fixtures/oracle.cpp
new file mode 100644
index 00000000..2f96e753
--- /dev/null
+++ b/packages/dna/fixtures/oracle.cpp
@@ -0,0 +1,751 @@
+// Test oracle for framefields' DNA reader, built against OpenRigLogic 5.8
+// (https://github.com/EpicGames/openriglogic, commit d3d329bbd6992ac38adc1c1b24203ceb998f75c0).
+// oracle write <out.dna> writes a small synthetic character with Epic's DNA writer
+// oracle dump <in.dna> prints what Epic's DNA reader reads, as JSON
+// oracle eval <in.dna> <seed> <n> prints RigLogic's outputs for n seeded random control sets
+// (GUI and raw controls alternately, cycling the LODs), as JSON
+// It regenerates oracle.dna and oracle.json, which dna-oracle.test.ts compares readDna against:
+// git clone --branch 5.8 https://github.com/EpicGames/openriglogic && cd openriglogic
+// cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --target riglogic4
+// clang++ -std=c++17 -Iinclude <this file> build/libriglogic4*.a -o oracle
+// ./oracle write oracle.dna && ./oracle dump oracle.dna > oracle.json && ./oracle eval oracle.dna 7 48 > oracle-eval.json
+#include <dna/BinaryStreamReader.h>
+#include <dna/BinaryStreamWriter.h>
+#include <dna/layers/Geometry.h>
+#include <dna/types/Vector3.h>
+#include <riglogic/RigLogic.h>
+#include <pma/ScopedPtr.h>
+#include <trio/streams/FileStream.h>
+
+#include <cstdio>
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
+#include <string>
+#include <vector>
+
+using namespace dna;
+
+static void writeDna(const char* path) {
+ auto stream = pma::makeScoped<trio::FileStream>(path, trio::FileStream::AccessMode::Write, trio::FileStream::OpenMode::Binary);
+ auto w = pma::makeScoped<BinaryStreamWriter>(stream.get());
+
+ w->setName("Oracle");
+ w->setArchetype(Archetype::other);
+ w->setGender(Gender::female);
+ w->setAge(42);
+ w->setMetaData("made by", "oracle");
+ w->setMetaData("purpose", "parity");
+ w->setTranslationUnit(TranslationUnit::cm);
+ w->setRotationUnit(RotationUnit::degrees);
+ w->setCoordinateSystem({Direction::right, Direction::up, Direction::front});
+ w->setRotationSequence(RotationSequence::zyx);
+ w->setRotationSign({RotationDirection::positive, RotationDirection::negative, RotationDirection::positive});
+ w->setFaceWindingOrder(FaceWindingOrder::ccw);
+ w->setLODCount(2);
+ w->setDBMaxLOD(0);
+ w->setDBComplexity("Oracle");
+ w->setDBName("OracleDB");
+
+ const char* gui[] = {"CTRL_jaw", "CTRL_smile"};
+ for (std::uint16_t i = 0; i < 2; ++i) w->setGUIControlName(i, gui[i]);
+ // Raw controls: three face controls, then the arm's and forearm's rotations
+ // as quaternions (the host fills them from the animated skeleton).
+ const char* raw[] = {"jawOpen", "smileL", "smileR", "arm.qx", "arm.qy", "arm.qz", "arm.qw",
+ "forearm.qx", "forearm.qy", "forearm.qz", "forearm.qw"};
+ for (std::uint16_t i = 0; i < 11; ++i) w->setRawControlName(i, raw[i]);
+ const char* joints[] = {"root", "neck", "head", "jaw", "eyeL"};
+ for (std::uint16_t i = 0; i < 5; ++i) w->setJointName(i, joints[i]);
+ std::uint16_t lod0Joints[] = {0, 1, 2, 3, 4};
+ std::uint16_t lod1Joints[] = {0, 1, 2};
+ w->setJointIndices(0, lod0Joints, 5);
+ w->setJointIndices(1, lod1Joints, 3);
+ w->setLODJointMapping(0, 0);
+ w->setLODJointMapping(1, 1);
+ const char* channels[] = {"jawOpen", "smile_corrective"};
+ for (std::uint16_t i = 0; i < 2; ++i) w->setBlendShapeChannelName(i, channels[i]);
+ std::uint16_t bs0[] = {0, 1};
+ std::uint16_t bs1[] = {0};
+ w->setBlendShapeChannelIndices(0, bs0, 2);
+ w->setBlendShapeChannelIndices(1, bs1, 1);
+ w->setLODBlendShapeChannelMapping(0, 0);
+ w->setLODBlendShapeChannelMapping(1, 1);
+ const char* maps[] = {"head_wm1_forehead", "head_wm2_cheek"};
+ for (std::uint16_t i = 0; i < 2; ++i) w->setAnimatedMapName(i, maps[i]);
+ std::uint16_t am0[] = {0, 1};
+ w->setAnimatedMapIndices(0, am0, 2);
+ w->setLODAnimatedMapMapping(0, 0);
+ w->setLODAnimatedMapMapping(1, 0);
+ const char* meshes[] = {"head_lod0_mesh", "head_lod1_mesh"};
+ for (std::uint16_t i = 0; i < 2; ++i) w->setMeshName(i, meshes[i]);
+ std::uint16_t m0[] = {0};
+ std::uint16_t m1[] = {1};
+ w->setMeshIndices(0, m0, 1);
+ w->setMeshIndices(1, m1, 1);
+ w->setLODMeshMapping(0, 0);
+ w->setLODMeshMapping(1, 1);
+ w->setMeshBlendShapeChannelMapping(0, 0, 0);
+ w->setMeshBlendShapeChannelMapping(1, 0, 1);
+ w->setMeshBlendShapeChannelMapping(2, 1, 0);
+ std::uint16_t hierarchy[] = {0, 0, 1, 2, 2};
+ w->setJointHierarchy(hierarchy, 5);
+ Vector3 t[] = {{0.0f, 0.0f, 0.0f}, {0.0f, 150.0f, -2.0f}, {0.0f, 12.5f, 1.0f}, {0.0f, -3.0f, 4.5f}, {3.2f, 4.0f, 8.0f}};
+ Vector3 r[] = {{0.0f, 0.0f, 0.0f}, {-10.0f, 0.0f, 0.0f}, {12.0f, 5.0f, -3.0f}, {0.0f, 90.0f, 25.0f}, {1.5f, -2.5f, 3.5f}};
+ w->setNeutralJointTranslations(t, 5);
+ w->setNeutralJointRotations(r, 5);
+
+ // CTRL_smile drives smileL through two overlapping intervals: where both
+ // match (0.4 … 0.6) only the first counts.
+ std::uint16_t gIn[] = {0, 1, 1, 1};
+ std::uint16_t gOut[] = {0, 1, 1, 2};
+ float gFrom[] = {0.0f, 0.0f, 0.4f, 0.0f};
+ float gTo[] = {1.0f, 0.6f, 1.0f, 1.0f};
+ float gSlope[] = {1.0f, 1.0f, -1.0f, 0.5f};
+ float gCut[] = {0.0f, 0.0f, 1.0f, 0.25f};
+ w->setGUIToRawInputIndices(gIn, 4);
+ w->setGUIToRawOutputIndices(gOut, 4);
+ w->setGUIToRawFromValues(gFrom, 4);
+ w->setGUIToRawToValues(gTo, 4);
+ w->setGUIToRawSlopeValues(gSlope, 4);
+ w->setGUIToRawCutValues(gCut, 4);
+ w->setPSDCount(1);
+ std::uint16_t psdRows[] = {11, 11};
+ std::uint16_t psdCols[] = {1, 2};
+ float psdValues[] = {1.5f, 1.0f}; // a weight above 1: the PSD caps at 1
+ w->setPSDRowIndices(psdRows, 2);
+ w->setPSDColumnIndices(psdCols, 2);
+ w->setPSDValues(psdValues, 2);
+ w->setJointRowCount(45);
+ w->setJointColumnCount(4);
+ std::uint16_t jgLods[] = {4, 2};
+ std::uint16_t jgIn[] = {0, 11};
+ std::uint16_t jgOut[] = {33, 34, 35, 29};
+ float jgValues[] = {-0.5f, 0.0f, 12.0f, 0.0f, 0.0f, 0.1f, 0.75f, -0.25f};
+ std::uint16_t jgJoints[] = {3};
+ w->setJointGroupLODs(0, jgLods, 2);
+ w->setJointGroupInputIndices(0, jgIn, 2);
+ w->setJointGroupOutputIndices(0, jgOut, 4);
+ w->setJointGroupValues(0, jgValues, 8);
+ w->setJointGroupJointIndices(0, jgJoints, 1);
+ // Group 1: the neck's rotation and translation from smileL, smileR and the PSD.
+ std::uint16_t jg1Lods[] = {3, 1};
+ std::uint16_t jg1In[] = {1, 2, 11};
+ std::uint16_t jg1Out[] = {12, 13, 9};
+ float jg1Values[] = {20.0f, -5.0f, 3.0f, 0.0f, 7.5f, -2.0f, 0.5f, 0.5f, 0.0f};
+ std::uint16_t jg1Joints[] = {1};
+ w->setJointGroupLODs(1, jg1Lods, 2);
+ w->setJointGroupInputIndices(1, jg1In, 3);
+ w->setJointGroupOutputIndices(1, jg1Out, 3);
+ w->setJointGroupValues(1, jg1Values, 9);
+ w->setJointGroupJointIndices(1, jg1Joints, 1);
+ // Group 2: the eye joint's translation from the RBF pose controls (12 … 16).
+ std::uint16_t jg2Lods[] = {2, 1};
+ std::uint16_t jg2In[] = {12, 13, 14, 15};
+ std::uint16_t jg2Out[] = {36, 37};
+ float jg2Values[] = {2.0f, -1.0f, 0.5f, 3.0f, 0.0f, 1.5f, -2.5f, 0.25f};
+ std::uint16_t jg2Joints[] = {4};
+ w->setJointGroupLODs(2, jg2Lods, 2);
+ w->setJointGroupInputIndices(2, jg2In, 4);
+ w->setJointGroupOutputIndices(2, jg2Out, 2);
+ w->setJointGroupValues(2, jg2Values, 8);
+ w->setJointGroupJointIndices(2, jg2Joints, 1);
+
+ // RBF: solver 0 reads the arm's quaternion (interpolative, quaternion
+ // distance, Gaussian); solver 1 the forearm's twist (additive, twist angle,
+ // linear, automatic radius). Their poses write controls 12 … 16.
+ const float s45 = 0.38268343f, c45 = 0.92387953f;
+ // The arm's fourth pose sits close to its second, so interpolation overshoots
+ // and clamps; the forearm has four poses, so the automatic radius averages
+ // six distances.
+ const float s30 = 0.5f, c30 = 0.8660254f;
+ float armTargets[] = {0, 0, 0, 1, 0, 0, s45, c45, 0, s45, 0, c45, 0, 0, s30, c30};
+ float forearmTargets[] = {0, 0, 0, 1, s45, 0, 0, c45, 0.70710677f, 0, 0, 0.70710677f, c45, 0, 0, s45};
+ std::uint16_t armRaw[] = {3, 4, 5, 6};
+ std::uint16_t forearmRaw[] = {7, 8, 9, 10};
+ std::uint16_t armPoses[] = {0, 1, 2, 6};
+ std::uint16_t forearmPoses[] = {3, 4, 5, 7};
+ w->setRBFSolverName(0, "arm_rbf");
+ w->setRBFSolverRawControlIndices(0, armRaw, 4);
+ w->setRBFSolverPoseIndices(0, armPoses, 4);
+ w->setRBFSolverRawControlValues(0, armTargets, 16);
+ w->setRBFSolverType(0, RBFSolverType::Interpolative);
+ w->setRBFSolverRadius(0, 50.0f);
+ w->setRBFSolverAutomaticRadius(0, AutomaticRadius::Off);
+ w->setRBFSolverWeightThreshold(0, 0.001f);
+ w->setRBFSolverDistanceMethod(0, RBFDistanceMethod::Quaternion);
+ w->setRBFSolverNormalizeMethod(0, RBFNormalizeMethod::OnlyNormalizeAboveOne);
+ w->setRBFSolverFunctionType(0, RBFFunctionType::Gaussian);
+ w->setRBFSolverTwistAxis(0, TwistAxis::X);
+ w->setRBFSolverName(1, "forearm_twist");
+ w->setRBFSolverRawControlIndices(1, forearmRaw, 4);
+ w->setRBFSolverPoseIndices(1, forearmPoses, 4);
+ w->setRBFSolverRawControlValues(1, forearmTargets, 16);
+ w->setRBFSolverType(1, RBFSolverType::Additive);
+ w->setRBFSolverRadius(1, 0.0f);
+ w->setRBFSolverAutomaticRadius(1, AutomaticRadius::On);
+ w->setRBFSolverWeightThreshold(1, 0.0f);
+ w->setRBFSolverDistanceMethod(1, RBFDistanceMethod::TwistAngle);
+ w->setRBFSolverNormalizeMethod(1, RBFNormalizeMethod::AlwaysNormalize);
+ w->setRBFSolverFunctionType(1, RBFFunctionType::Linear);
+ w->setRBFSolverTwistAxis(1, TwistAxis::X);
+ // Solver 2: the arm's swing about z (additive, swing angle, cubic).
+ float swingTargets[] = {0, 0, 0, 1, s45, 0, 0, c45, 0, s45, 0, c45};
+ std::uint16_t swingPoses[] = {8, 9, 10};
+ w->setRBFSolverName(2, "arm_swing");
+ w->setRBFSolverRawControlIndices(2, armRaw, 4);
+ w->setRBFSolverPoseIndices(2, swingPoses, 3);
+ w->setRBFSolverRawControlValues(2, swingTargets, 12);
+ w->setRBFSolverType(2, RBFSolverType::Additive);
+ w->setRBFSolverRadius(2, 60.0f);
+ w->setRBFSolverAutomaticRadius(2, AutomaticRadius::Off);
+ w->setRBFSolverWeightThreshold(2, 0.0f);
+ w->setRBFSolverDistanceMethod(2, RBFDistanceMethod::SwingAngle);
+ w->setRBFSolverNormalizeMethod(2, RBFNormalizeMethod::OnlyNormalizeAboveOne);
+ w->setRBFSolverFunctionType(2, RBFFunctionType::Cubic);
+ w->setRBFSolverTwistAxis(2, TwistAxis::Z);
+ // Solver 3: both smiles together (interpolative, Euclidean, quintic, automatic radius).
+ std::uint16_t smileRaw[] = {1, 2};
+ float smileTargets[] = {0, 0, 1, 0, 0, 1, 1, 1};
+ std::uint16_t smilePoses[] = {11, 12, 13, 14};
+ w->setRBFSolverName(3, "smiles");
+ w->setRBFSolverRawControlIndices(3, smileRaw, 2);
+ w->setRBFSolverPoseIndices(3, smilePoses, 4);
+ w->setRBFSolverRawControlValues(3, smileTargets, 8);
+ w->setRBFSolverType(3, RBFSolverType::Interpolative);
+ w->setRBFSolverRadius(3, 0.0f);
+ w->setRBFSolverAutomaticRadius(3, AutomaticRadius::On);
+ w->setRBFSolverWeightThreshold(3, 0.01f);
+ w->setRBFSolverDistanceMethod(3, RBFDistanceMethod::Euclidean);
+ w->setRBFSolverNormalizeMethod(3, RBFNormalizeMethod::OnlyNormalizeAboveOne);
+ w->setRBFSolverFunctionType(3, RBFFunctionType::Quintic);
+ w->setRBFSolverTwistAxis(3, TwistAxis::X);
+ // Solver 4: the jaw (additive, Euclidean, exponential; radius in degrees like every RBF radius).
+ std::uint16_t jawRaw[] = {0};
+ float jawTargets[] = {0, 1};
+ std::uint16_t jawPoses[] = {15, 16};
+ w->setRBFSolverName(4, "jaw");
+ w->setRBFSolverRawControlIndices(4, jawRaw, 1);
+ w->setRBFSolverPoseIndices(4, jawPoses, 2);
+ w->setRBFSolverRawControlValues(4, jawTargets, 2);
+ w->setRBFSolverType(4, RBFSolverType::Additive);
+ w->setRBFSolverRadius(4, 40.0f);
+ w->setRBFSolverAutomaticRadius(4, AutomaticRadius::Off);
+ w->setRBFSolverWeightThreshold(4, 0.0f);
+ w->setRBFSolverDistanceMethod(4, RBFDistanceMethod::Euclidean);
+ w->setRBFSolverNormalizeMethod(4, RBFNormalizeMethod::AlwaysNormalize);
+ w->setRBFSolverFunctionType(4, RBFFunctionType::Exponential);
+ w->setRBFSolverTwistAxis(4, TwistAxis::X);
+ std::uint16_t rbfLod0[] = {0, 1, 2, 3, 4};
+ std::uint16_t rbfLod1[] = {0, 2};
+ w->setRBFSolverIndices(0, rbfLod0, 5);
+ w->setRBFSolverIndices(1, rbfLod1, 2);
+ w->setLODRBFSolverMapping(0, 0);
+ w->setLODRBFSolverMapping(1, 1);
+ const char* poses[] = {"arm_rest", "arm_up", "arm_forward", "forearm_rest", "forearm_twist45", "forearm_twist90",
+ "arm_up30", "forearm_twist135", "swing_rest", "swing_x", "swing_y", "smiles_none", "smiles_left",
+ "smiles_right", "smiles_both", "jaw_closed", "jaw_open"};
+ float poseScales[] = {1.0f, 1.0f, 0.8f, 1.0f, 1.0f, 1.2f, 0.9f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.1f, 1.0f, 1.0f};
+ for (std::uint16_t i = 0; i < 17; ++i) {
+ w->setRBFPoseName(i, poses[i]);
+ w->setRBFPoseScale(i, poseScales[i]);
+ }
+ const char* poseControls[] = {"arm_up_pc", "arm_forward_pc", "forearm_twist45_pc", "forearm_twist90_pc", "arm_up_half_pc"};
+ for (std::uint16_t i = 0; i < 5; ++i) w->setRBFPoseControlName(i, poseControls[i]);
+ std::uint16_t none[] = {0};
+ std::uint16_t up[] = {12, 16};
+ float upWeights[] = {1.0f, 0.5f};
+ std::uint16_t forward[] = {13};
+ float one[] = {1.0f};
+ std::uint16_t gate[] = {0}; // arm_forward only counts as far as jawOpen allows
+ std::uint16_t twist45[] = {14};
+ std::uint16_t twist90[] = {15};
+ for (std::uint16_t i : {0, 3}) {
+ w->setRBFPoseInputControlIndices(i, none, 0);
+ w->setRBFPoseOutputControlIndices(i, none, 0);
+ w->setRBFPoseOutputControlWeights(i, one, 0);
+ }
+ w->setRBFPoseInputControlIndices(1, none, 0);
+ w->setRBFPoseOutputControlIndices(1, up, 2);
+ w->setRBFPoseOutputControlWeights(1, upWeights, 2);
+ w->setRBFPoseInputControlIndices(2, gate, 1);
+ w->setRBFPoseOutputControlIndices(2, forward, 1);
+ w->setRBFPoseOutputControlWeights(2, one, 1);
+ w->setRBFPoseInputControlIndices(4, none, 0);
+ w->setRBFPoseOutputControlIndices(4, twist45, 1);
+ w->setRBFPoseOutputControlWeights(4, one, 1);
+ w->setRBFPoseInputControlIndices(5, none, 0);
+ w->setRBFPoseOutputControlIndices(5, twist90, 1);
+ w->setRBFPoseOutputControlWeights(5, one, 1);
+ std::uint16_t up30[] = {12};
+ float up30Weight[] = {0.7f};
+ w->setRBFPoseInputControlIndices(6, none, 0);
+ w->setRBFPoseOutputControlIndices(6, up30, 1);
+ w->setRBFPoseOutputControlWeights(6, up30Weight, 1);
+ w->setRBFPoseInputControlIndices(7, none, 0);
+ w->setRBFPoseOutputControlIndices(7, twist90, 1);
+ w->setRBFPoseOutputControlWeights(7, one, 1);
+ // New poses: each writes one control with its own weight, or nothing.
+ struct PoseOut {
+ std::uint16_t pose;
+ std::uint16_t control;
+ float weight;
+ };
+ const PoseOut outs[] = {{9, 16, 0.3f}, {10, 14, 0.4f}, {14, 13, 0.5f}, {12, 16, 0.6f}, {16, 15, 0.2f}};
+ for (std::uint16_t pose : {8, 11, 13, 15}) {
+ w->setRBFPoseInputControlIndices(pose, none, 0);
+ w->setRBFPoseOutputControlIndices(pose, none, 0);
+ w->setRBFPoseOutputControlWeights(pose, one, 0);
+ }
+ for (const auto& o : outs) {
+ w->setRBFPoseInputControlIndices(o.pose, none, 0);
+ w->setRBFPoseOutputControlIndices(o.pose, &o.control, 1);
+ w->setRBFPoseOutputControlWeights(o.pose, &o.weight, 1);
+ }
+
+ // Twist and swing: the forearm's twist spreads to the jaw and eye joints
+ // (half and a quarter); the arm's swing turns the head by 0.3.
+ std::uint16_t twistOut[] = {3, 4};
+ float twistWeights[] = {0.5f, 0.25f};
+ w->setTwistSetupTwistAxis(0, TwistAxis::X);
+ w->setTwistInputControlIndices(0, forearmRaw, 4);
+ w->setTwistOutputJointIndices(0, twistOut, 2);
+ w->setTwistBlendWeights(0, twistWeights, 2);
+ std::uint16_t swingOut[] = {2};
+ float swingWeights[] = {0.3f};
+ w->setSwingSetupTwistAxis(0, TwistAxis::Y);
+ w->setSwingInputControlIndices(0, armRaw, 4);
+ w->setSwingOutputJointIndices(0, swingOut, 1);
+ w->setSwingBlendWeights(0, swingWeights, 1);
+ std::uint16_t bsLods[] = {2, 1};
+ std::uint16_t bsIn[] = {0, 11};
+ std::uint16_t bsOut[] = {0, 1};
+ w->setBlendShapeChannelLODs(bsLods, 2);
+ w->setBlendShapeChannelInputIndices(bsIn, 2);
+ w->setBlendShapeChannelOutputIndices(bsOut, 2);
+ // The cheek map rises then falls back over two overlapping intervals; LOD 1 keeps the first two rows.
+ std::uint16_t amLods[] = {3, 2};
+ std::uint16_t amIn[] = {0, 1, 1};
+ std::uint16_t amOut[] = {0, 1, 1};
+ float amFrom[] = {0.0f, 0.0f, 0.5f};
+ float amTo[] = {1.0f, 0.7f, 1.0f};
+ float amSlope[] = {1.0f, 0.8f, -0.5f};
+ float amCut[] = {0.0f, 0.1f, 0.9f};
+ w->setAnimatedMapLODs(amLods, 2);
+ w->setAnimatedMapInputIndices(amIn, 3);
+ w->setAnimatedMapOutputIndices(amOut, 3);
+ w->setAnimatedMapFromValues(amFrom, 3);
+ w->setAnimatedMapToValues(amTo, 3);
+ w->setAnimatedMapSlopeValues(amSlope, 3);
+ w->setAnimatedMapCutValues(amCut, 3);
+
+ // Mesh 0: a quad and a triangle; mesh 1: one triangle.
+ Position p0[] = {{-5.0f, 150.0f, 9.0f}, {5.0f, 150.0f, 9.0f}, {5.0f, 165.0f, 8.0f}, {-5.0f, 165.0f, 8.0f}, {0.0f, 170.0f, 7.5f}};
+ TextureCoordinate uv0[] = {{0.1f, 0.2f}, {0.9f, 0.2f}, {0.9f, 0.8f}, {0.1f, 0.8f}, {0.5f, 0.95f}, {0.55f, 0.95f}};
+ Normal n0[] = {{0.0f, 0.0f, 1.0f}, {0.0f, 0.6f, 0.8f}};
+ VertexLayout l0[] = {{0, 0, 0}, {1, 1, 0}, {2, 2, 0}, {3, 3, 0}, {4, 4, 1}, {4, 5, 1}};
+ w->setVertexPositions(0, p0, 5);
+ w->setVertexTextureCoordinates(0, uv0, 6);
+ w->setVertexNormals(0, n0, 2);
+ w->setVertexLayouts(0, l0, 6);
+ std::uint32_t f0[] = {0, 1, 2, 3};
+ std::uint32_t f1[] = {3, 2, 4};
+ w->setFaceVertexLayoutIndices(0, 0, f0, 4);
+ w->setFaceVertexLayoutIndices(0, 1, f1, 3);
+ w->setMaximumInfluencePerVertex(0, 6);
+ float sw0[] = {1.0f};
+ std::uint16_t sj0[] = {1};
+ float sw1[] = {0.5f, 0.5f};
+ std::uint16_t sj1[] = {1, 2};
+ float sw2[] = {0.3f, 0.2f, 0.15f, 0.15f, 0.1f, 0.1f};
+ std::uint16_t sj2[] = {2, 3, 4, 1, 0, 3};
+ w->setSkinWeightsValues(0, 0, sw0, 1);
+ w->setSkinWeightsJointIndices(0, 0, sj0, 1);
+ w->setSkinWeightsValues(0, 1, sw1, 2);
+ w->setSkinWeightsJointIndices(0, 1, sj1, 2);
+ w->setSkinWeightsValues(0, 2, sw2, 6);
+ w->setSkinWeightsJointIndices(0, 2, sj2, 6);
+ w->setSkinWeightsValues(0, 3, sw0, 1);
+ w->setSkinWeightsJointIndices(0, 3, sj0, 1);
+ w->setSkinWeightsValues(0, 4, sw1, 2);
+ w->setSkinWeightsJointIndices(0, 4, sj1, 2);
+ Delta d0[] = {{0.0f, -1.5f, 0.2f}, {0.0f, -1.5f, 0.2f}};
+ std::uint32_t v0[] = {0, 1};
+ Delta d1[] = {{0.3f, 0.4f, -0.1f}};
+ std::uint32_t v1[] = {2};
+ w->setBlendShapeChannelIndex(0, 0, 0);
+ w->setBlendShapeTargetDeltas(0, 0, d0, 2);
+ w->setBlendShapeTargetVertexIndices(0, 0, v0, 2);
+ w->setBlendShapeChannelIndex(0, 1, 1);
+ w->setBlendShapeTargetDeltas(0, 1, d1, 1);
+ w->setBlendShapeTargetVertexIndices(0, 1, v1, 1);
+
+ Position p1[] = {{-5.0f, 150.0f, 9.0f}, {5.0f, 150.0f, 9.0f}, {0.0f, 170.0f, 7.5f}};
+ TextureCoordinate uv1[] = {{0.0f, 0.0f}, {1.0f, 0.0f}, {0.5f, 1.0f}};
+ Normal n1[] = {{0.0f, 0.0f, 1.0f}};
+ VertexLayout l1[] = {{0, 0, 0}, {1, 1, 0}, {2, 2, 0}};
+ w->setVertexPositions(1, p1, 3);
+ w->setVertexTextureCoordinates(1, uv1, 3);
+ w->setVertexNormals(1, n1, 1);
+ w->setVertexLayouts(1, l1, 3);
+ std::uint32_t f2[] = {0, 1, 2};
+ w->setFaceVertexLayoutIndices(1, 0, f2, 3);
+ w->setMaximumInfluencePerVertex(1, 1);
+ for (std::uint32_t v = 0; v < 3; ++v) {
+ w->setSkinWeightsValues(1, v, sw0, 1);
+ w->setSkinWeightsJointIndices(1, v, sj0, 1);
+ }
+ Delta d2[] = {{0.0f, -1.0f, 0.0f}};
+ std::uint32_t v2[] = {0};
+ w->setBlendShapeChannelIndex(1, 0, 0);
+ w->setBlendShapeTargetDeltas(1, 0, d2, 1);
+ w->setBlendShapeTargetVertexIndices(1, 0, v2, 1);
+
+ w->write();
+ if (!Status::isOk()) {
+ std::fprintf(stderr, "write failed: %s\n", Status::get().message);
+ std::exit(1);
+ }
+}
+
+static void printString(StringView s) {
+ std::putchar('"');
+ for (std::size_t i = 0; i < s.size(); ++i) {
+ const char c = s[i];
+ if (c == '"' || c == '\\') std::putchar('\\');
+ std::putchar(c);
+ }
+ std::putchar('"');
+}
+
+template<typename V>
+static void printArray(const V& a) {
+ std::putchar('[');
+ for (std::size_t i = 0; i < a.size(); ++i) {
+ if (i) std::putchar(',');
+ std::printf("%.9g", static_cast<double>(a[i]));
+ }
+ std::putchar(']');
+}
+
+static void dumpDna(const char* path) {
+ auto stream = pma::makeScoped<trio::FileStream>(path, trio::FileStream::AccessMode::Read, trio::FileStream::OpenMode::Binary);
+ auto r = pma::makeScoped<BinaryStreamReader>(stream.get(), DataLayer::All);
+ r->read();
+ if (!Status::isOk()) {
+ std::fprintf(stderr, "read failed: %s\n", Status::get().message);
+ std::exit(1);
+ }
+ std::printf("{\"version\":[%u,%u]", r->getFileFormatGeneration(), r->getFileFormatVersion());
+ std::printf(",\"name\":");
+ printString(r->getName());
+ std::printf(",\"archetype\":%d,\"gender\":%d,\"age\":%u", static_cast<int>(r->getArchetype()), static_cast<int>(r->getGender()), r->getAge());
+ std::printf(",\"metadata\":[");
+ for (std::uint32_t i = 0; i < r->getMetaDataCount(); ++i) {
+ if (i) std::putchar(',');
+ const auto key = r->getMetaDataKey(i);
+ std::putchar('[');
+ printString(key);
+ std::putchar(',');
+ printString(r->getMetaDataValue(std::string(key.data(), key.size()).c_str()));
+ std::putchar(']');
+ }
+ std::printf("]");
+ const auto cs = r->getCoordinateSystem();
+ const auto sign = r->getRotationSign();
+ std::printf(",\"translationUnit\":%d,\"rotationUnit\":%d,\"coordinateSystem\":[%d,%d,%d]", static_cast<int>(r->getTranslationUnit()),
+ static_cast<int>(r->getRotationUnit()), static_cast<int>(cs.x), static_cast<int>(cs.y), static_cast<int>(cs.z));
+ std::printf(",\"rotationSequence\":%d,\"rotationSign\":[%d,%d,%d],\"faceWindingOrder\":%d", static_cast<int>(r->getRotationSequence()),
+ static_cast<int>(sign.x), static_cast<int>(sign.y), static_cast<int>(sign.z), static_cast<int>(r->getFaceWindingOrder()));
+ std::printf(",\"lodCount\":%u,\"maxLOD\":%u,\"complexity\":", r->getLODCount(), r->getDBMaxLOD());
+ printString(r->getDBComplexity());
+ std::printf(",\"dbName\":");
+ printString(r->getDBName());
+
+ auto names = [&](const char* key, std::uint16_t count, auto get) {
+ std::printf(",\"%s\":[", key);
+ for (std::uint16_t i = 0; i < count; ++i) {
+ if (i) std::putchar(',');
+ printString(get(i));
+ }
+ std::printf("]");
+ };
+ names("guiControlNames", r->getGUIControlCount(), [&](std::uint16_t i) { return r->getGUIControlName(i); });
+ names("rawControlNames", r->getRawControlCount(), [&](std::uint16_t i) { return r->getRawControlName(i); });
+ names("jointNames", r->getJointCount(), [&](std::uint16_t i) { return r->getJointName(i); });
+ names("blendShapeChannelNames", r->getBlendShapeChannelCount(), [&](std::uint16_t i) { return r->getBlendShapeChannelName(i); });
+ names("animatedMapNames", r->getAnimatedMapCount(), [&](std::uint16_t i) { return r->getAnimatedMapName(i); });
+ names("meshNames", r->getMeshCount(), [&](std::uint16_t i) { return r->getMeshName(i); });
+ auto perLod = [&](const char* key, auto get) {
+ std::printf(",\"%s\":[", key);
+ for (std::uint16_t lod = 0; lod < r->getLODCount(); ++lod) {
+ if (lod) std::putchar(',');
+ printArray(get(lod));
+ }
+ std::printf("]");
+ };
+ perLod("jointsPerLod", [&](std::uint16_t l) { return r->getJointIndicesForLOD(l); });
+ perLod("blendShapesPerLod", [&](std::uint16_t l) { return r->getBlendShapeChannelIndicesForLOD(l); });
+ perLod("animatedMapsPerLod", [&](std::uint16_t l) { return r->getAnimatedMapIndicesForLOD(l); });
+ perLod("meshesPerLod", [&](std::uint16_t l) { return r->getMeshIndicesForLOD(l); });
+ std::printf(",\"meshBlendShapeChannelMapping\":[");
+ for (std::uint16_t i = 0; i < r->getMeshBlendShapeChannelMappingCount(); ++i) {
+ const auto m = r->getMeshBlendShapeChannelMapping(i);
+ std::printf("%s[%u,%u]", i ? "," : "", m.meshIndex, m.blendShapeChannelIndex);
+ }
+ std::printf("],\"parents\":[");
+ for (std::uint16_t i = 0; i < r->getJointCount(); ++i) std::printf("%s%u", i ? "," : "", r->getJointParentIndex(i));
+ std::printf("]");
+ std::printf(",\"neutralTranslations\":[");
+ printArray(r->getNeutralJointTranslationXs());
+ std::putchar(',');
+ printArray(r->getNeutralJointTranslationYs());
+ std::putchar(',');
+ printArray(r->getNeutralJointTranslationZs());
+ std::printf("],\"neutralRotations\":[");
+ printArray(r->getNeutralJointRotationXs());
+ std::putchar(',');
+ printArray(r->getNeutralJointRotationYs());
+ std::putchar(',');
+ printArray(r->getNeutralJointRotationZs());
+ std::printf("]");
+
+ auto arr = [&](const char* key, auto view) {
+ std::printf(",\"%s\":", key);
+ printArray(view);
+ };
+ arr("guiToRawInput", r->getGUIToRawInputIndices());
+ arr("guiToRawOutput", r->getGUIToRawOutputIndices());
+ arr("guiToRawFrom", r->getGUIToRawFromValues());
+ arr("guiToRawTo", r->getGUIToRawToValues());
+ arr("guiToRawSlope", r->getGUIToRawSlopeValues());
+ arr("guiToRawCut", r->getGUIToRawCutValues());
+ std::printf(",\"psdCount\":%u", r->getPSDCount());
+ arr("psdRows", r->getPSDRowIndices());
+ arr("psdColumns", r->getPSDColumnIndices());
+ arr("psdValues", r->getPSDValues());
+ std::printf(",\"jointRowCount\":%u,\"jointColumnCount\":%u,\"jointGroups\":[", r->getJointRowCount(), r->getJointColumnCount());
+ for (std::uint16_t g = 0; g < r->getJointGroupCount(); ++g) {
+ std::printf("%s{\"lods\":", g ? "," : "");
+ printArray(r->getJointGroupLODs(g));
+ std::printf(",\"inputs\":");
+ printArray(r->getJointGroupInputIndices(g));
+ std::printf(",\"outputs\":");
+ printArray(r->getJointGroupOutputIndices(g));
+ std::printf(",\"values\":");
+ printArray(r->getJointGroupValues(g));
+ std::printf(",\"joints\":");
+ printArray(r->getJointGroupJointIndices(g));
+ std::printf("}");
+ }
+ std::printf("]");
+ arr("blendShapeLods", r->getBlendShapeChannelLODs());
+ arr("blendShapeInputs", r->getBlendShapeChannelInputIndices());
+ arr("blendShapeOutputs", r->getBlendShapeChannelOutputIndices());
+ arr("animatedMapLods", r->getAnimatedMapLODs());
+ arr("animatedMapInputs", r->getAnimatedMapInputIndices());
+ arr("animatedMapOutputs", r->getAnimatedMapOutputIndices());
+ arr("animatedMapFrom", r->getAnimatedMapFromValues());
+ arr("animatedMapTo", r->getAnimatedMapToValues());
+ arr("animatedMapSlope", r->getAnimatedMapSlopeValues());
+ arr("animatedMapCut", r->getAnimatedMapCutValues());
+
+ std::printf(",\"mlControlCount\":%u,\"rbfSolversPerLod\":[", r->getMLControlCount());
+ for (std::uint16_t lod = 0; lod < r->getLODCount(); ++lod) {
+ if (lod) std::putchar(',');
+ printArray(r->getRBFSolverIndicesForLOD(lod));
+ }
+ std::printf("],\"rbfSolvers\":[");
+ for (std::uint16_t i = 0; i < r->getRBFSolverCount(); ++i) {
+ std::printf("%s{\"name\":", i ? "," : "");
+ printString(r->getRBFSolverName(i));
+ std::printf(",\"rawControlIndices\":");
+ printArray(r->getRBFSolverRawControlIndices(i));
+ std::printf(",\"poseIndices\":");
+ printArray(r->getRBFSolverPoseIndices(i));
+ std::printf(",\"rawControlValues\":");
+ printArray(r->getRBFSolverRawControlValues(i));
+ std::printf(",\"radius\":%.9g,\"weightThreshold\":%.9g,\"solverType\":%d,\"automaticRadius\":%d,\"distanceMethod\":%d,"
+ "\"normalizeMethod\":%d,\"functionType\":%d,\"twistAxis\":%d}",
+ static_cast<double>(r->getRBFSolverRadius(i)), static_cast<double>(r->getRBFSolverWeightThreshold(i)),
+ static_cast<int>(r->getRBFSolverType(i)), static_cast<int>(r->getRBFSolverAutomaticRadius(i)),
+ static_cast<int>(r->getRBFSolverDistanceMethod(i)), static_cast<int>(r->getRBFSolverNormalizeMethod(i)),
+ static_cast<int>(r->getRBFSolverFunctionType(i)), static_cast<int>(r->getRBFSolverTwistAxis(i)));
+ }
+ std::printf("],\"rbfPoses\":[");
+ for (std::uint16_t i = 0; i < r->getRBFPoseCount(); ++i) {
+ std::printf("%s{\"name\":", i ? "," : "");
+ printString(r->getRBFPoseName(i));
+ std::printf(",\"scale\":%.9g,\"inputs\":", static_cast<double>(r->getRBFPoseScale(i)));
+ printArray(r->getRBFPoseInputControlIndices(i));
+ std::printf(",\"outputs\":");
+ printArray(r->getRBFPoseOutputControlIndices(i));
+ std::printf(",\"weights\":");
+ printArray(r->getRBFPoseOutputControlWeights(i));
+ std::printf("}");
+ }
+ std::printf("]");
+ names("rbfPoseControlNames", r->getRBFPoseControlCount(), [&](std::uint16_t i) { return r->getRBFPoseControlName(i); });
+ auto setups = [&](const char* key, std::uint16_t count, auto axis, auto inputs, auto outputs, auto weights) {
+ std::printf(",\"%s\":[", key);
+ for (std::uint16_t i = 0; i < count; ++i) {
+ std::printf("%s{\"twistAxis\":%d,\"inputs\":", i ? "," : "", static_cast<int>(axis(i)));
+ printArray(inputs(i));
+ std::printf(",\"outputs\":");
+ printArray(outputs(i));
+ std::printf(",\"weights\":");
+ printArray(weights(i));
+ std::printf("}");
+ }
+ std::printf("]");
+ };
+ setups(
+ "twists", r->getTwistCount(), [&](std::uint16_t i) { return r->getTwistSetupTwistAxis(i); },
+ [&](std::uint16_t i) { return r->getTwistInputControlIndices(i); }, [&](std::uint16_t i) { return r->getTwistOutputJointIndices(i); },
+ [&](std::uint16_t i) { return r->getTwistBlendWeights(i); });
+ setups(
+ "swings", r->getSwingCount(), [&](std::uint16_t i) { return r->getSwingSetupTwistAxis(i); },
+ [&](std::uint16_t i) { return r->getSwingInputControlIndices(i); }, [&](std::uint16_t i) { return r->getSwingOutputJointIndices(i); },
+ [&](std::uint16_t i) { return r->getSwingBlendWeights(i); });
+ std::printf(",\"rotationRepresentations\":[");
+ for (std::uint16_t i = 0; i < r->getJointCount(); ++i)
+ std::printf("%s%d", i ? "," : "", static_cast<int>(r->getJointRotationRepresentation(i)));
+ std::printf("]");
+
+ std::printf(",\"meshes\":[");
+ for (std::uint16_t m = 0; m < r->getMeshCount(); ++m) {
+ std::printf("%s{\"positions\":[", m ? "," : "");
+ printArray(r->getVertexPositionXs(m));
+ std::putchar(',');
+ printArray(r->getVertexPositionYs(m));
+ std::putchar(',');
+ printArray(r->getVertexPositionZs(m));
+ std::printf("],\"uvs\":[");
+ printArray(r->getVertexTextureCoordinateUs(m));
+ std::putchar(',');
+ printArray(r->getVertexTextureCoordinateVs(m));
+ std::printf("],\"normals\":[");
+ printArray(r->getVertexNormalXs(m));
+ std::putchar(',');
+ printArray(r->getVertexNormalYs(m));
+ std::putchar(',');
+ printArray(r->getVertexNormalZs(m));
+ std::printf("],\"layouts\":[");
+ printArray(r->getVertexLayoutPositionIndices(m));
+ std::putchar(',');
+ printArray(r->getVertexLayoutTextureCoordinateIndices(m));
+ std::putchar(',');
+ printArray(r->getVertexLayoutNormalIndices(m));
+ std::printf("],\"faces\":[");
+ for (std::uint32_t f = 0; f < r->getFaceCount(m); ++f) {
+ if (f) std::putchar(',');
+ printArray(r->getFaceVertexLayoutIndices(m, f));
+ }
+ std::printf("],\"maxInfluence\":%u,\"skin\":[", r->getMaximumInfluencePerVertex(m));
+ for (std::uint32_t v = 0; v < r->getSkinWeightsCount(m); ++v) {
+ std::printf("%s[", v ? "," : "");
+ printArray(r->getSkinWeightsValues(m, v));
+ std::putchar(',');
+ printArray(r->getSkinWeightsJointIndices(m, v));
+ std::printf("]");
+ }
+ std::printf("],\"targets\":[");
+ for (std::uint16_t t = 0; t < r->getBlendShapeTargetCount(m); ++t) {
+ std::printf("%s{\"channel\":%u,\"deltas\":[", t ? "," : "", r->getBlendShapeChannelIndex(m, t));
+ printArray(r->getBlendShapeTargetDeltaXs(m, t));
+ std::putchar(',');
+ printArray(r->getBlendShapeTargetDeltaYs(m, t));
+ std::putchar(',');
+ printArray(r->getBlendShapeTargetDeltaZs(m, t));
+ std::printf("],\"vertices\":");
+ printArray(r->getBlendShapeTargetVertexIndices(m, t));
+ std::printf("}");
+ }
+ std::printf("]}");
+ }
+ std::printf("]}\n");
+}
+
+// Seeded random controls in 0 … 1.2 (past the top, to exercise clamping).
+static float nextRandom(std::uint32_t& state) {
+ state = state * 1664525u + 1013904223u;
+ return static_cast<float>(state >> 8) / static_cast<float>(1u << 24) * 1.2f;
+}
+
+static void evalDna(const char* path, std::uint32_t seed, int count) {
+ auto stream = pma::makeScoped<trio::FileStream>(path, trio::FileStream::AccessMode::Read, trio::FileStream::OpenMode::Binary);
+ auto reader = pma::makeScoped<BinaryStreamReader>(stream.get(), DataLayer::All);
+ reader->read();
+ if (!Status::isOk()) {
+ std::fprintf(stderr, "read failed: %s\n", Status::get().message);
+ std::exit(1);
+ }
+ rl4::Configuration config;
+ config.calculationType = rl4::CalculationType::Scalar;
+ config.floatingPointType = rl4::FloatingPointType::Float;
+ auto rig = pma::makeScoped<rl4::RigLogic>(reader.get(), config);
+ auto instance = pma::makeScoped<rl4::RigInstance>(rig.get());
+ std::uint32_t state = seed;
+ std::printf("[");
+ for (int n = 0; n < count; ++n) {
+ const bool gui = (n % 2) == 0;
+ const std::uint16_t lod = static_cast<std::uint16_t>(n % reader->getLODCount());
+ instance->setLOD(lod);
+ std::vector<float> controls;
+ const std::uint16_t controlCount = gui ? instance->getGUIControlCount() : instance->getRawControlCount();
+ for (std::uint16_t i = 0; i < controlCount; ++i) controls.push_back(nextRandom(state));
+ // Joint rotations come in as unit quaternions, set after any GUI
+ // mapping (which writes every raw control), as a host does.
+ std::vector<float> quats;
+ const bool body = instance->getRawControlCount() >= 11;
+ if (body) {
+ for (int q = 0; q < 2; ++q) {
+ float v[4];
+ float len = 0.0f;
+ for (float& c : v) {
+ c = nextRandom(state) - 0.6f;
+ len += c * c;
+ }
+ len = std::sqrt(len);
+ for (float c : v) quats.push_back(c / len);
+ }
+ }
+ if (gui) {
+ for (std::uint16_t i = 0; i < controlCount; ++i) instance->setGUIControl(i, controls[i]);
+ rig->mapGUIToRawControls(instance.get());
+ } else {
+ for (std::uint16_t i = 0; i < controlCount; ++i) instance->setRawControl(i, controls[i]);
+ }
+ for (std::size_t k = 0; k < quats.size(); ++k) instance->setRawControl(static_cast<std::uint16_t>(3 + k), quats[k]);
+ rig->calculate(instance.get());
+ std::printf("%s{\"lod\":%u,\"%s\":", n ? "," : "", lod, gui ? "gui" : "raw");
+ printArray(controls);
+ std::printf(",\"quats\":");
+ printArray(quats);
+ std::printf(",\"rawControls\":");
+ printArray(instance->getRawControlValues());
+ std::printf(",\"psdControls\":");
+ printArray(instance->getPSDControlValues());
+ std::printf(",\"rbfControls\":");
+ printArray(instance->getRBFControlValues());
+ std::printf(",\"joints\":");
+ printArray(instance->getJointOutputs());
+ std::printf(",\"blendShapes\":");
+ printArray(instance->getBlendShapeOutputs());
+ std::printf(",\"animatedMaps\":");
+ printArray(instance->getAnimatedMapOutputs());
+ std::printf("}");
+ }
+ std::printf("]\n");
+}
+
+int main(int argc, char** argv) {
+ if (argc == 3 && std::strcmp(argv[1], "write") == 0) writeDna(argv[2]);
+ else if (argc == 3 && std::strcmp(argv[1], "dump") == 0) dumpDna(argv[2]);
+ else if (argc == 5 && std::strcmp(argv[1], "eval") == 0)
+ evalDna(argv[2], static_cast<std::uint32_t>(std::strtoul(argv[3], nullptr, 10)), std::atoi(argv[4]));
+ else {
+ std::fprintf(stderr, "usage: oracle write <out.dna> | oracle dump <in.dna>\n");
+ return 2;
+ }
+ return 0;
+}
diff --git a/packages/dna/fixtures/oracle.dna b/packages/dna/fixtures/oracle.dna
new file mode 100644
index 00000000..15f30d06
Binary files /dev/null and b/packages/dna/fixtures/oracle.dna differ
diff --git a/packages/dna/fixtures/oracle.json b/packages/dna/fixtures/oracle.json
new file mode 100644
index 00000000..2f2a5480
--- /dev/null
+++ b/packages/dna/fixtures/oracle.json
@@ -0,0 +1,386 @@
+{
+ "version": [2, 8],
+ "name": "Oracle",
+ "archetype": 5,
+ "gender": 1,
+ "age": 42,
+ "metadata": [["made by", "oracle"], ["purpose", "parity"]],
+ "translationUnit": 0,
+ "rotationUnit": 0,
+ "coordinateSystem": [1, 2, 4],
+ "rotationSequence": 5,
+ "rotationSign": [1, -1, 1],
+ "faceWindingOrder": 0,
+ "lodCount": 2,
+ "maxLOD": 0,
+ "complexity": "Oracle",
+ "dbName": "OracleDB",
+ "guiControlNames": ["CTRL_jaw", "CTRL_smile"],
+ "rawControlNames": [
+ "jawOpen",
+ "smileL",
+ "smileR",
+ "arm.qx",
+ "arm.qy",
+ "arm.qz",
+ "arm.qw",
+ "forearm.qx",
+ "forearm.qy",
+ "forearm.qz",
+ "forearm.qw"
+ ],
+ "jointNames": ["root", "neck", "head", "jaw", "eyeL"],
+ "blendShapeChannelNames": ["jawOpen", "smile_corrective"],
+ "animatedMapNames": ["head_wm1_forehead", "head_wm2_cheek"],
+ "meshNames": ["head_lod0_mesh", "head_lod1_mesh"],
+ "jointsPerLod": [[0, 1, 2, 3, 4], [0, 1, 2]],
+ "blendShapesPerLod": [[0, 1], [0]],
+ "animatedMapsPerLod": [[0, 1], [0, 1]],
+ "meshesPerLod": [[0], [1]],
+ "meshBlendShapeChannelMapping": [[0, 0], [0, 1], [1, 0]],
+ "parents": [0, 0, 1, 2, 2],
+ "neutralTranslations": [
+ [0, 0, 0, 0, 3.20000005],
+ [0, 150, 12.5, -3, 4],
+ [0, -2, 1, 4.5, 8]
+ ],
+ "neutralRotations": [
+ [0, -10, 12, 0, 1.5],
+ [0, 0, 5, 90, -2.5],
+ [0, 0, -3, 25, 3.5]
+ ],
+ "guiToRawInput": [0, 1, 1, 1],
+ "guiToRawOutput": [0, 1, 1, 2],
+ "guiToRawFrom": [0, 0, 0.400000006, 0],
+ "guiToRawTo": [1, 0.600000024, 1, 1],
+ "guiToRawSlope": [1, 1, -1, 0.5],
+ "guiToRawCut": [0, 0, 1, 0.25],
+ "psdCount": 1,
+ "psdRows": [11, 11],
+ "psdColumns": [1, 2],
+ "psdValues": [1.5, 1],
+ "jointRowCount": 45,
+ "jointColumnCount": 4,
+ "jointGroups": [
+ {
+ "lods": [4, 2],
+ "inputs": [0, 11],
+ "outputs": [33, 34, 35, 29],
+ "values": [-0.5, 0, 12, 0, 0, 0.100000001, 0.75, -0.25],
+ "joints": [3]
+ },
+ {
+ "lods": [3, 1],
+ "inputs": [1, 2, 11],
+ "outputs": [12, 13, 9],
+ "values": [20, -5, 3, 0, 7.5, -2, 0.5, 0.5, 0],
+ "joints": [1]
+ },
+ {
+ "lods": [2, 1],
+ "inputs": [12, 13, 14, 15],
+ "outputs": [36, 37],
+ "values": [2, -1, 0.5, 3, 0, 1.5, -2.5, 0.25],
+ "joints": [4]
+ }
+ ],
+ "blendShapeLods": [2, 1],
+ "blendShapeInputs": [0, 11],
+ "blendShapeOutputs": [0, 1],
+ "animatedMapLods": [3, 2],
+ "animatedMapInputs": [0, 1, 1],
+ "animatedMapOutputs": [0, 1, 1],
+ "animatedMapFrom": [0, 0, 0.5],
+ "animatedMapTo": [1, 0.699999988, 1],
+ "animatedMapSlope": [1, 0.800000012, -0.5],
+ "animatedMapCut": [0, 0.100000001, 0.899999976],
+ "mlControlCount": 0,
+ "rbfSolversPerLod": [[0, 1, 2, 3, 4], [0, 2]],
+ "rbfSolvers": [
+ {
+ "name": "arm_rbf",
+ "rawControlIndices": [3, 4, 5, 6],
+ "poseIndices": [0, 1, 2, 6],
+ "rawControlValues": [
+ 0, 0, 0, 1, 0, 0, 0.382683426, 0.923879504, 0, 0.382683426, 0,
+ 0.923879504, 0, 0, 0.5, 0.866025388
+ ],
+ "radius": 50,
+ "weightThreshold": 0.00100000005,
+ "solverType": 1,
+ "automaticRadius": 1,
+ "distanceMethod": 1,
+ "normalizeMethod": 0,
+ "functionType": 0,
+ "twistAxis": 0
+ },
+ {
+ "name": "forearm_twist",
+ "rawControlIndices": [7, 8, 9, 10],
+ "poseIndices": [3, 4, 5, 7],
+ "rawControlValues": [
+ 0, 0, 0, 1, 0.382683426, 0, 0, 0.923879504, 0.707106769, 0, 0,
+ 0.707106769, 0.923879504, 0, 0, 0.382683426
+ ],
+ "radius": 0,
+ "weightThreshold": 0,
+ "solverType": 0,
+ "automaticRadius": 0,
+ "distanceMethod": 3,
+ "normalizeMethod": 1,
+ "functionType": 2,
+ "twistAxis": 0
+ },
+ {
+ "name": "arm_swing",
+ "rawControlIndices": [3, 4, 5, 6],
+ "poseIndices": [8, 9, 10],
+ "rawControlValues": [
+ 0, 0, 0, 1, 0.382683426, 0, 0, 0.923879504, 0, 0.382683426, 0,
+ 0.923879504
+ ],
+ "radius": 60,
+ "weightThreshold": 0,
+ "solverType": 0,
+ "automaticRadius": 1,
+ "distanceMethod": 2,
+ "normalizeMethod": 0,
+ "functionType": 3,
+ "twistAxis": 2
+ },
+ {
+ "name": "smiles",
+ "rawControlIndices": [1, 2],
+ "poseIndices": [11, 12, 13, 14],
+ "rawControlValues": [0, 0, 1, 0, 0, 1, 1, 1],
+ "radius": 0,
+ "weightThreshold": 0.00999999978,
+ "solverType": 1,
+ "automaticRadius": 0,
+ "distanceMethod": 0,
+ "normalizeMethod": 0,
+ "functionType": 4,
+ "twistAxis": 0
+ },
+ {
+ "name": "jaw",
+ "rawControlIndices": [0],
+ "poseIndices": [15, 16],
+ "rawControlValues": [0, 1],
+ "radius": 40,
+ "weightThreshold": 0,
+ "solverType": 0,
+ "automaticRadius": 1,
+ "distanceMethod": 0,
+ "normalizeMethod": 1,
+ "functionType": 1,
+ "twistAxis": 0
+ }
+ ],
+ "rbfPoses": [
+ {
+ "name": "arm_rest",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [],
+ "weights": []
+ },
+ {
+ "name": "arm_up",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [12, 16],
+ "weights": [1, 0.5]
+ },
+ {
+ "name": "arm_forward",
+ "scale": 0.800000012,
+ "inputs": [0],
+ "outputs": [13],
+ "weights": [1]
+ },
+ {
+ "name": "forearm_rest",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [],
+ "weights": []
+ },
+ {
+ "name": "forearm_twist45",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [14],
+ "weights": [1]
+ },
+ {
+ "name": "forearm_twist90",
+ "scale": 1.20000005,
+ "inputs": [],
+ "outputs": [15],
+ "weights": [1]
+ },
+ {
+ "name": "arm_up30",
+ "scale": 0.899999976,
+ "inputs": [],
+ "outputs": [12],
+ "weights": [0.699999988]
+ },
+ {
+ "name": "forearm_twist135",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [15],
+ "weights": [1]
+ },
+ {
+ "name": "swing_rest",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [],
+ "weights": []
+ },
+ {
+ "name": "swing_x",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [16],
+ "weights": [0.300000012]
+ },
+ {
+ "name": "swing_y",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [14],
+ "weights": [0.400000006]
+ },
+ {
+ "name": "smiles_none",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [],
+ "weights": []
+ },
+ {
+ "name": "smiles_left",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [16],
+ "weights": [0.600000024]
+ },
+ {
+ "name": "smiles_right",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [],
+ "weights": []
+ },
+ {
+ "name": "smiles_both",
+ "scale": 1.10000002,
+ "inputs": [],
+ "outputs": [13],
+ "weights": [0.5]
+ },
+ {
+ "name": "jaw_closed",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [],
+ "weights": []
+ },
+ {
+ "name": "jaw_open",
+ "scale": 1,
+ "inputs": [],
+ "outputs": [15],
+ "weights": [0.200000003]
+ }
+ ],
+ "rbfPoseControlNames": [
+ "arm_up_pc",
+ "arm_forward_pc",
+ "forearm_twist45_pc",
+ "forearm_twist90_pc",
+ "arm_up_half_pc"
+ ],
+ "twists": [
+ {
+ "twistAxis": 0,
+ "inputs": [7, 8, 9, 10],
+ "outputs": [3, 4],
+ "weights": [0.5, 0.25]
+ }
+ ],
+ "swings": [
+ {
+ "twistAxis": 1,
+ "inputs": [3, 4, 5, 6],
+ "outputs": [2],
+ "weights": [0.300000012]
+ }
+ ],
+ "rotationRepresentations": [0, 0, 0, 0, 0],
+ "meshes": [
+ {
+ "positions": [
+ [-5, 5, 5, -5, 0],
+ [150, 150, 165, 165, 170],
+ [9, 9, 8, 8, 7.5]
+ ],
+ "uvs": [
+ [0.100000001, 0.899999976, 0.899999976, 0.100000001, 0.5, 0.550000012],
+ [
+ 0.200000003, 0.200000003, 0.800000012, 0.800000012, 0.949999988,
+ 0.949999988
+ ]
+ ],
+ "normals": [[0, 0], [0, 0.600000024], [1, 0.800000012]],
+ "layouts": [[0, 1, 2, 3, 4, 4], [0, 1, 2, 3, 4, 5], [0, 0, 0, 0, 1, 1]],
+ "faces": [[0, 1, 2, 3], [3, 2, 4]],
+ "maxInfluence": 6,
+ "skin": [
+ [[1], [1]],
+ [[0.5, 0.5], [1, 2]],
+ [
+ [
+ 0.300000012, 0.200000003, 0.150000006, 0.150000006, 0.100000001,
+ 0.100000001
+ ],
+ [2, 3, 4, 1, 0, 3]
+ ],
+ [[1], [1]],
+ [[0.5, 0.5], [1, 2]]
+ ],
+ "targets": [
+ {
+ "channel": 0,
+ "deltas": [[0, 0], [-1.5, -1.5], [0.200000003, 0.200000003]],
+ "vertices": [0, 1]
+ },
+ {
+ "channel": 1,
+ "deltas": [[0.300000012], [0.400000006], [-0.100000001]],
+ "vertices": [2]
+ }
+ ]
+ },
+ {
+ "positions": [[-5, 5, 0], [150, 150, 170], [9, 9, 7.5]],
+ "uvs": [[0, 1, 0.5], [0, 0, 1]],
+ "normals": [[0], [0], [1]],
+ "layouts": [[0, 1, 2], [0, 1, 2], [0, 0, 0]],
+ "faces": [[0, 1, 2]],
+ "maxInfluence": 1,
+ "skin": [[[1], [1]], [[1], [1]], [[1], [1]]],
+ "targets": [
+ {
+ "channel": 0,
+ "deltas": [[0], [-1], [0]],
+ "vertices": [0]
+ }
+ ]
+ }
+ ]
+}
diff --git a/packages/dna/fixtures/v21.dna b/packages/dna/fixtures/v21.dna
new file mode 100644
index 00000000..32398e72
Binary files /dev/null and b/packages/dna/fixtures/v21.dna differ
diff --git a/packages/dna/fixtures/v21.json b/packages/dna/fixtures/v21.json
new file mode 100644
index 00000000..c1b2e967
--- /dev/null
+++ b/packages/dna/fixtures/v21.json
@@ -0,0 +1,166 @@
+{
+ "version": [2, 1],
+ "name": "Oracle",
+ "archetype": 5,
+ "gender": 1,
+ "age": 42,
+ "metadata": [["made by", "oracle"], ["purpose", "parity"]],
+ "translationUnit": 0,
+ "rotationUnit": 0,
+ "coordinateSystem": [1, 2, 4],
+ "rotationSequence": 0,
+ "rotationSign": [1, 1, 1],
+ "faceWindingOrder": 0,
+ "lodCount": 2,
+ "maxLOD": 0,
+ "complexity": "Oracle",
+ "dbName": "OracleDB",
+ "guiControlNames": ["CTRL_jaw", "CTRL_smile"],
+ "rawControlNames": [
+ "jawOpen",
+ "smileL",
+ "smileR",
+ "arm.qx",
+ "arm.qy",
+ "arm.qz",
+ "arm.qw",
+ "forearm.qx",
+ "forearm.qy",
+ "forearm.qz",
+ "forearm.qw"
+ ],
+ "jointNames": ["root", "neck", "head", "jaw", "eyeL"],
+ "blendShapeChannelNames": ["jawOpen", "smile_corrective"],
+ "animatedMapNames": ["head_wm1_forehead", "head_wm2_cheek"],
+ "meshNames": ["head_lod0_mesh", "head_lod1_mesh"],
+ "jointsPerLod": [[0, 1, 2, 3, 4], [0, 1, 2]],
+ "blendShapesPerLod": [[0, 1], [0]],
+ "animatedMapsPerLod": [[0, 1], [0, 1]],
+ "meshesPerLod": [[0], [1]],
+ "meshBlendShapeChannelMapping": [[0, 0], [0, 1], [1, 0]],
+ "parents": [0, 0, 1, 2, 2],
+ "neutralTranslations": [
+ [0, 0, 0, 0, 3.20000005],
+ [0, 150, 12.5, -3, 4],
+ [0, -2, 1, 4.5, 8]
+ ],
+ "neutralRotations": [
+ [0, -10, 12, 0, 1.5],
+ [0, 0, 5, 90, -2.5],
+ [0, 0, -3, 25, 3.5]
+ ],
+ "guiToRawInput": [0, 1, 1, 1],
+ "guiToRawOutput": [0, 1, 1, 2],
+ "guiToRawFrom": [0, 0, 0.400000006, 0],
+ "guiToRawTo": [1, 0.600000024, 1, 1],
+ "guiToRawSlope": [1, 1, -1, 0.5],
+ "guiToRawCut": [0, 0, 1, 0.25],
+ "psdCount": 1,
+ "psdRows": [11, 11],
+ "psdColumns": [1, 2],
+ "psdValues": [1.5, 1],
+ "jointRowCount": 45,
+ "jointColumnCount": 4,
+ "jointGroups": [
+ {
+ "lods": [4, 2],
+ "inputs": [0, 11],
+ "outputs": [33, 34, 35, 29],
+ "values": [-0.5, 0, 12, 0, 0, 0.100000001, 0.75, -0.25],
+ "joints": [3]
+ },
+ {
+ "lods": [3, 1],
+ "inputs": [1, 2, 11],
+ "outputs": [12, 13, 9],
+ "values": [20, -5, 3, 0, 7.5, -2, 0.5, 0.5, 0],
+ "joints": [1]
+ },
+ {
+ "lods": [2, 1],
+ "inputs": [12, 13, 14, 15],
+ "outputs": [36, 37],
+ "values": [2, -1, 0.5, 3, 0, 1.5, -2.5, 0.25],
+ "joints": [4]
+ }
+ ],
+ "blendShapeLods": [2, 1],
+ "blendShapeInputs": [0, 11],
+ "blendShapeOutputs": [0, 1],
+ "animatedMapLods": [3, 2],
+ "animatedMapInputs": [0, 1, 1],
+ "animatedMapOutputs": [0, 1, 1],
+ "animatedMapFrom": [0, 0, 0.5],
+ "animatedMapTo": [1, 0.699999988, 1],
+ "animatedMapSlope": [1, 0.800000012, -0.5],
+ "animatedMapCut": [0, 0.100000001, 0.899999976],
+ "mlControlCount": 0,
+ "rbfSolversPerLod": [[], []],
+ "rbfSolvers": [],
+ "rbfPoses": [],
+ "rbfPoseControlNames": [],
+ "twists": [],
+ "swings": [],
+ "rotationRepresentations": [0, 0, 0, 0, 0],
+ "meshes": [
+ {
+ "positions": [
+ [-5, 5, 5, -5, 0],
+ [150, 150, 165, 165, 170],
+ [9, 9, 8, 8, 7.5]
+ ],
+ "uvs": [
+ [0.100000001, 0.899999976, 0.899999976, 0.100000001, 0.5, 0.550000012],
+ [
+ 0.200000003, 0.200000003, 0.800000012, 0.800000012, 0.949999988,
+ 0.949999988
+ ]
+ ],
+ "normals": [[0, 0], [0, 0.600000024], [1, 0.800000012]],
+ "layouts": [[0, 1, 2, 3, 4, 4], [0, 1, 2, 3, 4, 5], [0, 0, 0, 0, 1, 1]],
+ "faces": [[0, 1, 2, 3], [3, 2, 4]],
+ "maxInfluence": 6,
+ "skin": [
+ [[1], [1]],
+ [[0.5, 0.5], [1, 2]],
+ [
+ [
+ 0.300000012, 0.200000003, 0.150000006, 0.150000006, 0.100000001,
+ 0.100000001
+ ],
+ [2, 3, 4, 1, 0, 3]
+ ],
+ [[1], [1]],
+ [[0.5, 0.5], [1, 2]]
+ ],
+ "targets": [
+ {
+ "channel": 0,
+ "deltas": [[0, 0], [-1.5, -1.5], [0.200000003, 0.200000003]],
+ "vertices": [0, 1]
+ },
+ {
+ "channel": 1,
+ "deltas": [[0.300000012], [0.400000006], [-0.100000001]],
+ "vertices": [2]
+ }
+ ]
+ },
+ {
+ "positions": [[-5, 5, 0], [150, 150, 170], [9, 9, 7.5]],
+ "uvs": [[0, 1, 0.5], [0, 0, 1]],
+ "normals": [[0], [0], [1]],
+ "layouts": [[0, 1, 2], [0, 1, 2], [0, 0, 0]],
+ "faces": [[0, 1, 2]],
+ "maxInfluence": 1,
+ "skin": [[[1], [1]], [[1], [1]], [[1], [1]]],
+ "targets": [
+ {
+ "channel": 0,
+ "deltas": [[0], [-1], [0]],
+ "vertices": [0]
+ }
+ ]
+ }
+ ]
+}
diff --git a/packages/dna/package.json b/packages/dna/package.json
new file mode 100644
index 00000000..4d9c0a31
--- /dev/null
+++ b/packages/dna/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "@framefields/dna",
+ "version": "2.14.0",
+ "private": true,
+ "description": "Read DNA character files (MetaHuman-compatible rigs: joints, meshes, skin weights, blend shapes, rig behavior) and turn them into GLB characters.",
+ "type": "module",
+ "sideEffects": false,
+ "license": "Apache-2.0",
+ "module": "./dist/index.mjs",
+ "types": "./dist/index.d.mts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.mts",
+ "development": "./src/index.ts",
+ "import": "./dist/index.mjs",
+ "default": "./dist/index.mjs"
+ }
+ },
+ "files": [
+ "dist/**"
+ ],
+ "scripts": {
+ "build": "tsdown",
+ "dev": "tsdown --watch",
+ "typecheck": "tsc --noEmit -p .",
+ "test": "vitest run",
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
+ },
+ "dependencies": {
+ "@framefields/forge": "workspace:*"
+ },
+ "devDependencies": {
+ "@framefields/tsconfig": "workspace:*",
+ "@framefields/webgpu-renderers": "workspace:*",
+ "@types/node": "^24.1.0",
+ "gltf-validator": "2.0.0-dev.3.10",
+ "tsdown": "^0.19.0",
+ "typescript": "^5.8.3",
+ "vitest": "^4.1.5"
+ }
+}
diff --git a/packages/dna/src/bytes.ts b/packages/dna/src/bytes.ts
new file mode 100644
index 00000000..d6d351f9
--- /dev/null
+++ b/packages/dna/src/bytes.ts
@@ -0,0 +1,102 @@
+/**
+ * Reads the binary archives DNA files are written in: big-endian numbers,
+ * and arrays and strings prefixed with a 32-bit element count.
+ *
+ * Based on OpenRigLogic's `terse` binary input archive (MIT, Epic Games).
+ */
+export class ByteReader {
+ private readonly view: DataView;
+ private at = 0;
+
+ constructor(private readonly bytes: Uint8Array) {
+ this.view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
+ }
+
+ get offset(): number {
+ return this.at;
+ }
+
+ get length(): number {
+ return this.bytes.byteLength;
+ }
+
+ seek(offset: number): void {
+ if (offset < 0 || offset > this.bytes.byteLength)
+ throw new Error(
+ `dna: seek to ${offset} is outside the file (${this.bytes.byteLength} bytes)`,
+ );
+ this.at = offset;
+ }
+
+ private need(n: number): number {
+ const start = this.at;
+ if (start + n > this.bytes.byteLength)
+ throw new Error(
+ `dna: the file ends at ${this.bytes.byteLength} bytes; ${n} more needed at ${start}`,
+ );
+ this.at += n;
+ return start;
+ }
+
+ u8(): number {
+ return this.view.getUint8(this.need(1));
+ }
+
+ u16(): number {
+ return this.view.getUint16(this.need(2));
+ }
+
+ u32(): number {
+ return this.view.getUint32(this.need(4));
+ }
+
+ i32(): number {
+ return this.view.getInt32(this.need(4));
+ }
+
+ f32(): number {
+ return this.view.getFloat32(this.need(4));
+ }
+
+ chars(n: number): string {
+ const start = this.need(n);
+ return new TextDecoder().decode(this.bytes.subarray(start, start + n));
+ }
+
+ /** A counted string. */
+ string(): string {
+ return this.chars(this.u32());
+ }
+
+ u16s(): Uint16Array {
+ const n = this.u32();
+ const start = this.need(n * 2);
+ const out = new Uint16Array(n);
+ for (let i = 0; i < n; i++) out[i] = this.view.getUint16(start + i * 2);
+ return out;
+ }
+
+ u32s(): Uint32Array {
+ const n = this.u32();
+ const start = this.need(n * 4);
+ const out = new Uint32Array(n);
+ for (let i = 0; i < n; i++) out[i] = this.view.getUint32(start + i * 4);
+ return out;
+ }
+
+ f32s(): Float32Array {
+ const n = this.u32();
+ const start = this.need(n * 4);
+ const out = new Float32Array(n);
+ for (let i = 0; i < n; i++) out[i] = this.view.getFloat32(start + i * 4);
+ return out;
+ }
+
+ /** A counted list of anything. */
+ list<T>(item: (r: ByteReader) => T): T[] {
+ const n = this.u32();
+ const out: T[] = [];
+ for (let i = 0; i < n; i++) out.push(item(this));
+ return out;
+ }
+}
diff --git a/packages/dna/src/dna-oracle.test.ts b/packages/dna/src/dna-oracle.test.ts
new file mode 100644
index 00000000..074c6700
--- /dev/null
+++ b/packages/dna/src/dna-oracle.test.ts
@@ -0,0 +1,267 @@
+/**
+ * Parity with Epic's own DNA library. `fixtures/oracle.dna` was written by
+ * OpenRigLogic 5.8's DNA writer (made-up data, see `fixtures/oracle.cpp`);
+ * `fixtures/v21.dna` is the same character in the 2.1 layout. Each `.json`
+ * is what Epic's reader reads from its file. `readDna` must read the same:
+ * every field, every LOD view, every mesh.
+ */
+import { readFileSync } from "node:fs";
+import { describe, expect, it } from "vitest";
+import { dnaToGlb, readDna } from "./index.js";
+
+const fixture = (name: string) => ({
+ name,
+ bytes: new Uint8Array(
+ readFileSync(new URL(`../fixtures/${name}.dna`, import.meta.url)),
+ ),
+ oracle: JSON.parse(
+ readFileSync(new URL(`../fixtures/${name}.json`, import.meta.url), "utf8"),
+ ),
+});
+
+const AXES = ["left", "right", "up", "down", "front", "back"];
+const SEQUENCES = ["xyz", "xzy", "yxz", "yzx", "zxy", "zyx"];
+const list = (a: ArrayLike<number>) => Array.from(a);
+/** Float32 values as the oracle printed them (9 significant digits). */
+const f = (a: ArrayLike<number>) =>
+ Array.from(a, (x) => Number(x.toPrecision(9)));
+
+describe.each([
+ fixture("oracle"),
+ fixture("v21"),
+])("readDna against OpenRigLogic ($name)", ({ bytes, oracle }) => {
+ const dna = readDna(bytes);
+ const d = dna.descriptor;
+ const def = dna.definition;
+ const b = dna.behavior!;
+
+ it("reads the descriptor", () => {
+ expect([dna.version.generation, dna.version.version]).toEqual(
+ oracle.version,
+ );
+ expect({
+ name: d.name,
+ archetype: d.archetype,
+ gender: d.gender,
+ age: d.age,
+ metadata: d.metadata,
+ translationUnit: d.translationUnit === "m" ? 1 : 0,
+ rotationUnit: d.rotationUnit === "radians" ? 1 : 0,
+ coordinateSystem: d.coordinateSystem.map((a) => AXES.indexOf(a)),
+ rotationSequence: SEQUENCES.indexOf(d.rotationSequence),
+ rotationSign: d.rotationSign,
+ faceWindingOrder: d.faceWindingOrder === "cw" ? 1 : 0,
+ lodCount: d.lodCount,
+ maxLOD: d.maxLOD,
+ complexity: d.complexity,
+ dbName: d.dbName,
+ }).toEqual({
+ name: oracle.name,
+ archetype: oracle.archetype,
+ gender: oracle.gender,
+ age: oracle.age,
+ metadata: oracle.metadata,
+ translationUnit: oracle.translationUnit,
+ rotationUnit: oracle.rotationUnit,
+ coordinateSystem: oracle.coordinateSystem,
+ rotationSequence: oracle.rotationSequence,
+ rotationSign: oracle.rotationSign,
+ faceWindingOrder: oracle.faceWindingOrder,
+ lodCount: oracle.lodCount,
+ maxLOD: oracle.maxLOD,
+ complexity: oracle.complexity,
+ dbName: oracle.dbName,
+ });
+ });
+
+ it("reads the definition, with each LOD's elements", () => {
+ for (const key of [
+ "guiControlNames",
+ "rawControlNames",
+ "jointNames",
+ "blendShapeChannelNames",
+ "animatedMapNames",
+ "meshNames",
+ ] as const)
+ expect(def[key]).toEqual(oracle[key]);
+ const perLod = (m: { lods: Uint16Array; indices: Uint16Array[] }) =>
+ Array.from({ length: d.lodCount }, (_, lod) =>
+ list(m.indices[m.lods[lod] as number] ?? []),
+ );
+ expect(perLod(def.lodJointMapping)).toEqual(oracle.jointsPerLod);
+ expect(perLod(def.lodBlendShapeMapping)).toEqual(oracle.blendShapesPerLod);
+ expect(perLod(def.lodAnimatedMapMapping)).toEqual(
+ oracle.animatedMapsPerLod,
+ );
+ expect(perLod(def.lodMeshMapping)).toEqual(oracle.meshesPerLod);
+ const m = def.meshBlendShapeChannelMapping;
+ expect(list(m.from).map((x, i) => [x, m.to[i]])).toEqual(
+ oracle.meshBlendShapeChannelMapping,
+ );
+ // Epic's reader reports a root as its own parent.
+ expect(list(def.jointHierarchy)).toEqual(oracle.parents);
+ const t = def.neutralJointTranslations;
+ const r = def.neutralJointRotations;
+ expect([f(t.xs), f(t.ys), f(t.zs)]).toEqual(oracle.neutralTranslations);
+ expect([f(r.xs), f(r.ys), f(r.zs)]).toEqual(oracle.neutralRotations);
+ });
+
+ it("reads the rig behavior", () => {
+ const c = b.controls;
+ expect({
+ guiToRawInput: list(c.conditionals.inputIndices),
+ guiToRawOutput: list(c.conditionals.outputIndices),
+ guiToRawFrom: f(c.conditionals.fromValues),
+ guiToRawTo: f(c.conditionals.toValues),
+ guiToRawSlope: f(c.conditionals.slopeValues),
+ guiToRawCut: f(c.conditionals.cutValues),
+ psdCount: c.psdCount,
+ psdRows: list(c.psds.rows),
+ psdColumns: list(c.psds.columns),
+ psdValues: f(c.psds.values),
+ jointRowCount: b.joints.rowCount,
+ jointColumnCount: b.joints.colCount,
+ jointGroups: b.joints.jointGroups.map((g) => ({
+ lods: list(g.lods),
+ inputs: list(g.inputIndices),
+ outputs: list(g.outputIndices),
+ values: f(g.values),
+ joints: list(g.jointIndices),
+ })),
+ blendShapeLods: list(b.blendShapeChannels.lods),
+ blendShapeInputs: list(b.blendShapeChannels.inputIndices),
+ blendShapeOutputs: list(b.blendShapeChannels.outputIndices),
+ animatedMapLods: list(b.animatedMaps.lods),
+ animatedMapInputs: list(b.animatedMaps.conditionals.inputIndices),
+ animatedMapOutputs: list(b.animatedMaps.conditionals.outputIndices),
+ animatedMapFrom: f(b.animatedMaps.conditionals.fromValues),
+ animatedMapTo: f(b.animatedMaps.conditionals.toValues),
+ animatedMapSlope: f(b.animatedMaps.conditionals.slopeValues),
+ animatedMapCut: f(b.animatedMaps.conditionals.cutValues),
+ }).toEqual(
+ Object.fromEntries(
+ [
+ "guiToRawInput",
+ "guiToRawOutput",
+ "guiToRawFrom",
+ "guiToRawTo",
+ "guiToRawSlope",
+ "guiToRawCut",
+ "psdCount",
+ "psdRows",
+ "psdColumns",
+ "psdValues",
+ "jointRowCount",
+ "jointColumnCount",
+ "jointGroups",
+ "blendShapeLods",
+ "blendShapeInputs",
+ "blendShapeOutputs",
+ "animatedMapLods",
+ "animatedMapInputs",
+ "animatedMapOutputs",
+ "animatedMapFrom",
+ "animatedMapTo",
+ "animatedMapSlope",
+ "animatedMapCut",
+ ].map((k) => [k, oracle[k]]),
+ ),
+ );
+ });
+
+ it("reads every mesh", () => {
+ const meshes = dna.geometry!.meshes.map((m) => ({
+ positions: [f(m.positions.xs), f(m.positions.ys), f(m.positions.zs)],
+ uvs: [f(m.uvs.us), f(m.uvs.vs)],
+ normals: [f(m.normals.xs), f(m.normals.ys), f(m.normals.zs)],
+ layouts: [
+ list(m.layouts.positions),
+ list(m.layouts.uvs),
+ list(m.layouts.normals),
+ ],
+ faces: m.faces.map(list),
+ maxInfluence: m.maximumInfluencePerVertex,
+ skin: m.skinWeights.map((s) => [f(s.weights), list(s.jointIndices)]),
+ targets: m.blendShapeTargets.map((t) => ({
+ channel: t.channel,
+ deltas: [f(t.deltas.xs), f(t.deltas.ys), f(t.deltas.zs)],
+ vertices: list(t.vertexIndices),
+ })),
+ }));
+ expect(meshes).toEqual(oracle.meshes);
+ });
+
+ it("reads the RBF, twist/swing and joint metadata layers", () => {
+ const rbf = dna.rbf;
+ const SOLVER = ["additive", "interpolative"];
+ const DISTANCE = ["euclidean", "quaternion", "swingAngle", "twistAngle"];
+ const NORMALIZE = ["onlyAboveOne", "always"];
+ const FUNCTION = ["gaussian", "exponential", "linear", "cubic", "quintic"];
+ const AXIS = ["x", "y", "z"];
+ expect(dna.mlControlNames?.length ?? 0).toBe(oracle.mlControlCount);
+ const perLod = rbf
+ ? Array.from({ length: d.lodCount }, (_, lod) =>
+ list(
+ rbf.lodSolverMapping.indices[
+ rbf.lodSolverMapping.lods[lod] as number
+ ] ?? [],
+ ),
+ )
+ : oracle.rbfSolversPerLod.map(() => []);
+ expect(perLod).toEqual(oracle.rbfSolversPerLod);
+ expect(
+ (rbf?.solvers ?? []).map((x) => ({
+ name: x.name,
+ rawControlIndices: list(x.rawControlIndices),
+ poseIndices: list(x.poseIndices),
+ rawControlValues: f(x.rawControlValues),
+ radius: Number(x.radius.toPrecision(9)),
+ weightThreshold: Number(x.weightThreshold.toPrecision(9)),
+ solverType: SOLVER.indexOf(x.solverType),
+ automaticRadius: x.automaticRadius ? 0 : 1,
+ distanceMethod: DISTANCE.indexOf(x.distanceMethod),
+ normalizeMethod: NORMALIZE.indexOf(x.normalizeMethod),
+ functionType: FUNCTION.indexOf(x.functionType),
+ twistAxis: AXIS.indexOf(x.twistAxis),
+ })),
+ ).toEqual(oracle.rbfSolvers);
+ expect(
+ (rbf?.poses ?? []).map((p, i) => ({
+ name: p.name,
+ scale: Number(p.scale.toPrecision(9)),
+ inputs: list(rbf?.poseControls[i]?.inputControlIndices ?? []),
+ outputs: list(rbf?.poseControls[i]?.outputControlIndices ?? []),
+ weights: f(rbf?.poseControls[i]?.outputControlWeights ?? []),
+ })),
+ ).toEqual(oracle.rbfPoses);
+ expect(rbf?.poseControlNames ?? []).toEqual(oracle.rbfPoseControlNames);
+ const setups = (
+ list_: {
+ twistAxis: string;
+ inputControlIndices: Uint16Array;
+ outputJointIndices: Uint16Array;
+ blendWeights: Float32Array;
+ }[],
+ ) =>
+ list_.map((x) => ({
+ twistAxis: AXIS.indexOf(x.twistAxis),
+ inputs: list(x.inputControlIndices),
+ outputs: list(x.outputJointIndices),
+ weights: f(x.blendWeights),
+ }));
+ expect(setups(dna.twistSwing?.twists ?? [])).toEqual(oracle.twists);
+ expect(setups(dna.twistSwing?.swings ?? [])).toEqual(oracle.swings);
+ const reps =
+ dna.jointRepresentations ??
+ def.jointNames.map(() => ({ rotation: "euler" }));
+ expect(reps.map((r) => (r.rotation === "quaternion" ? 1 : 0))).toEqual(
+ oracle.rotationRepresentations,
+ );
+ });
+
+ it("converts Epic's file to a GLB", () => {
+ // zyx order with a negative y sign, six influences on one vertex, two LODs.
+ for (const lod of [0, 1])
+ expect(dnaToGlb(dna, { lod }).byteLength).toBeGreaterThan(0);
+ });
+});
diff --git a/packages/dna/src/dna.test.ts b/packages/dna/src/dna.test.ts
new file mode 100644
index 00000000..389d5eda
--- /dev/null
+++ b/packages/dna/src/dna.test.ts
@@ -0,0 +1,346 @@
+/**
+ * DNA files read back what was written (versions 2.1 and 2.8, unknown
+ * layers skipped), Euler angles follow OpenRigLogic's convention, and a
+ * character converts to a GLB the Khronos validator accepts and the engine
+ * loader reads: joints at their neutral pose with rest rotations, meshes per
+ * LOD, skin weights capped at four, blend shapes as named morph targets,
+ * mirrored axes handled.
+ */
+import { denseMorphDeltas, parseGLB } from "@framefields/webgpu-renderers";
+import { validateBytes } from "gltf-validator";
+import { describe, expect, it } from "vitest";
+import { dnaToGlb, eulerQuat, readDna, spaceOf } from "./index.js";
+import type { DnaDescriptor } from "./read.js";
+import { type TestDna, writeDna21, writeDna28 } from "./write-dna.test-util.js";
+
+const f32 = (...v: number[]) => Float32Array.from(v);
+const u16 = (...v: number[]) => Uint16Array.from(v);
+const u32 = (...v: number[]) => Uint32Array.from(v);
+const table = () => ({
+ inputIndices: u16(),
+ outputIndices: u16(),
+ fromValues: f32(),
+ toValues: f32(),
+ slopeValues: f32(),
+ cutValues: f32(),
+});
+
+function descriptor(over: Partial<DnaDescriptor> = {}): DnaDescriptor {
+ return {
+ name: "Tester",
+ archetype: 5,
+ gender: 2,
+ age: 30,
+ metadata: [["source", "unit test"]],
+ translationUnit: "cm",
+ rotationUnit: "degrees",
+ coordinateSystem: ["right", "up", "front"],
+ lodCount: 2,
+ maxLOD: 0,
+ complexity: "test",
+ dbName: "none",
+ rotationSequence: "xyz",
+ rotationSign: [1, 1, 1],
+ faceWindingOrder: "ccw",
+ ...over,
+ };
+}
+
+/**
+ * Three joints: a root, an elbow 10 up turned 90° about z (its x now points
+ * up), and a hand 10 along the elbow's x, so at 20 up. One quad facing the
+ * viewer (+z), with a UV seam copy of its first corner, skinned and with a
+ * "jawOpen" shape that pushes that corner forward; a second, empty mesh
+ * belongs to LOD 1 only.
+ */
+function arm(over: Partial<DnaDescriptor> = {}): TestDna {
+ return {
+ descriptor: descriptor(over),
+ definition: {
+ lodJointMapping: { lods: u16(0, 0), indices: [u16(0, 1, 2, 3, 4)] },
+ lodBlendShapeMapping: { lods: u16(0, 0), indices: [u16(0)] },
+ lodAnimatedMapMapping: { lods: u16(0, 0), indices: [u16()] },
+ lodMeshMapping: { lods: u16(0, 1), indices: [u16(0), u16(1)] },
+ guiControlNames: ["CTRL_jaw"],
+ rawControlNames: ["jawOpen"],
+ jointNames: ["root", "elbow", "hand", "thumb", "index"],
+ blendShapeChannelNames: ["jawOpen"],
+ animatedMapNames: [],
+ meshNames: ["quad_lod0", "quad_lod1"],
+ meshBlendShapeChannelMapping: { from: u16(0), to: u16(0) },
+ jointHierarchy: u16(0, 0, 1, 2, 2),
+ neutralJointTranslations: {
+ xs: f32(0, 0, 10, 2, 3),
+ ys: f32(0, 10, 0, 0, 0),
+ zs: f32(0, 0, 0, 1, -1),
+ },
+ neutralJointRotations: {
+ xs: f32(0, 0, 0, 0, 0),
+ ys: f32(0, 0, 0, 0, 0),
+ zs: f32(0, 90, 0, 0, 0),
+ },
+ },
+ behavior: {
+ controls: {
+ psdCount: 0,
+ conditionals: table(),
+ psds: { rows: u16(), columns: u16(), values: f32() },
+ },
+ joints: { rowCount: 0, colCount: 0, jointGroups: [] },
+ blendShapeChannels: {
+ lods: u16(1, 1),
+ inputIndices: u16(0),
+ outputIndices: u16(0),
+ },
+ animatedMaps: { lods: u16(0, 0), conditionals: table() },
+ },
+ meshes: [
+ {
+ positions: {
+ xs: f32(-5, 5, 5, -5),
+ ys: f32(0, 0, 20, 20),
+ zs: f32(0, 0, 0, 0),
+ },
+ uvs: { us: f32(0, 1, 1, 0, 0.5), vs: f32(0, 0, 1, 1, 0) },
+ normals: { xs: f32(0), ys: f32(0), zs: f32(1) },
+ layouts: {
+ positions: u32(0, 1, 2, 3, 0),
+ uvs: u32(0, 1, 2, 3, 4),
+ normals: u32(0, 0, 0, 0, 0),
+ },
+ faces: [u32(0, 1, 2, 3), u32(4, 1, 2)],
+ maximumInfluencePerVertex: 5,
+ skinWeights: [
+ { weights: f32(1), jointIndices: u16(0) },
+ { weights: f32(0.5, 0.5), jointIndices: u16(0, 1) },
+ {
+ weights: f32(0.4, 0.3, 0.1, 0.1, 0.05, 0.05),
+ jointIndices: u16(2, 1, 0, 3, 4, 0),
+ },
+ { weights: f32(1), jointIndices: u16(2) },
+ ],
+ blendShapeTargets: [
+ {
+ deltas: { xs: f32(0), ys: f32(0), zs: f32(2) },
+ vertexIndices: u32(0),
+ channel: 0,
+ },
+ ],
+ },
+ {
+ positions: { xs: f32(), ys: f32(), zs: f32() },
+ uvs: { us: f32(), vs: f32() },
+ normals: { xs: f32(), ys: f32(), zs: f32() },
+ layouts: { positions: u32(), uvs: u32(), normals: u32() },
+ faces: [],
+ maximumInfluencePerVertex: 0,
+ skinWeights: [],
+ blendShapeTargets: [],
+ },
+ ],
+ };
+}
+
+async function validate(glb: Uint8Array) {
+ const report = await validateBytes(glb, { maxIssues: 50 });
+ return report.issues.messages
+ .filter((m: { severity: number }) => m.severity <= 1)
+ .map(
+ (m: { code: string; message: string; pointer?: string }) =>
+ `${m.code} ${m.pointer ?? ""}: ${m.message}`,
+ );
+}
+
+/** A column-major 4×4 matrix times a point. */
+const transform = (
+ m: ArrayLike<number>,
+ o: number,
+ p: [number, number, number],
+) =>
+ [0, 1, 2].map(
+ (r) =>
+ (m[o + r] as number) * p[0] +
+ (m[o + 4 + r] as number) * p[1] +
+ (m[o + 8 + r] as number) * p[2] +
+ (m[o + 12 + r] as number),
+ );
+
+describe("readDna", () => {
+ for (const [label, write] of [
+ ["2.8", writeDna28],
+ ["2.1", writeDna21],
+ ] as const)
+ it(`reads every layer it knows from a ${label} file`, () => {
+ const src = arm({
+ rotationSequence: label === "2.8" ? "zyx" : "xyz",
+ faceWindingOrder: label === "2.8" ? "cw" : "ccw",
+ });
+ const dna = readDna(write(src));
+ expect(dna.version).toEqual({
+ generation: 2,
+ version: label === "2.8" ? 8 : 1,
+ });
+ expect(dna.descriptor).toEqual(src.descriptor);
+ expect(dna.definition).toEqual(src.definition);
+ expect(dna.behavior).toEqual(src.behavior);
+ expect(dna.geometry?.meshes).toEqual(src.meshes);
+ if (label === "2.8")
+ expect(dna.layers.map((l) => l.id)).toEqual([
+ "desc",
+ "defn",
+ "bhvr",
+ "geom",
+ "twsw",
+ "dsce",
+ ]);
+ });
+
+ it("skips layers it is not asked for", () => {
+ const dna = readDna(writeDna28(arm()), {
+ geometry: false,
+ behavior: false,
+ });
+ expect(dna.geometry).toBeUndefined();
+ expect(dna.behavior).toBeUndefined();
+ expect(dna.definition.jointNames).toEqual([
+ "root",
+ "elbow",
+ "hand",
+ "thumb",
+ "index",
+ ]);
+ });
+
+ it("refuses what is not a DNA file it can read", () => {
+ expect(() => readDna(new TextEncoder().encode("GLTF1234"))).toThrow(
+ /not a DNA file/,
+ );
+ const future = writeDna28(arm());
+ future[6] = 9;
+ expect(() => readDna(future)).toThrow(/2\.9 is not supported/);
+ expect(() => readDna(writeDna28(arm()).subarray(0, 60))).toThrow(/ends at/);
+ });
+});
+
+describe("eulerQuat", () => {
+ it("matches OpenRigLogic's xyz conversion (x turns first)", () => {
+ const s = spaceOf(descriptor({ rotationUnit: "radians" }), "cm");
+ const [x, y, z] = [0.3, -0.7, 1.1];
+ // tdm's euler_to_quat<rot_seq::xyz>.
+ const [cx, cy, cz] = [Math.cos(x / 2), Math.cos(y / 2), Math.cos(z / 2)];
+ const [sx, sy, sz] = [Math.sin(x / 2), Math.sin(y / 2), Math.sin(z / 2)];
+ const expected = [
+ sx * cy * cz - cx * sy * sz,
+ cx * sy * cz + sx * cy * sz,
+ cx * cy * sz - sx * sy * cz,
+ cx * cy * cz + sx * sy * sz,
+ ];
+ for (const [i, c] of eulerQuat(s, x, y, z).entries())
+ expect(c).toBeCloseTo(expected[i] as number, 12);
+ });
+});
+
+describe("dnaToGlb", () => {
+ it("writes a valid skinned GLB with the neutral pose, one LOD and named blend shapes", async () => {
+ const glb = dnaToGlb(readDna(writeDna28(arm())));
+ expect(await validate(glb)).toEqual([]);
+ const model = parseGLB(glb);
+ // LOD 0: only the quad, a vertex per layout, two faces fanned into three triangles.
+ expect(model.meshes).toHaveLength(1);
+ const m = model.meshes[0]!;
+ expect(m.positions.length / 3).toBe(5);
+ expect(m.indices.length).toBe(9);
+ expect(m.morphTargetNames).toEqual(["jawOpen"]);
+ // The shape moves both copies of the first corner.
+ const jaw = denseMorphDeltas(m.morphTargets![0]!, 5);
+ expect([jaw[2], jaw[14], jaw[5]]).toEqual([2, 2, 0]);
+ // UVs flip to glTF's v-down.
+ expect(Array.from(m.uvs.slice(4, 6))).toEqual([1, 0]);
+ // Six entries over five joints: the root's two add up (0.15), and with
+ // five influences the vertex takes glTF's second set too.
+ const set0 = Array.from(m.jointIndices!.slice(8, 12));
+ const set1 = Array.from(m.jointIndices1!.slice(8, 12));
+ expect(set0).toEqual([2, 1, 0, 3]);
+ expect(set1).toEqual([4, 0, 0, 0]);
+ const w = [
+ ...m.jointWeights!.slice(8, 12),
+ ...m.jointWeights1!.slice(8, 12),
+ ];
+ for (const [k, x] of [0.4, 0.3, 0.15, 0.1, 0.05, 0, 0, 0].entries())
+ expect(w[k]).toBeCloseTo(x, 6);
+
+ // Joints at the neutral pose: each inverse bind matrix takes its joint's
+ // rest position to the origin; the elbow rests turned 90° about z.
+ const skin = model.skins![0]!;
+ const names = skin.joints.map((j) => model.nodes![j]!.name);
+ expect(names).toEqual(["root", "elbow", "hand", "thumb", "index"]);
+ // The fingers sit in the hand's frame, which the elbow turned: its x is up, its y is -x.
+ const rest: Record<string, [number, number, number]> = {
+ root: [0, 0, 0],
+ elbow: [0, 10, 0],
+ hand: [0, 20, 0],
+ thumb: [0, 22, 1],
+ index: [0, 23, -1],
+ };
+ for (const [i, n] of names.entries())
+ for (const c of transform(
+ skin.inverseBindMatrices,
+ i * 16,
+ rest[n] as [number, number, number],
+ ))
+ expect(c).toBeCloseTo(0, 5);
+ const elbow = model.nodes![skin.joints[1]!]!;
+ expect(elbow.rotation?.[2]).toBeCloseTo(Math.SQRT1_2, 6);
+ expect(model.nodes![skin.joints[2]!]!.translation?.[0]).toBeCloseTo(10, 5);
+ });
+
+ it("keeps four influences when asked, renormalized", async () => {
+ const glb = dnaToGlb(readDna(writeDna28(arm())), { influences: 4 });
+ expect(await validate(glb)).toEqual([]);
+ const m = parseGLB(glb).meshes[0]!;
+ expect(m.jointIndices1).toBeUndefined();
+ const w = Array.from(m.jointWeights!.slice(8, 12));
+ for (const [k, x] of [0.4, 0.3, 0.15, 0.1].entries())
+ expect(w[k]).toBeCloseTo(x / 0.95, 6);
+ });
+
+ it("converts mirrored axes and meters, keeping faces turned outward", async () => {
+ // x points to the viewer's left: a mirror image of glTF's axes.
+ const dna = readDna(
+ writeDna28(
+ arm({
+ coordinateSystem: ["left", "up", "front"],
+ translationUnit: "m",
+ }),
+ ),
+ );
+ const glb = dnaToGlb(dna);
+ expect(await validate(glb)).toEqual([]);
+ const m = parseGLB(glb).meshes[0]!;
+ // Meters become centimeters, and x flips.
+ expect(m.positions[0]).toBeCloseTo(500, 3);
+ // Every triangle's winding agrees with its vertex normals.
+ for (let t = 0; t < m.indices.length; t += 3) {
+ const [a, b, c] = [m.indices[t]!, m.indices[t + 1]!, m.indices[t + 2]!];
+ const p = (i: number) => [
+ m.positions[i * 3]!,
+ m.positions[i * 3 + 1]!,
+ m.positions[i * 3 + 2]!,
+ ];
+ const [pa, pb, pc] = [p(a), p(b), p(c)];
+ const u = pb.map((v, k) => v - pa[k]!);
+ const v = pc.map((x, k) => x - pa[k]!);
+ const nz = u[0]! * v[1]! - u[1]! * v[0]!;
+ expect(Math.sign(nz)).toBe(Math.sign(m.normals![a * 3 + 2]!));
+ }
+ });
+
+ it("writes the meshes of the asked LOD", () => {
+ const dna = readDna(writeDna28(arm()));
+ // LOD 1's only mesh is empty: the character is its skeleton alone.
+ const model = parseGLB(dnaToGlb(dna, { lod: 1 }));
+ expect(model.meshes).toHaveLength(0);
+ expect(model.nodes?.map((n) => n.name)).toContain("hand");
+ expect(() => dnaToGlb(dna, { lod: 2 })).toThrow(/LOD 2 is not in the file/);
+ });
+});
diff --git a/packages/dna/src/gltf-validator.d.ts b/packages/dna/src/gltf-validator.d.ts
new file mode 100644
index 00000000..5116ab64
--- /dev/null
+++ b/packages/dna/src/gltf-validator.d.ts
@@ -0,0 +1,21 @@
+/** The subset of the Khronos glTF validator's API the tests use. */
+declare module "gltf-validator" {
+ export interface ValidationMessage {
+ code: string;
+ message: string;
+ /** 0 error, 1 warning, 2 info, 3 hint. */
+ severity: number;
+ pointer?: string;
+ }
+ export interface ValidationReport {
+ issues: {
+ numErrors: number;
+ numWarnings: number;
+ messages: ValidationMessage[];
+ };
+ }
+ export function validateBytes(
+ data: Uint8Array,
+ options?: { maxIssues?: number; uri?: string },
+ ): Promise<ValidationReport>;
+}
diff --git a/packages/dna/src/index.ts b/packages/dna/src/index.ts
new file mode 100644
index 00000000..9c644024
--- /dev/null
+++ b/packages/dna/src/index.ts
@@ -0,0 +1,44 @@
+/**
+ * `framefields/dna`: characters from DNA files (the format MetaHuman
+ * characters export to), read in TypeScript and written as GLB files for
+ * `Layer.glb`. The reader is based on OpenRigLogic's DNA library (MIT,
+ * Epic Games).
+ */
+export { ByteReader } from "./bytes.js";
+export {
+ dnaMaterials,
+ type FoundTextures,
+ type MeshRole,
+ meshRole,
+ type RoleTextures,
+ roleMaterial,
+} from "./materials.js";
+export {
+ type AxisDirection,
+ type ConditionalTable,
+ type DnaBehavior,
+ type DnaDefinition,
+ type DnaDescriptor,
+ type DnaFile,
+ type DnaMesh,
+ type JointGroup,
+ type LodMapping,
+ type ReadDnaOptions,
+ type RotationSequence,
+ readDna,
+ type Vec3Array,
+} from "./read.js";
+export {
+ JOINT_ATTRIBUTES,
+ RigEvaluator,
+ type RigEvaluatorOptions,
+} from "./rig.js";
+export { eulerQuat, type Space, spaceOf } from "./space.js";
+export {
+ type AddedDna,
+ addDna,
+ type DnaToGltfOptions,
+ dnaSkeleton,
+ dnaToGlb,
+ lodMeshes,
+} from "./to-glb.js";
diff --git a/packages/dna/src/materials.test.ts b/packages/dna/src/materials.test.ts
new file mode 100644
index 00000000..eb7b5277
--- /dev/null
+++ b/packages/dna/src/materials.test.ts
@@ -0,0 +1,94 @@
+/**
+ * Mesh roles come from DNA mesh names, each role has a material the engine
+ * renders, and an export folder's textures land on the right roles.
+ */
+import { mkdtemp, rm, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import path from "node:path";
+import { encodePng, GltfDocument } from "@framefields/forge";
+import { describe, expect, it } from "vitest";
+import { dnaMaterials, meshRole, roleMaterial } from "./index.js";
+
+describe("meshRole", () => {
+ it("names the role of each head mesh", () => {
+ const roles = Object.fromEntries(
+ [
+ "head_lod0_mesh",
+ "teeth_lod0_mesh",
+ "saliva_lod0_mesh",
+ "eyeLeft_lod0_mesh",
+ "eyeRight_lod0_mesh",
+ "eyeshell_lod0_mesh",
+ "eyelashes_lod0_mesh",
+ "eyeEdge_lod0_mesh",
+ "cartilage_lod0_mesh",
+ "body_lod0_mesh",
+ ].map((n) => [n, meshRole(n)]),
+ );
+ expect(roles).toEqual({
+ head_lod0_mesh: "skin",
+ teeth_lod0_mesh: "teeth",
+ saliva_lod0_mesh: "saliva",
+ eyeLeft_lod0_mesh: "eye",
+ eyeRight_lod0_mesh: "eye",
+ eyeshell_lod0_mesh: "eyeshell",
+ eyelashes_lod0_mesh: "eyelashes",
+ eyeEdge_lod0_mesh: "eyeEdge",
+ cartilage_lod0_mesh: "cartilage",
+ body_lod0_mesh: "skin",
+ });
+ });
+
+ it("gives clear and thin layers materials that let what is under them show", () => {
+ expect(roleMaterial("eyeshell").transmission).toBe(1);
+ for (const role of ["saliva", "eyeEdge", "cartilage"] as const)
+ expect(roleMaterial(role).alphaMode).toBe("blend");
+ expect(roleMaterial("eyelashes").doubleSided).toBe(true);
+ });
+});
+
+describe("dnaMaterials", () => {
+ it("puts an export folder's textures on their roles and reports the rest", async () => {
+ const dir = await mkdtemp(path.join(tmpdir(), "framefields-dna-tex-"));
+ const png = encodePng(new Uint8Array(4 * 4 * 4).fill(128), 4, 4);
+ const files = [
+ "head_color_map.png",
+ "head_normal_map.png",
+ "head_roughness_map.png",
+ "head_cavity_map.png",
+ "head_wm1_normal_map.png",
+ "teeth_color_map.png",
+ "eyes_color_map.png",
+ "eyelashes_color.png",
+ "notes.txt",
+ ];
+ for (const f of files) await writeFile(path.join(dir, f), png);
+ try {
+ const doc = new GltfDocument();
+ const t = await dnaMaterials(doc, dir);
+ expect(t.found).toEqual({
+ skin: {
+ color: "head_color_map.png",
+ normal: "head_normal_map.png",
+ roughness: "head_roughness_map.png",
+ occlusion: "head_cavity_map.png",
+ },
+ teeth: { color: "teeth_color_map.png" },
+ eye: { color: "eyes_color_map.png" },
+ eyelashes: { color: "eyelashes_color.png" },
+ });
+ expect(t.unused).toEqual(["head_wm1_normal_map.png"]);
+ const head = t.materials("head_lod0_mesh");
+ expect(
+ [head.colorTexture, head.normalTexture, head.occlusionTexture].every(
+ Boolean,
+ ),
+ ).toBe(true);
+ // Roughness from the map's green channel; no metal from its blue.
+ expect([head.metallic, head.roughness]).toEqual([0, 1]);
+ expect(t.materials("eyelashes_lod0_mesh").alphaMode).toBe("mask");
+ } finally {
+ await rm(dir, { recursive: true, force: true });
+ }
+ });
+});
diff --git a/packages/dna/src/materials.ts b/packages/dna/src/materials.ts
new file mode 100644
index 00000000..d063905d
--- /dev/null
+++ b/packages/dna/src/materials.ts
@@ -0,0 +1,199 @@
+/**
+ * Materials for the meshes a DNA head or body is made of. Each mesh plays a
+ * role, found from its name (`head_lod0_mesh` is skin, `eyeshell_lod0_mesh`
+ * the clear film over an eye, …), and each role has a material built from
+ * what the engine renders: skin with subsurface scattering, wet teeth,
+ * clear glass, thin transparent films, alpha-tested lashes.
+ *
+ * `dnaMaterials(doc, folder)` also looks for the export's textures in a
+ * folder, by the role and map words in their file names (`head_color`,
+ * `head_normal`, `head_roughness`, `head_cavity`, …). The names a real
+ * export uses are not confirmed yet: what it finds is reported, so a
+ * mismatch is easy to see and to fix with `materials`.
+ */
+import { readdir, readFile } from "node:fs/promises";
+import path from "node:path";
+import type {
+ GltfDocument,
+ MaterialSpec,
+ TextureRef,
+} from "@framefields/forge";
+
+export type MeshRole =
+ | "skin"
+ | "teeth"
+ | "saliva"
+ | "eye"
+ | "eyeshell"
+ | "eyeEdge"
+ | "eyelashes"
+ | "cartilage";
+
+/** Mesh name patterns, most specific first. */
+const ROLES: [RegExp, MeshRole][] = [
+ [/eye_?shell/i, "eyeshell"],
+ [/eye_?edge|tear/i, "eyeEdge"],
+ [/eye_?lash|lashes/i, "eyelashes"],
+ [/eye_?(left|right|l|r)\b|^eye/i, "eye"],
+ [/saliva/i, "saliva"],
+ [/teeth|tooth|tongue|mouth/i, "teeth"],
+ [/cartilage/i, "cartilage"],
+];
+
+/** The role a mesh plays, from its name; skin when nothing else fits. */
+export function meshRole(mesh: string): MeshRole {
+ return ROLES.find(([pattern]) => pattern.test(mesh))?.[1] ?? "skin";
+}
+
+export interface RoleTextures {
+ color?: TextureRef;
+ normal?: TextureRef;
+ roughness?: TextureRef;
+ occlusion?: TextureRef;
+}
+
+/** A role's material, with whatever textures were found for it. */
+export function roleMaterial(
+ role: MeshRole,
+ t: RoleTextures = {},
+): MaterialSpec {
+ const maps: MaterialSpec = {
+ ...(t.color ? { colorTexture: t.color } : {}),
+ ...(t.normal ? { normalTexture: t.normal } : {}),
+ // A grayscale roughness map: glTF reads roughness from green and metal from blue, so metal is kept off.
+ ...(t.roughness
+ ? { metallicRoughnessTexture: t.roughness, metallic: 0, roughness: 1 }
+ : {}),
+ ...(t.occlusion ? { occlusionTexture: t.occlusion } : {}),
+ };
+ switch (role) {
+ case "skin":
+ return {
+ color: t.color ? "#ffffff" : "#d2a98f",
+ roughness: 0.5,
+ subsurface: { factor: 0.7, color: "#ff5a3c" },
+ ...maps,
+ };
+ case "teeth":
+ return {
+ color: t.color ? "#ffffff" : "#e8dccb",
+ roughness: 0.3,
+ subsurface: { factor: 0.5, color: "#ff8070" },
+ ...maps,
+ };
+ case "eye":
+ return {
+ color: t.color ? "#ffffff" : "#d8d4cf",
+ roughness: 0.2,
+ clearcoat: { factor: 1, roughness: 0.03 },
+ ...maps,
+ };
+ // The clear film over the eye: refracts what is under it.
+ case "eyeshell":
+ return {
+ color: "#ffffff",
+ roughness: 0.02,
+ transmission: 1,
+ ior: 1.376,
+ volume: { thickness: 0.05 },
+ };
+ // Thin wet films and the soft blend where lid meets eye.
+ case "saliva":
+ return { color: "#ffffff80", roughness: 0.05, alphaMode: "blend" };
+ case "eyeEdge":
+ return { color: "#ffffff30", roughness: 0.1, alphaMode: "blend" };
+ case "cartilage":
+ return { color: "#e0a8a060", roughness: 0.3, alphaMode: "blend" };
+ case "eyelashes":
+ return {
+ color: t.color ? "#ffffff" : "#1a1410",
+ roughness: 0.6,
+ doubleSided: true,
+ ...(t.color
+ ? { colorTexture: t.color, alphaMode: "mask", alphaCutoff: 0.5 }
+ : {}),
+ };
+ }
+}
+
+/** File name words per role (what a texture's name must mention) and per map. */
+const ROLE_WORDS: Record<MeshRole, RegExp> = {
+ skin: /head|face|body/i,
+ teeth: /teeth|tooth/i,
+ saliva: /saliva/i,
+ eye: /eye(?!lash|shell|edge)/i,
+ eyeshell: /eyeshell/i,
+ eyeEdge: /eyeedge/i,
+ eyelashes: /lash/i,
+ cartilage: /cartilage/i,
+};
+const MAP_WORDS: [keyof RoleTextures, RegExp][] = [
+ ["normal", /normal|nrm|_n\b/i],
+ ["roughness", /rough/i],
+ ["occlusion", /cavity|occlusion|\bao\b/i],
+ ["color", /color|colour|albedo|diffuse|base/i],
+];
+const IMAGE = /\.(png|jpe?g|webp)$/i;
+const MIME: Record<string, "image/png" | "image/jpeg" | "image/webp"> = {
+ ".png": "image/png",
+ ".jpg": "image/jpeg",
+ ".jpeg": "image/jpeg",
+ ".webp": "image/webp",
+};
+
+export interface FoundTextures {
+ /** Which file each role's map came from. */
+ found: Partial<Record<MeshRole, Partial<Record<keyof RoleTextures, string>>>>;
+ /** Images that matched no role and map. */
+ unused: string[];
+ /** A material per mesh, for `dnaToGlb` / `addDna`'s `materials`. */
+ materials: (mesh: string) => MaterialSpec;
+}
+
+/**
+ * Finds the export's textures in `folder` (PNG, JPEG, WebP), adds them to
+ * `doc`, and returns a material per mesh role. Wrinkle maps and masks
+ * (animated maps) are left for the rig evaluation. A texture name naming
+ * several maps counts for the first that fits, in the order normal,
+ * roughness, cavity, color.
+ */
+export async function dnaMaterials(
+ doc: GltfDocument,
+ folder: string,
+): Promise<FoundTextures> {
+ const files = (await readdir(folder)).filter((f) => IMAGE.test(f)).sort();
+ const found: FoundTextures["found"] = {};
+ const refs: Partial<Record<MeshRole, RoleTextures>> = {};
+ const unused: string[] = [];
+ for (const file of files) {
+ const base = path.basename(file, path.extname(file));
+ if (/wrinkle|mask|_wm\d/i.test(base)) {
+ unused.push(file);
+ continue;
+ }
+ const role =
+ (Object.keys(ROLE_WORDS) as MeshRole[]).find(
+ (r) => r !== "skin" && ROLE_WORDS[r].test(base),
+ ) ?? (ROLE_WORDS.skin.test(base) ? "skin" : undefined);
+ const map = MAP_WORDS.find(([, w]) => w.test(base))?.[0];
+ if (!role || !map || found[role]?.[map]) {
+ unused.push(file);
+ continue;
+ }
+ const image = new Uint8Array(await readFile(path.join(folder, file)));
+ const ref = doc.addTexture({
+ image,
+ mimeType: MIME[path.extname(file).toLowerCase()] ?? "image/png",
+ });
+ refs[role] = { ...refs[role], [map]: ref };
+ found[role] = { ...found[role], [map]: file };
+ }
+ return {
+ found,
+ unused,
+ materials: (mesh) => {
+ const role = meshRole(mesh);
+ return roleMaterial(role, refs[role]);
+ },
+ };
+}
diff --git a/packages/dna/src/read.ts b/packages/dna/src/read.ts
new file mode 100644
index 00000000..b3f812f2
--- /dev/null
+++ b/packages/dna/src/read.ts
@@ -0,0 +1,616 @@
+/**
+ * Reads a DNA file: the character description (name, units, axes), the
+ * definition (controls, joints and their neutral pose, blend shape channels,
+ * animated maps, meshes, LOD mappings), the rig behavior (pose-space
+ * controls, joint matrices, blend shape and animated map mappings) and the
+ * geometry (meshes with UVs, normals, skin weights and blend shape targets).
+ *
+ * File versions 2.1 (section table) and 2.2–2.8 (layer index) are read.
+ * Layers this reader does not use yet (RBF, twist/swing, machine-learned
+ * behavior, joint metadata) are listed by id and left unread.
+ *
+ * Based on OpenRigLogic's DNA library (MIT, Epic Games): the layout follows
+ * its `DNA.h` serializers.
+ */
+import { ByteReader } from "./bytes.js";
+
+export type AxisDirection = "left" | "right" | "up" | "down" | "front" | "back";
+export type RotationSequence = "xyz" | "xzy" | "yxz" | "yzx" | "zxy" | "zyx";
+
+export interface DnaDescriptor {
+ name: string;
+ archetype: number;
+ gender: number;
+ age: number;
+ metadata: [string, string][];
+ translationUnit: "cm" | "m";
+ rotationUnit: "degrees" | "radians";
+ /** Where each file axis points. */
+ coordinateSystem: [AxisDirection, AxisDirection, AxisDirection];
+ lodCount: number;
+ maxLOD: number;
+ complexity: string;
+ dbName: string;
+ /** Euler order of joint rotations (from file version 2.7; before it, xyz). */
+ rotationSequence: RotationSequence;
+ /** Per axis, 1 or -1: the direction a positive angle turns. */
+ rotationSign: [number, number, number];
+ faceWindingOrder: "ccw" | "cw";
+}
+
+/** For each LOD, a row of `indices`: the elements that LOD uses. */
+export interface LodMapping {
+ lods: Uint16Array;
+ indices: Uint16Array[];
+}
+
+export interface DnaDefinition {
+ lodJointMapping: LodMapping;
+ lodBlendShapeMapping: LodMapping;
+ lodAnimatedMapMapping: LodMapping;
+ lodMeshMapping: LodMapping;
+ guiControlNames: string[];
+ rawControlNames: string[];
+ jointNames: string[];
+ blendShapeChannelNames: string[];
+ animatedMapNames: string[];
+ meshNames: string[];
+ /** Pairs (mesh, blend shape channel). */
+ meshBlendShapeChannelMapping: { from: Uint16Array; to: Uint16Array };
+ /** Per joint, its parent (a root is its own parent). */
+ jointHierarchy: Uint16Array;
+ /** Per joint, translation from its parent, in the descriptor's unit. */
+ neutralJointTranslations: Vec3Array;
+ /** Per joint, Euler rotation relative to its parent, in the descriptor's unit and order. */
+ neutralJointRotations: Vec3Array;
+}
+
+/** Three parallel arrays. */
+export interface Vec3Array {
+ xs: Float32Array;
+ ys: Float32Array;
+ zs: Float32Array;
+}
+
+/** Piecewise linear outputs: `output += slope · input + cut` where `from ≤ input ≤ to`. */
+export interface ConditionalTable {
+ inputIndices: Uint16Array;
+ outputIndices: Uint16Array;
+ fromValues: Float32Array;
+ toValues: Float32Array;
+ slopeValues: Float32Array;
+ cutValues: Float32Array;
+}
+
+export interface JointGroup {
+ lods: Uint16Array;
+ inputIndices: Uint16Array;
+ outputIndices: Uint16Array;
+ /** Row-major, outputIndices × inputIndices. */
+ values: Float32Array;
+ jointIndices: Uint16Array;
+}
+
+export interface DnaBehavior {
+ controls: {
+ psdCount: number;
+ /** GUI to raw controls. */
+ conditionals: ConditionalTable;
+ /** Pose-space controls: products of raw controls. */
+ psds: { rows: Uint16Array; columns: Uint16Array; values: Float32Array };
+ };
+ joints: { rowCount: number; colCount: number; jointGroups: JointGroup[] };
+ blendShapeChannels: {
+ lods: Uint16Array;
+ inputIndices: Uint16Array;
+ outputIndices: Uint16Array;
+ };
+ animatedMaps: { lods: Uint16Array; conditionals: ConditionalTable };
+}
+
+export interface DnaMesh {
+ positions: Vec3Array;
+ uvs: { us: Float32Array; vs: Float32Array };
+ normals: Vec3Array;
+ /** Per vertex layout: position, UV and normal indices. */
+ layouts: { positions: Uint32Array; uvs: Uint32Array; normals: Uint32Array };
+ /** Polygons as layout indices. */
+ faces: Uint32Array[];
+ maximumInfluencePerVertex: number;
+ /** Per position. */
+ skinWeights: { weights: Float32Array; jointIndices: Uint16Array }[];
+ blendShapeTargets: {
+ deltas: Vec3Array;
+ vertexIndices: Uint32Array;
+ channel: number;
+ }[];
+}
+
+export type TwistAxis = "x" | "y" | "z";
+
+/** One RBF solver: how close the current joint rotations are to each of its poses. */
+export interface RbfSolver {
+ name: string;
+ /** The raw controls it reads (usually joint quaternions, four per joint). */
+ rawControlIndices: Uint16Array;
+ /** Its poses (indices into `DnaRbf.poses`). */
+ poseIndices: Uint16Array;
+ /** Per pose, the raw control values that define it. */
+ rawControlValues: Float32Array;
+ /** Kernel width, in the descriptor's rotation unit. */
+ radius: number;
+ weightThreshold: number;
+ solverType: "additive" | "interpolative";
+ /** Radius from the mean distance between poses. */
+ automaticRadius: boolean;
+ distanceMethod: "euclidean" | "quaternion" | "swingAngle" | "twistAngle";
+ normalizeMethod: "onlyAboveOne" | "always";
+ functionType: "gaussian" | "exponential" | "linear" | "cubic" | "quintic";
+ twistAxis: TwistAxis;
+}
+
+/** Pose-space correctives (body): RBF solvers whose pose weights drive controls. */
+export interface DnaRbf {
+ lodSolverMapping: LodMapping;
+ solvers: RbfSolver[];
+ poses: { name: string; scale: number }[];
+ /** The controls poses write (after raw, PSD and ML controls). */
+ poseControlNames: string[];
+ /** Per pose: controls that gate it (multiplied), and the controls it writes with their weights. */
+ poseControls: {
+ inputControlIndices: Uint16Array;
+ outputControlIndices: Uint16Array;
+ outputControlWeights: Float32Array;
+ }[];
+}
+
+/** A joint's rotation split into twist and swing, spread over other joints. */
+export interface TwistSwingSetup {
+ /** Per output joint: how far it stays from the full rotation (0 follows it, 1 stays still). */
+ blendWeights: Float32Array;
+ outputJointIndices: Uint16Array;
+ /** The four raw controls holding the source joint's quaternion. */
+ inputControlIndices: Uint16Array;
+ twistAxis: TwistAxis;
+}
+
+export interface DnaFile {
+ version: { generation: number; version: number };
+ descriptor: DnaDescriptor;
+ definition: DnaDefinition;
+ behavior?: DnaBehavior;
+ /** Machine-learned controls (their values are not evaluated yet; they sit between PSD and RBF controls). */
+ mlControlNames?: string[];
+ rbf?: DnaRbf;
+ twistSwing?: { twists: TwistSwingSetup[]; swings: TwistSwingSetup[] };
+ /** Per joint: how translation, rotation and scale are represented (rotation "quaternion" joints need RigLogic's quaternion path). */
+ jointRepresentations?: {
+ translation: "vector";
+ rotation: "euler" | "quaternion";
+ scale: "vector";
+ }[];
+ geometry?: { meshes: DnaMesh[] };
+ /** Every layer in the file, by four-letter id and layer version. */
+ layers: { id: string; version: string }[];
+}
+
+export interface ReadDnaOptions {
+ /** Read the meshes. Default true. */
+ geometry?: boolean;
+ /** Read the rig behavior. Default true. */
+ behavior?: boolean;
+}
+
+const AXES: AxisDirection[] = ["left", "right", "up", "down", "front", "back"];
+const SEQUENCES: RotationSequence[] = [
+ "xyz",
+ "xzy",
+ "yxz",
+ "yzx",
+ "zxy",
+ "zyx",
+];
+
+export function readDna(
+ bytes: Uint8Array,
+ options: ReadDnaOptions = {},
+): DnaFile {
+ const r = new ByteReader(bytes);
+ if (r.length < 7 || r.chars(3) !== "DNA")
+ throw new Error("dna: not a DNA file (no DNA signature)");
+ const generation = r.u16();
+ const version = r.u16();
+ if (generation !== 2)
+ throw new Error(
+ `dna: file generation ${generation} is not supported (2 is)`,
+ );
+ if (version < 1 || version > 8)
+ throw new Error(
+ `dna: file version 2.${version} is not supported (2.1 to 2.8 are)`,
+ );
+ return version === 1 ? readV21(r, options) : readLayered(r, version, options);
+}
+
+/** 2.2 and later: an index of layers by id, version, offset and size. */
+function readLayered(
+ r: ByteReader,
+ version: number,
+ options: ReadDnaOptions,
+): DnaFile {
+ const index = r.list((x) => ({
+ id: x.u32(),
+ version: x.u32(),
+ offset: x.u32(),
+ size: x.u32(),
+ }));
+ const name = (id: number) =>
+ String.fromCharCode(
+ id >>> 24,
+ (id >>> 16) & 255,
+ (id >>> 8) & 255,
+ id & 255,
+ );
+ const at = (id: string) => {
+ const entry = index.find((e) => name(e.id) === id);
+ if (entry) r.seek(entry.offset);
+ return entry;
+ };
+ if (!at("desc")) throw new Error("dna: no descriptor layer");
+ const descriptor = readDescriptor(r);
+ if (at("dsce")) Object.assign(descriptor, readDescriptorExt(r, version));
+ if (!at("defn")) throw new Error("dna: no definition layer");
+ const definition = readDefinition(r);
+ const file: DnaFile = {
+ version: { generation: 2, version },
+ descriptor,
+ definition,
+ layers: index.map((e) => ({
+ id: name(e.id),
+ version: `${e.version >>> 16}.${e.version & 0xffff}`,
+ })),
+ };
+ if (options.behavior !== false && at("bhvr")) {
+ file.behavior = readBehavior(r);
+ if (at("mlbh")) file.mlControlNames = r.list((x) => x.string());
+ if (at("rbfb")) {
+ const rbf = readRbf(r);
+ if (at("rbfe")) readRbfExt(r, rbf);
+ file.rbf = withPoseControls(rbf, file);
+ }
+ if (at("twsw"))
+ file.twistSwing = {
+ twists: r.list(readTwistSwing),
+ swings: r.list(readTwistSwing),
+ };
+ if (at("jbmd")) {
+ const listed = r.list((x) => {
+ x.u16();
+ const rotation: "euler" | "quaternion" =
+ x.u16() === 1 ? "quaternion" : "euler";
+ x.u16();
+ return {
+ translation: "vector" as const,
+ rotation,
+ scale: "vector" as const,
+ };
+ });
+ // Joints the layer does not list are Euler, as RigLogic reads them.
+ file.jointRepresentations = definition.jointNames.map(
+ (_, j) =>
+ listed[j] ?? {
+ translation: "vector" as const,
+ rotation: "euler" as const,
+ scale: "vector" as const,
+ },
+ );
+ }
+ }
+ if (options.geometry !== false && at("geom"))
+ file.geometry = { meshes: r.list(readMesh) };
+ return file;
+}
+
+/** 2.1: a table of section offsets, then the sections. */
+function readV21(r: ByteReader, options: ReadDnaOptions): DnaFile {
+ const [
+ descriptorAt,
+ definitionAt,
+ ,
+ controlsAt,
+ jointsAt,
+ blendShapesAt,
+ animatedMapsAt,
+ geometryAt,
+ ] = Array.from({ length: 8 }, () => r.u32());
+ r.seek(descriptorAt as number);
+ const descriptor = readDescriptor(r);
+ r.seek(definitionAt as number);
+ const definition = readDefinition(r);
+ const file: DnaFile = {
+ version: { generation: 2, version: 1 },
+ descriptor,
+ definition,
+ layers: [],
+ };
+ if (options.behavior !== false) {
+ r.seek(controlsAt as number);
+ const controls = readControls(r);
+ r.seek(jointsAt as number);
+ const joints = readJoints(r);
+ r.seek(blendShapesAt as number);
+ const blendShapeChannels = readBlendShapeChannels(r);
+ r.seek(animatedMapsAt as number);
+ const animatedMaps = readAnimatedMaps(r);
+ file.behavior = { controls, joints, blendShapeChannels, animatedMaps };
+ }
+ if (options.geometry !== false) {
+ r.seek(geometryAt as number);
+ file.geometry = { meshes: r.list(readMeshV21) };
+ }
+ return file;
+}
+
+function readDescriptor(r: ByteReader): DnaDescriptor {
+ const name = r.string();
+ const archetype = r.u16();
+ const gender = r.u16();
+ const age = r.u16();
+ const metadata = r.list((x) => [x.string(), x.string()] as [string, string]);
+ const translationUnit = r.u16() === 1 ? "m" : "cm";
+ const rotationUnit = r.u16() === 1 ? "radians" : "degrees";
+ const axis = () => {
+ const a = AXES[r.u16()];
+ if (!a)
+ throw new Error("dna: unknown axis direction in the coordinate system");
+ return a;
+ };
+ const coordinateSystem: [AxisDirection, AxisDirection, AxisDirection] = [
+ axis(),
+ axis(),
+ axis(),
+ ];
+ return {
+ name,
+ archetype,
+ gender,
+ age,
+ metadata,
+ translationUnit,
+ rotationUnit,
+ coordinateSystem,
+ lodCount: r.u16(),
+ maxLOD: r.u16(),
+ complexity: r.string(),
+ dbName: r.string(),
+ rotationSequence: "xyz",
+ rotationSign: [1, 1, 1],
+ faceWindingOrder: "ccw",
+ };
+}
+
+/** Rotation order and signs; the face winding order from file version 2.8. */
+function readDescriptorExt(
+ r: ByteReader,
+ version: number,
+): Pick<
+ DnaDescriptor,
+ "rotationSequence" | "rotationSign" | "faceWindingOrder"
+> {
+ const sequence = SEQUENCES[r.u32()];
+ if (!sequence) throw new Error("dna: unknown rotation sequence");
+ const sign: [number, number, number] = [
+ r.i32() < 0 ? -1 : 1,
+ r.i32() < 0 ? -1 : 1,
+ r.i32() < 0 ? -1 : 1,
+ ];
+ const faceWindingOrder = version >= 8 && r.u8() === 1 ? "cw" : "ccw";
+ return { rotationSequence: sequence, rotationSign: sign, faceWindingOrder };
+}
+
+function readLodMapping(r: ByteReader): LodMapping {
+ return { lods: r.u16s(), indices: r.list((x) => x.u16s()) };
+}
+
+function readVec3Array(r: ByteReader): Vec3Array {
+ return { xs: r.f32s(), ys: r.f32s(), zs: r.f32s() };
+}
+
+function readDefinition(r: ByteReader): DnaDefinition {
+ const strings = () => r.list((x) => x.string());
+ return {
+ lodJointMapping: readLodMapping(r),
+ lodBlendShapeMapping: readLodMapping(r),
+ lodAnimatedMapMapping: readLodMapping(r),
+ lodMeshMapping: readLodMapping(r),
+ guiControlNames: strings(),
+ rawControlNames: strings(),
+ jointNames: strings(),
+ blendShapeChannelNames: strings(),
+ animatedMapNames: strings(),
+ meshNames: strings(),
+ meshBlendShapeChannelMapping: { from: r.u16s(), to: r.u16s() },
+ jointHierarchy: r.u16s(),
+ neutralJointTranslations: readVec3Array(r),
+ neutralJointRotations: readVec3Array(r),
+ };
+}
+
+function readConditionalTable(r: ByteReader): ConditionalTable {
+ return {
+ inputIndices: r.u16s(),
+ outputIndices: r.u16s(),
+ fromValues: r.f32s(),
+ toValues: r.f32s(),
+ slopeValues: r.f32s(),
+ cutValues: r.f32s(),
+ };
+}
+
+function readControls(r: ByteReader): DnaBehavior["controls"] {
+ return {
+ psdCount: r.u16(),
+ conditionals: readConditionalTable(r),
+ psds: { rows: r.u16s(), columns: r.u16s(), values: r.f32s() },
+ };
+}
+
+function readJoints(r: ByteReader): DnaBehavior["joints"] {
+ return {
+ rowCount: r.u16(),
+ colCount: r.u16(),
+ jointGroups: r.list((x) => ({
+ lods: x.u16s(),
+ inputIndices: x.u16s(),
+ outputIndices: x.u16s(),
+ values: x.f32s(),
+ jointIndices: x.u16s(),
+ })),
+ };
+}
+
+function readBlendShapeChannels(
+ r: ByteReader,
+): DnaBehavior["blendShapeChannels"] {
+ return { lods: r.u16s(), inputIndices: r.u16s(), outputIndices: r.u16s() };
+}
+
+function readAnimatedMaps(r: ByteReader): DnaBehavior["animatedMaps"] {
+ return { lods: r.u16s(), conditionals: readConditionalTable(r) };
+}
+
+function readBehavior(r: ByteReader): DnaBehavior {
+ return {
+ controls: readControls(r),
+ joints: readJoints(r),
+ blendShapeChannels: readBlendShapeChannels(r),
+ animatedMaps: readAnimatedMaps(r),
+ };
+}
+
+function readMeshBody(r: ByteReader): DnaMesh {
+ return {
+ positions: readVec3Array(r),
+ uvs: { us: r.f32s(), vs: r.f32s() },
+ normals: readVec3Array(r),
+ layouts: { positions: r.u32s(), uvs: r.u32s(), normals: r.u32s() },
+ faces: r.list((x) => x.u32s()),
+ maximumInfluencePerVertex: r.u16(),
+ skinWeights: r.list((x) => ({ weights: x.f32s(), jointIndices: x.u16s() })),
+ blendShapeTargets: r.list((x) => ({
+ deltas: readVec3Array(x),
+ vertexIndices: x.u32s(),
+ channel: x.u16(),
+ })),
+ };
+}
+
+/** 2.2 and later: the mesh's byte size, then the mesh. */
+function readMesh(r: ByteReader): DnaMesh {
+ const size = r.u32();
+ const base = r.offset;
+ const mesh = readMeshBody(r);
+ r.seek(base + size);
+ return mesh;
+}
+
+/** 2.1: the offset just past the mesh, then the mesh. */
+function readMeshV21(r: ByteReader): DnaMesh {
+ const end = r.u32();
+ const mesh = readMeshBody(r);
+ r.seek(end);
+ return mesh;
+}
+
+const AXIS: TwistAxis[] = ["x", "y", "z"];
+const SOLVER_TYPES: RbfSolver["solverType"][] = ["additive", "interpolative"];
+const DISTANCES: RbfSolver["distanceMethod"][] = [
+ "euclidean",
+ "quaternion",
+ "swingAngle",
+ "twistAngle",
+];
+const NORMALIZE: RbfSolver["normalizeMethod"][] = ["onlyAboveOne", "always"];
+const FUNCTIONS: RbfSolver["functionType"][] = [
+ "gaussian",
+ "exponential",
+ "linear",
+ "cubic",
+ "quintic",
+];
+
+function pick<T>(list: readonly T[], i: number, what: string): T {
+ const v = list[i];
+ if (v === undefined) throw new Error(`dna: unknown ${what} ${i}`);
+ return v;
+}
+
+/** The RBF layer: solvers, their LODs, and poses. */
+function readRbf(r: ByteReader): DnaRbf {
+ const lodSolverMapping = readLodMapping(r);
+ const solvers = r.list((x): RbfSolver => {
+ const size = x.u32();
+ const base = x.offset;
+ const solver: RbfSolver = {
+ name: x.string(),
+ rawControlIndices: x.u16s(),
+ poseIndices: x.u16s(),
+ rawControlValues: x.f32s(),
+ radius: x.f32(),
+ weightThreshold: x.f32(),
+ solverType: pick(SOLVER_TYPES, x.u16(), "RBF solver type"),
+ // AutomaticRadius: On is 0, Off is 1.
+ automaticRadius: x.u16() === 0,
+ distanceMethod: pick(DISTANCES, x.u16(), "RBF distance method"),
+ normalizeMethod: pick(NORMALIZE, x.u16(), "RBF normalize method"),
+ functionType: pick(FUNCTIONS, x.u16(), "RBF function type"),
+ twistAxis: pick(AXIS, x.u16(), "twist axis"),
+ };
+ x.seek(base + size);
+ return solver;
+ });
+ const poses = r.list((x) => ({ name: x.string(), scale: x.f32() }));
+ return {
+ lodSolverMapping,
+ solvers,
+ poses,
+ poseControlNames: [],
+ poseControls: [],
+ };
+}
+
+/** The RBF extension layer: the controls poses write, and what gates them. */
+function readRbfExt(r: ByteReader, rbf: DnaRbf): void {
+ rbf.poseControlNames = r.list((x) => x.string());
+ rbf.poseControls = r.list((x) => ({
+ inputControlIndices: x.u16s(),
+ outputControlIndices: x.u16s(),
+ outputControlWeights: x.f32s(),
+ }));
+}
+
+/** Without the extension, pose i writes control (raw + PSD + ML) + i, weight 1. */
+function withPoseControls(rbf: DnaRbf, file: DnaFile): DnaRbf {
+ if (rbf.poseControls.length || !rbf.poses.length) return rbf;
+ const first =
+ file.definition.rawControlNames.length +
+ (file.behavior?.controls.psdCount ?? 0) +
+ (file.mlControlNames?.length ?? 0);
+ return {
+ ...rbf,
+ poseControlNames: rbf.poses.map((p) => p.name),
+ poseControls: rbf.poses.map((_, i) => ({
+ inputControlIndices: new Uint16Array(0),
+ outputControlIndices: Uint16Array.of(first + i),
+ outputControlWeights: Float32Array.of(1),
+ })),
+ };
+}
+
+function readTwistSwing(r: ByteReader): TwistSwingSetup {
+ return {
+ blendWeights: r.f32s(),
+ outputJointIndices: r.u16s(),
+ inputControlIndices: r.u16s(),
+ twistAxis: pick(AXIS, r.u16(), "twist axis"),
+ };
+}
diff --git a/packages/dna/src/rig-body.ts b/packages/dna/src/rig-body.ts
new file mode 100644
index 00000000..6809eef2
--- /dev/null
+++ b/packages/dna/src/rig-body.ts
@@ -0,0 +1,548 @@
+/**
+ * The body parts of rig evaluation, driven by the animated skeleton (joint
+ * rotations arrive as quaternions in raw controls):
+ *
+ * - RBF solvers measure how close the current rotations are to each of a
+ * set of poses (by Euclidean, quaternion arc, swing or twist distance,
+ * through a Gaussian, exponential, linear, cubic or quintic kernel), and
+ * the pose weights drive corrective controls: the shoulder and elbow
+ * shapes linear skinning alone cannot make.
+ * - Twist/swing splits a joint's rotation about an axis and spreads it over
+ * helper joints (forearm twist bones, the shoulder following the arm).
+ *
+ * Based on OpenRigLogic's RigLogic (MIT, Epic Games): the solver, distance,
+ * kernel, slerp and quaternion-to-Euler code follow `RBFSolver.cpp`,
+ * `InterpolativeRBFSolver.cpp`, `TwistSwingJointsEvaluator.h` and tdm.
+ */
+import type {
+ DnaFile,
+ RbfSolver,
+ RotationSequence,
+ TwistAxis,
+ TwistSwingSetup,
+} from "./read.js";
+
+type Q = [number, number, number, number];
+
+const AXIS_INDEX: Record<TwistAxis, number> = { x: 0, y: 1, z: 2 };
+const FLOAT_EPSILON = 1.1920929e-7;
+
+// ── Quaternion parts ────────────────────────────────────────────────
+
+/** The swing part about `axis` (twist removed), in place; w comes out non-positive, as RigLogic's. */
+function toSwing(q: Float64Array, o: number, axis: TwistAxis): void {
+ const [x, y, z, w] = [
+ q[o] as number,
+ q[o + 1] as number,
+ q[o + 2] as number,
+ q[o + 3] as number,
+ ];
+ if (axis === "x") {
+ const nw = -Math.sqrt(x * x + w * w);
+ q.set([0, (w * y - x * z) / nw, (w * z + x * y) / nw, nw], o);
+ } else if (axis === "y") {
+ const nw = -Math.sqrt(y * y + w * w);
+ q.set([(w * x + y * z) / nw, 0, (w * z - y * x) / nw, nw], o);
+ } else {
+ const nw = -Math.sqrt(z * z + w * w);
+ q.set([(w * x - z * y) / nw, (w * y + z * x) / nw, 0, nw], o);
+ }
+}
+
+/** The twist part about `axis`, normalized, in place. */
+function toTwist(q: Float64Array, o: number, axis: TwistAxis): void {
+ const t = AXIS_INDEX[axis];
+ q[o + ((t + 1) % 3)] = 0;
+ q[o + ((t + 2) % 3)] = 0;
+ const m = Math.hypot(q[o + t] as number, q[o + 3] as number);
+ if (m === 0) {
+ q[o + t] = 0;
+ q[o + 3] = 1;
+ return;
+ }
+ q[o + t] = (q[o + t] as number) / m;
+ q[o + 3] = (q[o + 3] as number) / m;
+}
+
+function twistAngle(q: ArrayLike<number>, o: number): number {
+ let a =
+ 2 *
+ Math.atan2(
+ (q[o] as number) + (q[o + 1] as number) + (q[o + 2] as number),
+ q[o + 3] as number,
+ );
+ if (a > Math.PI) a -= 2 * Math.PI;
+ else if (a < -Math.PI) a += 2 * Math.PI;
+ return a;
+}
+
+// ── RBF ─────────────────────────────────────────────────────────────
+
+type Distance = (target: Float64Array, input: Float64Array) => number;
+
+const DISTANCE: Record<"euclidean" | "quaternion" | "twistAngle", Distance> = {
+ euclidean: (t, x) => {
+ let s = 0;
+ for (let i = 0; i < x.length; i++)
+ s += ((t[i] as number) - (x[i] as number)) ** 2;
+ return Math.sqrt(s);
+ },
+ quaternion: (t, x) => {
+ let s = 0;
+ for (let o = 0; o + 3 < x.length; o += 4) {
+ const dot =
+ (t[o] as number) * (x[o] as number) +
+ (t[o + 1] as number) * (x[o + 1] as number) +
+ (t[o + 2] as number) * (x[o + 2] as number) +
+ (t[o + 3] as number) * (x[o + 3] as number);
+ const d2 = dot * dot;
+ const arc = d2 > 1 ? 0 : Math.acos(2 * d2 - 1);
+ s += arc * arc;
+ }
+ return Math.sqrt(s);
+ },
+ twistAngle: (t, x) => {
+ let s = 0;
+ for (let o = 0; o + 3 < x.length; o += 4)
+ s += (twistAngle(t, o) - twistAngle(x, o)) ** 2;
+ return Math.sqrt(s);
+ },
+};
+
+const KERNEL: Record<
+ RbfSolver["functionType"],
+ (d: number, width: number) => number
+> = {
+ linear: (d, w) => Math.max(0, 1 - d / w),
+ cubic: (d, w) => Math.max(0, 1 - (d / w) ** 3),
+ quintic: (d, w) => Math.max(0, 1 - (d / w) ** 5),
+ gaussian: (d, w) => Math.exp(-d / (w * w)),
+ exponential: (d, w) => Math.exp((-2 * d) / w),
+};
+
+/** Inverts `m` in place by LU decomposition with scaled partial pivoting; leaves it as is when a row is all zero. */
+function invert(m: Float64Array[]): Float64Array[] {
+ const n = m.length;
+ const a = m.map((row) => Float64Array.from(row));
+ const permute = new Array<number>(n).fill(0);
+ const scale = new Float64Array(n);
+ for (let i = 0; i < n; i++) {
+ let max = 0;
+ for (let j = 0; j < n; j++)
+ max = Math.max(max, Math.abs((a[i] as Float64Array)[j] as number));
+ if (max === 0) return m;
+ scale[i] = 1 / max;
+ }
+ for (let j = 0; j < n; j++) {
+ for (let i = 0; i < j; i++) {
+ const ai = a[i] as Float64Array;
+ let sum = ai[j] as number;
+ for (let k = 0; k < i; k++)
+ sum -= (ai[k] as number) * ((a[k] as Float64Array)[j] as number);
+ ai[j] = sum;
+ }
+ let iMax = 0;
+ let colMax = 0;
+ for (let i = j; i < n; i++) {
+ const ai = a[i] as Float64Array;
+ let sum = ai[j] as number;
+ for (let k = 0; k < j; k++)
+ sum -= (ai[k] as number) * ((a[k] as Float64Array)[j] as number);
+ ai[j] = sum;
+ const t = (scale[i] as number) * Math.abs(sum);
+ if (t >= colMax) {
+ colMax = t;
+ iMax = i;
+ }
+ }
+ if (j !== iMax) {
+ const rowMax = a[iMax];
+ const rowJ = a[j];
+ if (rowMax && rowJ) {
+ a[iMax] = rowJ;
+ a[j] = rowMax;
+ }
+ scale[iMax] = scale[j] as number;
+ }
+ permute[j] = iMax;
+ const aj = a[j] as Float64Array;
+ if (aj[j] === 0) aj[j] = 1e-20;
+ if (j !== n - 1) {
+ const t = 1 / (aj[j] as number);
+ for (let i = j + 1; i < n; i++)
+ (a[i] as Float64Array)[j] = ((a[i] as Float64Array)[j] as number) * t;
+ }
+ }
+ const inv = Array.from({ length: n }, () => new Float64Array(n));
+ for (let j = 0; j < n; j++) {
+ const b = new Float64Array(n);
+ b[j] = 1;
+ let ii = 0;
+ for (let i = 0; i < n; i++) {
+ const ip = permute[i] as number;
+ let sum = b[ip] as number;
+ b[ip] = b[i] as number;
+ if (ii)
+ for (let k = ii - 1; k < i; k++)
+ sum -= ((a[i] as Float64Array)[k] as number) * (b[k] as number);
+ else if (sum !== 0) ii = i + 1;
+ b[i] = sum;
+ }
+ for (let i = n - 1; i >= 0; i--) {
+ let sum = b[i] as number;
+ for (let k = i + 1; k < n; k++)
+ sum -= ((a[i] as Float64Array)[k] as number) * (b[k] as number);
+ b[i] = sum / ((a[i] as Float64Array)[i] as number);
+ }
+ for (let i = 0; i < n; i++) (inv[i] as Float64Array)[j] = b[i] as number;
+ }
+ return inv;
+}
+
+/** A solver ready to run: converted targets, radius, interpolation coefficients. */
+export class RbfSolverRuntime {
+ private readonly targets: Float64Array[];
+ private readonly distance: Distance;
+ private readonly convert: (q: Float64Array) => void;
+ private readonly radius: number;
+ private readonly coefficients?: Float64Array[];
+ private readonly input: Float64Array;
+ /** Pose weights from the last `solve`. */
+ readonly weights: Float64Array;
+ /** The controls its poses write, cleared before they add up. */
+ readonly outputs: number[];
+
+ constructor(
+ readonly solver: RbfSolver,
+ private readonly scales: number[],
+ angleToRadians: number,
+ poseOutputs: number[],
+ ) {
+ const n = solver.rawControlIndices.length;
+ const convertEach =
+ solver.distanceMethod === "twistAngle"
+ ? toTwist
+ : solver.distanceMethod === "swingAngle"
+ ? toSwing
+ : undefined;
+ this.convert = (q) => {
+ if (convertEach)
+ for (let o = 0; o + 3 < q.length; o += 4)
+ convertEach(q, o, solver.twistAxis);
+ };
+ this.distance =
+ DISTANCE[
+ solver.distanceMethod === "swingAngle"
+ ? "quaternion"
+ : solver.distanceMethod
+ ];
+ this.targets = Array.from(solver.poseIndices, (_, i) => {
+ const t = Float64Array.from(
+ solver.rawControlValues.subarray(i * n, i * n + n),
+ );
+ this.convert(t);
+ return t;
+ });
+ const count = this.targets.length;
+ if (solver.automaticRadius) {
+ let sum = 0;
+ for (let i = 0; i < count; i++)
+ for (let j = i + 1; j < count; j++)
+ sum += this.distance(
+ this.targets[j] as Float64Array,
+ this.targets[i] as Float64Array,
+ );
+ this.radius = sum / ((count * (count - 1)) / 2);
+ } else this.radius = solver.radius * angleToRadians;
+ if (solver.solverType === "interpolative") {
+ const kernel = KERNEL[solver.functionType];
+ const m = this.targets.map((ti) =>
+ Float64Array.from(this.targets, (tj) =>
+ kernel(this.distance(tj, ti), this.radius),
+ ),
+ );
+ this.coefficients = invert(m);
+ }
+ this.input = new Float64Array(n);
+ this.weights = new Float64Array(count);
+ this.outputs = [...new Set(poseOutputs)].sort((x, y) => x - y);
+ }
+
+ /** Pose weights for the current controls. */
+ solve(controls: Float32Array): void {
+ const s = this.solver;
+ s.rawControlIndices.forEach((c, i) => {
+ this.input[i] = controls[c] as number;
+ });
+ this.convert(this.input);
+ const kernel = KERNEL[s.functionType];
+ const count = this.targets.length;
+ const near: Float64Array = Float64Array.from(this.targets, (t) =>
+ kernel(this.distance(t, this.input), this.radius),
+ );
+ const w = this.weights;
+ if (this.coefficients) {
+ for (let i = 0; i < count; i++) {
+ let sum = 0;
+ const row = this.coefficients[i] as Float64Array;
+ for (let j = 0; j < count; j++)
+ sum += (row[j] as number) * (near[j] as number);
+ w[i] = Math.min(1, Math.max(0, sum));
+ }
+ } else w.set(near);
+ let total = 0;
+ for (const x of w) total += x;
+ const ratio = total > 1 || s.normalizeMethod === "always" ? 1 / total : 1;
+ for (let i = 0; i < count; i++) {
+ const x = (w[i] as number) * ratio * (this.scales[i] as number);
+ w[i] = x > s.weightThreshold ? x : 0;
+ }
+ }
+}
+
+// ── Twist and swing ─────────────────────────────────────────────────
+
+/** A swing (and the twist on the same source joint, if any), or a twist alone. */
+export interface TwistSwingRuntime {
+ swing?: TwistSwingSetup;
+ twist?: TwistSwingSetup;
+}
+
+/** Swings first, then each twist joins the swing on the same source joint or stands alone. */
+export function twistSwingSetups(dna: DnaFile): TwistSwingRuntime[] {
+ const ts = dna.twistSwing;
+ if (!ts) return [];
+ const setups: TwistSwingRuntime[] = ts.swings.map((swing) => ({ swing }));
+ const same = (a: Uint16Array, b: Uint16Array) =>
+ a.length === b.length && a.every((v, i) => v === b[i]);
+ for (const twist of ts.twists) {
+ const host = setups.find(
+ (s) =>
+ s.swing && same(s.swing.inputControlIndices, twist.inputControlIndices),
+ );
+ if (host) host.twist = twist;
+ else setups.push({ twist });
+ }
+ return setups;
+}
+
+const mul = (a: Q, b: Q): Q => [
+ a[3] * b[0] + a[0] * b[3] + a[1] * b[2] - a[2] * b[1],
+ a[3] * b[1] + a[1] * b[3] + a[2] * b[0] - a[0] * b[2],
+ a[3] * b[2] + a[2] * b[3] + a[0] * b[1] - a[1] * b[0],
+ a[3] * b[3] - a[0] * b[0] - a[1] * b[1] - a[2] * b[2],
+];
+
+function inverse(q: Q): Q {
+ const l2 = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
+ return [-q[0] / l2, -q[1] / l2, -q[2] / l2, q[3] / l2];
+}
+
+/** tdm's slerp: toward the nearer of q2 and −q2; linear when nearly equal. */
+function slerp(q1: Q, q2: Q, t: number): Q {
+ let cos = q1[0] * q2[0] + q1[1] * q2[1] + q1[2] * q2[2] + q1[3] * q2[3];
+ let b: Q = q2;
+ if (cos < 0) {
+ b = [-q2[0], -q2[1], -q2[2], -q2[3]];
+ cos = -cos;
+ }
+ let t1: number;
+ let t2: number;
+ if (cos > 1 - FLOAT_EPSILON) {
+ t1 = 1 - t;
+ t2 = t;
+ } else {
+ const theta = Math.acos(cos);
+ const r = 1 / Math.sin(theta);
+ t1 = Math.sin((1 - t) * theta) * r;
+ t2 = Math.sin(t * theta) * r;
+ }
+ return [
+ q1[0] * t1 + b[0] * t2,
+ q1[1] * t1 + b[1] * t2,
+ q1[2] * t1 + b[2] * t2,
+ q1[3] * t1 + b[3] * t2,
+ ];
+}
+
+function twistOf(q: Q, axis: TwistAxis): Q {
+ const t: Q = [0, 0, 0, q[3]];
+ const k = AXIS_INDEX[axis];
+ t[k] = q[k];
+ const l2 = t[k] * t[k] + t[3] * t[3];
+ if (l2 === 0) return [0, 0, 0, 1];
+ const l = Math.sqrt(l2);
+ return [t[0] / l, t[1] / l, t[2] / l, t[3] / l];
+}
+
+/** tdm's 7th-degree minimax asin. */
+function fastAsin(value: number): number {
+ const halfPi = 1.570796305;
+ const nonNegative = value >= 0;
+ const v = Math.abs(value);
+ const root = Math.sqrt(Math.max(0, 1 - v));
+ const r =
+ ((((((-0.0012624911 * v + 0.0066700901) * v - 0.0170881256) * v +
+ 0.030891881) *
+ v -
+ 0.0501743046) *
+ v +
+ 0.0889789874) *
+ v -
+ 0.2145988016) *
+ v +
+ halfPi;
+ const acos = r * root;
+ return nonNegative ? halfPi - acos : acos - halfPi;
+}
+
+const NEAR_POLE = 0.99999999999;
+
+/** tdm's quaternion to Euler angles (radians) in the given order, signs applied. */
+export function quatToEuler(
+ q: Q,
+ order: RotationSequence,
+ signs: [number, number, number],
+): [number, number, number] {
+ const [x, y, z, w] = q;
+ const xx2 = 2 * x * x;
+ const xy2 = 2 * x * y;
+ const xz2 = 2 * x * z;
+ const yy2 = 2 * y * y;
+ const yz2 = 2 * y * z;
+ const zz2 = 2 * z * z;
+ const wx2 = 2 * w * x;
+ const wy2 = 2 * w * y;
+ const wz2 = 2 * w * z;
+ let a: [number, number, number];
+ switch (order) {
+ case "xyz": {
+ const s = xz2 - wy2;
+ a =
+ Math.abs(s) < NEAR_POLE
+ ? [
+ Math.atan2(yz2 + wx2, 1 - (xx2 + yy2)),
+ fastAsin(-s),
+ Math.atan2(xy2 + wz2, 1 - (yy2 + zz2)),
+ ]
+ : [0, fastAsin(-s), Math.atan2(wz2 - xy2, 1 - (xx2 + zz2))];
+ break;
+ }
+ case "xzy": {
+ const s = xy2 + wz2;
+ a =
+ Math.abs(s) < NEAR_POLE
+ ? [
+ Math.atan2(wx2 - yz2, 1 - (xx2 + zz2)),
+ Math.atan2(wy2 - xz2, 1 - (yy2 + zz2)),
+ fastAsin(s),
+ ]
+ : [0, Math.atan2(xz2 + wy2, 1 - (xx2 + yy2)), fastAsin(s)];
+ break;
+ }
+ case "yxz": {
+ const s = yz2 + wx2;
+ a =
+ Math.abs(s) < NEAR_POLE
+ ? [
+ fastAsin(s),
+ Math.atan2(wy2 - xz2, 1 - (xx2 + yy2)),
+ Math.atan2(wz2 - xy2, 1 - (xx2 + zz2)),
+ ]
+ : [fastAsin(s), 0, Math.atan2(xy2 + wz2, 1 - (yy2 + zz2))];
+ break;
+ }
+ case "yzx": {
+ const s = xy2 - wz2;
+ a =
+ Math.abs(s) < NEAR_POLE
+ ? [
+ Math.atan2(yz2 + wx2, 1 - (xx2 + zz2)),
+ Math.atan2(xz2 + wy2, 1 - (yy2 + zz2)),
+ fastAsin(-s),
+ ]
+ : [Math.atan2(wx2 - yz2, 1 - (xx2 + yy2)), 0, fastAsin(-s)];
+ break;
+ }
+ case "zxy": {
+ const s = yz2 - wx2;
+ a =
+ Math.abs(s) < NEAR_POLE
+ ? [
+ fastAsin(-s),
+ Math.atan2(xz2 + wy2, 1 - (xx2 + yy2)),
+ Math.atan2(xy2 + wz2, 1 - (xx2 + zz2)),
+ ]
+ : [fastAsin(-s), Math.atan2(wy2 - xz2, 1 - (yy2 + zz2)), 0];
+ break;
+ }
+ case "zyx": {
+ const s = xz2 + wy2;
+ a =
+ Math.abs(s) < NEAR_POLE
+ ? [
+ Math.atan2(wx2 - yz2, 1 - (xx2 + yy2)),
+ fastAsin(s),
+ Math.atan2(wz2 - xy2, 1 - (yy2 + zz2)),
+ ]
+ : [Math.atan2(yz2 + wx2, 1 - (xx2 + zz2)), fastAsin(s), 0];
+ break;
+ }
+ }
+ return [a[0] * signs[0], a[1] * signs[1], a[2] * signs[2]];
+}
+
+/**
+ * Writes the twist/swing rotations over the joint outputs (Euler angles in
+ * the file's units and order, `attributes` values per joint, rotation at 3).
+ */
+export function applyTwistSwing(
+ setups: TwistSwingRuntime[],
+ controls: Float32Array,
+ out: Float32Array,
+ attributes: number,
+ order: RotationSequence,
+ signs: [number, number, number],
+ fromRadians: number,
+): void {
+ const identity: Q = [0, 0, 0, 1];
+ const quat = (idx: Uint16Array): Q => [
+ controls[idx[0] as number] as number,
+ controls[idx[1] as number] as number,
+ controls[idx[2] as number] as number,
+ controls[idx[3] as number] as number,
+ ];
+ const write = (joint: number, q: Q) => {
+ const e = quatToEuler(q, order, signs);
+ const o = joint * attributes + 3;
+ out[o] = e[0] * fromRadians;
+ out[o + 1] = e[1] * fromRadians;
+ out[o + 2] = e[2] * fromRadians;
+ };
+ for (const { swing, twist } of setups) {
+ let invTwist: Q = identity;
+ if (swing) {
+ const input = quat(swing.inputControlIndices);
+ invTwist = inverse(twistOf(input, swing.twistAxis));
+ const invSwing = inverse(mul(input, invTwist));
+ swing.outputJointIndices.forEach((joint, i) => {
+ write(
+ joint,
+ mul(
+ invTwist,
+ slerp(invSwing, identity, swing.blendWeights[i] as number),
+ ),
+ );
+ });
+ }
+ if (twist && !swing)
+ invTwist = twistOf(quat(twist.inputControlIndices), twist.twistAxis);
+ if (twist)
+ twist.outputJointIndices.forEach((joint, i) => {
+ write(
+ joint,
+ slerp(invTwist, identity, twist.blendWeights[i] as number),
+ );
+ });
+ }
+}
diff --git a/packages/dna/src/rig.test.ts b/packages/dna/src/rig.test.ts
new file mode 100644
index 00000000..6bf6a84a
--- /dev/null
+++ b/packages/dna/src/rig.test.ts
@@ -0,0 +1,134 @@
+/**
+ * The rig evaluator matches Epic's RigLogic (scalar, full precision) on the
+ * oracle character: for 48 seeded random control sets, alternating GUI and
+ * raw controls and cycling the LODs, every raw control, PSD, joint
+ * attribute, blend shape weight and animated map equals RigLogic's
+ * (`fixtures/oracle-eval.json`). Evaluation is stateless: any order of
+ * frames gives the same outputs.
+ */
+import { readFileSync } from "node:fs";
+import { describe, expect, it } from "vitest";
+import { RigEvaluator, readDna } from "./index.js";
+
+const dna = readDna(
+ new Uint8Array(
+ readFileSync(new URL("../fixtures/oracle.dna", import.meta.url)),
+ ),
+);
+const cases: {
+ lod: number;
+ gui?: number[];
+ raw?: number[];
+ /** The arm's and forearm's rotations (raw controls 3 … 10), set after any GUI mapping. */
+ quats: number[];
+ rawControls: number[];
+ rbfControls: number[];
+ psdControls: number[];
+ joints: number[];
+ blendShapes: number[];
+ animatedMaps: number[];
+}[] = JSON.parse(
+ readFileSync(
+ new URL("../fixtures/oracle-eval.json", import.meta.url),
+ "utf8",
+ ),
+);
+
+/**
+ * Equal up to float32 rounding: RigLogic works in float32, we in float64.
+ * Face controls, PSDs, blend shapes and maps agree to 1e-6; RBF weights and
+ * twist/swing angles pass through acos and atan, which amplify float32
+ * rounding (worst case 1.4e-5). The fixture's arm solver has two poses
+ * close together, so its interpolation matrix is ill-conditioned and
+ * RigLogic's float32 inversion lands up to 1.2e-4 from the float64 one: RBF
+ * controls and the joints they move get 2e-4. Every behavior change tried
+ * against this test (normalization, interpolation clamp, automatic radius,
+ * swing split, kernel, slerp direction, twist inversion) misses by far more.
+ */
+const close = (
+ actual: ArrayLike<number>,
+ expected: number[],
+ tolerance = 1e-6,
+) => {
+ expect(actual.length).toBe(expected.length);
+ for (let i = 0; i < expected.length; i++)
+ expect(
+ Math.abs((actual[i] as number) - (expected[i] as number)),
+ ).toBeLessThanOrEqual(
+ tolerance * Math.max(1, Math.abs(expected[i] as number)),
+ );
+};
+
+function run(rig: RigEvaluator, c: (typeof cases)[number]) {
+ rig.lod = c.lod;
+ if (c.gui) {
+ rig.guiControls.set(c.gui);
+ rig.mapGuiToRaw();
+ } else rig.inputs.set(c.raw ?? [], 0);
+ rig.inputs.set(c.quats, 3);
+ rig.calculate();
+}
+
+describe("RigEvaluator against RigLogic", () => {
+ it("matches every output for random GUI and raw controls at every LOD", () => {
+ const rig = new RigEvaluator(dna);
+ expect(cases.length).toBe(48);
+ for (const c of cases) {
+ run(rig, c);
+ const raw = rig.inputs.subarray(0, rig.rawControlNames.length);
+ close(raw, c.rawControls);
+ close(
+ rig.inputs.subarray(raw.length, raw.length + c.psdControls.length),
+ c.psdControls,
+ );
+ close(
+ rig.inputs.subarray(rig.inputs.length - rig.rbfControlNames.length),
+ c.rbfControls,
+ 2e-4,
+ );
+ close(rig.jointOutputs, c.joints, 2e-4);
+ close(rig.blendShapeOutputs, c.blendShapes);
+ close(rig.animatedMapOutputs, c.animatedMaps);
+ }
+ // Something moved: the fixture exercises joints, PSDs and maps.
+ expect(cases.some((c) => c.joints.some((v) => v !== 0))).toBe(true);
+ expect(cases.some((c) => c.psdControls.some((v) => v > 0))).toBe(true);
+ expect(cases.some((c) => c.rbfControls.some((v) => v > 0.1))).toBe(true);
+ });
+
+ it("gives the same outputs in any order (seeking equals playing)", () => {
+ const forward = new RigEvaluator(dna);
+ const outputs = cases.map((c) => {
+ run(forward, c);
+ return [
+ ...forward.jointOutputs,
+ ...forward.blendShapeOutputs,
+ ...forward.animatedMapOutputs,
+ ];
+ });
+ const backward = new RigEvaluator(dna);
+ for (let i = cases.length - 1; i >= 0; i--) {
+ run(backward, cases[i]!);
+ expect([
+ ...backward.jointOutputs,
+ ...backward.blendShapeOutputs,
+ ...backward.animatedMapOutputs,
+ ]).toEqual(outputs[i]);
+ }
+ });
+
+ it("sets controls by name and refuses unknown ones and LODs", () => {
+ const rig = new RigEvaluator(dna);
+ rig.setGuiControls({ CTRL_jaw: 0.5 });
+ rig.mapGuiToRaw();
+ rig.calculate();
+ expect(rig.inputs[0]).toBeCloseTo(0.5, 6);
+ expect(rig.blendShapeOutputs[0]).toBeCloseTo(0.5, 6);
+ expect(() => rig.setRawControls({ nope: 1 })).toThrow(
+ /no raw control "nope"/,
+ );
+ expect(() => {
+ rig.lod = 2;
+ }).toThrow(/LOD 2 is not in the rig/);
+ });
+});
diff --git a/packages/dna/src/rig.ts b/packages/dna/src/rig.ts
new file mode 100644
index 00000000..b19aa369
--- /dev/null
+++ b/packages/dna/src/rig.ts
@@ -0,0 +1,369 @@
+/**
+ * Evaluates a DNA character's rig: controls in, deformation out.
+ *
+ * - GUI controls map to raw controls through a conditional table.
+ * - Pose-space controls (PSDs) are products of raw controls, for
+ * expressions that only look right in combination.
+ * - Joint groups are sparse matrices from controls to joint attribute
+ * deltas: per joint, translation, Euler rotation (the file's units and
+ * order) and scale, added to the neutral pose.
+ * - Blend shape channel weights copy controls.
+ * - Animated maps (wrinkle masks) come from a second conditional table.
+ * - Body correctives: RBF solvers turn joint rotations (quaternions the
+ * host puts in raw controls) into pose weights that drive controls, and
+ * twist/swing spreads a joint's rotation over helper joints
+ * (`rig-body.ts`).
+ *
+ * Each LOD uses the first rows of every table, so lower LODs do less work.
+ * Evaluation keeps no state between calls: the outputs depend only on the
+ * controls and the LOD, so rendering frame 200 directly equals rendering
+ * frames 0 to 200.
+ *
+ * Based on OpenRigLogic's RigLogic (MIT, Epic Games). Its scalar,
+ * full-precision path is the reference; `fixtures/oracle-eval.json` holds its
+ * outputs.
+ */
+import type { ConditionalTable, DnaFile } from "./read.js";
+import {
+ applyTwistSwing,
+ RbfSolverRuntime,
+ type TwistSwingRuntime,
+ twistSwingSetups,
+} from "./rig-body.js";
+
+/** Attributes per joint in `jointOutputs`: tx, ty, tz, rx, ry, rz, sx, sy, sz. */
+export const JOINT_ATTRIBUTES = 9;
+
+interface Psd {
+ /** Control index this PSD writes. */
+ output: number;
+ weight: number;
+ inputs: number[];
+}
+
+/** A conditional table with, per row, how many rows of its (input, output) run follow it. */
+interface Conditionals {
+ table: ConditionalTable;
+ skip: Uint16Array;
+}
+
+function conditionals(table: ConditionalTable): Conditionals {
+ const n = table.inputIndices.length;
+ const skip = new Uint16Array(n);
+ // Rows of one input feeding one output form a run of intervals: once one
+ // matches, the rest of the run is skipped.
+ for (let i = 0; i < n; ) {
+ let end = i + 1;
+ while (
+ end < n &&
+ table.inputIndices[end] === table.inputIndices[i] &&
+ table.outputIndices[end] === table.outputIndices[i]
+ )
+ end++;
+ for (let k = i; k < end; k++) skip[k] = end - 1 - k;
+ i = end;
+ }
+ return { table, skip };
+}
+
+/** Rows `0 … rows - 1` of a conditional table: each output sums its matching rows, clamped to 0 … 1. */
+function forward(
+ c: Conditionals,
+ inputs: Float32Array,
+ outputs: Float32Array,
+ rows: number,
+): void {
+ outputs.fill(0);
+ const t = c.table;
+ for (let row = 0; row < rows; row++) {
+ const value = inputs[t.inputIndices[row] as number] as number;
+ if (
+ (t.fromValues[row] as number) <= value &&
+ value <= (t.toValues[row] as number)
+ ) {
+ const out = t.outputIndices[row] as number;
+ outputs[out] =
+ (outputs[out] as number) +
+ (t.slopeValues[row] as number) * value +
+ (t.cutValues[row] as number);
+ row += c.skip[row] as number;
+ }
+ }
+ for (let i = 0; i < outputs.length; i++)
+ outputs[i] = Math.min(1, Math.max(0, outputs[i] as number));
+}
+
+export interface RigEvaluatorOptions {
+ /** Level of detail. Default 0. */
+ lod?: number;
+}
+
+export class RigEvaluator {
+ readonly guiControlNames: readonly string[];
+ readonly rawControlNames: readonly string[];
+ /** GUI control values; `mapGuiToRaw()` turns them into raw controls. */
+ readonly guiControls: Float32Array;
+ /** Raw controls, then PSD, machine-learned (not evaluated yet, 0) and RBF pose controls. */
+ readonly inputs: Float32Array;
+ /** Names of the RBF pose controls (the end of `inputs`). */
+ readonly rbfControlNames: readonly string[];
+ /** Per joint: translation, rotation, scale deltas from the neutral pose (`JOINT_ATTRIBUTES` each). */
+ readonly jointOutputs: Float32Array;
+ /** Per blend shape channel: its weight. */
+ readonly blendShapeOutputs: Float32Array;
+ /** Per animated map (wrinkle mask): its weight, 0 … 1. */
+ readonly animatedMapOutputs: Float32Array;
+
+ private readonly rawCount: number;
+ private readonly guiToRaw: Conditionals;
+ private readonly animatedMaps: Conditionals;
+ private readonly psds: Psd[];
+ /** Per LOD, the PSDs (by position in `psds`) some output at that LOD uses. */
+ private readonly psdsForLod: number[][];
+ private readonly dna: DnaFile;
+ private readonly solvers: RbfSolverRuntime[];
+ /** Per pose: the controls that gate it and the controls it writes. */
+ private readonly poseControls: NonNullable<DnaFile["rbf"]>["poseControls"];
+ private readonly twistSwing: TwistSwingRuntime[];
+ private lodIndex = 0;
+
+ constructor(dna: DnaFile, options: RigEvaluatorOptions = {}) {
+ const behavior = dna.behavior;
+ if (!behavior)
+ throw new Error("dna: the file was read without its rig behavior");
+ const def = dna.definition;
+ this.dna = dna;
+ this.guiControlNames = def.guiControlNames;
+ this.rawControlNames = def.rawControlNames;
+ this.rawCount = def.rawControlNames.length;
+ const psdCount = behavior.controls.psdCount;
+ const rbf = dna.rbf;
+ this.rbfControlNames = rbf?.poseControlNames ?? [];
+ this.guiControls = new Float32Array(def.guiControlNames.length);
+ this.inputs = new Float32Array(
+ this.rawCount +
+ psdCount +
+ (dna.mlControlNames?.length ?? 0) +
+ this.rbfControlNames.length,
+ );
+ const toRadians =
+ dna.descriptor.rotationUnit === "degrees" ? Math.PI / 180 : 1;
+ this.poseControls = rbf?.poseControls ?? [];
+ this.solvers = (rbf?.solvers ?? []).map(
+ (solver) =>
+ new RbfSolverRuntime(
+ solver,
+ Array.from(solver.poseIndices, (p) => rbf?.poses[p]?.scale ?? 1),
+ toRadians,
+ Array.from(solver.poseIndices).flatMap((p) =>
+ Array.from(this.poseControls[p]?.outputControlIndices ?? []),
+ ),
+ ),
+ );
+ this.twistSwing = twistSwingSetups(dna);
+ const quaternionJoints = new Set(
+ (dna.jointRepresentations ?? []).flatMap((r, j) =>
+ r.rotation === "quaternion" ? [j] : [],
+ ),
+ );
+ const blocked = behavior.joints.jointGroups.flatMap((g) =>
+ Array.from(g.jointIndices).filter((j) => quaternionJoints.has(j)),
+ );
+ if (blocked.length)
+ throw new Error(
+ `dna: joints ${blocked.map((j) => def.jointNames[j]).join(", ")} use quaternion joint groups, which are not evaluated yet`,
+ );
+ this.jointOutputs = new Float32Array(
+ def.jointNames.length * JOINT_ATTRIBUTES,
+ );
+ this.blendShapeOutputs = new Float32Array(
+ def.blendShapeChannelNames.length,
+ );
+ this.animatedMapOutputs = new Float32Array(def.animatedMapNames.length);
+ this.guiToRaw = conditionals(behavior.controls.conditionals);
+ this.animatedMaps = conditionals(behavior.animatedMaps.conditionals);
+
+ // PSDs: every (row, column, value) of the PSD matrix with one row is one PSD.
+ const { rows, columns, values } = behavior.controls.psds;
+ const byOutput = new Map<number, Psd>();
+ for (let i = 0; i < rows.length; i++) {
+ const output = rows[i] as number;
+ let psd = byOutput.get(output);
+ if (!psd) {
+ psd = { output, weight: 1, inputs: [] };
+ byOutput.set(output, psd);
+ }
+ psd.inputs.push(columns[i] as number);
+ psd.weight *= values[i] as number;
+ }
+ this.psds = [...byOutput.values()].sort((a, b) => a.output - b.output);
+ this.psdsForLod = Array.from(
+ { length: dna.descriptor.lodCount },
+ (_, lod) => {
+ const used = this.controlsUsed(lod);
+ return this.psds.flatMap((p, i) => (used.has(p.output) ? [i] : []));
+ },
+ );
+ this.lod = options.lod ?? 0;
+ }
+
+ get lod(): number {
+ return this.lodIndex;
+ }
+
+ set lod(value: number) {
+ if (
+ !Number.isInteger(value) ||
+ value < 0 ||
+ value >= this.dna.descriptor.lodCount
+ )
+ throw new Error(
+ `dna: LOD ${value} is not in the rig (it has ${this.dna.descriptor.lodCount})`,
+ );
+ this.lodIndex = value;
+ }
+
+ /** The controls any output reads at a LOD. */
+ private controlsUsed(lod: number): Set<number> {
+ const b = this.dna.behavior;
+ const used = new Set<number>();
+ if (!b) return used;
+ for (const g of b.joints.jointGroups) {
+ const rows = g.lods[lod] ?? 0;
+ const cols = g.inputIndices.length;
+ for (let c = 0; c < cols; c++)
+ for (let r = 0; r < rows; r++)
+ if ((g.values[r * cols + c] as number) !== 0) {
+ used.add(g.inputIndices[c] as number);
+ break;
+ }
+ }
+ const bs = b.blendShapeChannels;
+ for (let i = 0; i < (bs.lods[lod] ?? 0); i++)
+ used.add(bs.inputIndices[i] as number);
+ const am = b.animatedMaps;
+ for (let i = 0; i < (am.lods[lod] ?? 0); i++)
+ used.add(am.conditionals.inputIndices[i] as number);
+ return used;
+ }
+
+ /** The LOD's RBF solvers: each clears its outputs, weighs its poses, and adds them up. */
+ private calculateRbf(lod: number): void {
+ const map = this.dna.rbf?.lodSolverMapping;
+ if (!map) return;
+ const inputs = this.inputs;
+ for (const index of map.indices[map.lods[lod] as number] ?? []) {
+ const solver = this.solvers[index] as RbfSolverRuntime;
+ for (const o of solver.outputs) inputs[o] = 0;
+ solver.solve(inputs);
+ solver.solver.poseIndices.forEach((pose, i) => {
+ const pc = this.poseControls[pose];
+ if (!pc) return;
+ let gate = 1;
+ for (const c of pc.inputControlIndices) gate *= inputs[c] as number;
+ const weight = solver.weights[i] as number;
+ pc.outputControlIndices.forEach((o, k) => {
+ inputs[o] =
+ (inputs[o] as number) +
+ (pc.outputControlWeights[k] as number) * weight * gate;
+ });
+ });
+ }
+ }
+
+ /** Sets GUI controls by name (unnamed ones keep their values). */
+ setGuiControls(values: Record<string, number>): void {
+ this.setByName(this.guiControlNames, this.guiControls, values, "GUI");
+ }
+
+ /** Sets raw controls by name (unnamed ones keep their values). */
+ setRawControls(values: Record<string, number>): void {
+ this.setByName(this.rawControlNames, this.inputs, values, "raw");
+ }
+
+ private setByName(
+ names: readonly string[],
+ into: Float32Array,
+ values: Record<string, number>,
+ kind: string,
+ ) {
+ for (const [name, value] of Object.entries(values)) {
+ const i = names.indexOf(name);
+ if (i < 0) throw new Error(`dna: no ${kind} control "${name}"`);
+ into[i] = value;
+ }
+ }
+
+ /** Raw controls from the GUI controls (the rest of the raw controls become 0). */
+ mapGuiToRaw(): void {
+ forward(
+ this.guiToRaw,
+ this.guiControls,
+ this.inputs.subarray(0, this.rawCount),
+ this.guiToRaw.table.inputIndices.length,
+ );
+ }
+
+ /** Every output from the current raw controls, at the current LOD. */
+ calculate(): void {
+ const lod = this.lodIndex;
+ const b = this.dna.behavior as NonNullable<DnaFile["behavior"]>;
+ const inputs = this.inputs;
+
+ // Everything after the raw controls is computed from them, frame by frame.
+ inputs.fill(0, this.rawCount);
+ this.calculateRbf(lod);
+
+ // PSDs read their inputs clamped to 0 … 1, as they were before this pass.
+ const clamped = Float32Array.from(inputs, (v) =>
+ Math.min(1, Math.max(0, v)),
+ );
+ for (const i of this.psdsForLod[lod] ?? []) {
+ const psd = this.psds[i] as Psd;
+ let value = psd.weight;
+ for (const input of psd.inputs) value *= clamped[input] as number;
+ inputs[psd.output] = Math.min(1, value);
+ }
+
+ const out = this.jointOutputs;
+ out.fill(0);
+ for (const g of b.joints.jointGroups) {
+ const rows = g.lods[lod] ?? 0;
+ const cols = g.inputIndices.length;
+ for (let r = 0; r < rows; r++) {
+ let sum = 0;
+ for (let c = 0; c < cols; c++)
+ sum +=
+ (g.values[r * cols + c] as number) *
+ (inputs[g.inputIndices[c] as number] as number);
+ const o = g.outputIndices[r] as number;
+ out[o] = (out[o] as number) + sum;
+ }
+ }
+
+ const d = this.dna.descriptor;
+ applyTwistSwing(
+ this.twistSwing,
+ inputs,
+ out,
+ JOINT_ATTRIBUTES,
+ d.rotationSequence,
+ d.rotationSign,
+ d.rotationUnit === "degrees" ? 180 / Math.PI : 1,
+ );
+
+ const bs = b.blendShapeChannels;
+ this.blendShapeOutputs.fill(0);
+ for (let i = 0; i < (bs.lods[lod] ?? 0); i++)
+ this.blendShapeOutputs[bs.outputIndices[i] as number] = inputs[
+ bs.inputIndices[i] as number
+ ] as number;
+
+ forward(
+ this.animatedMaps,
+ inputs,
+ this.animatedMapOutputs,
+ b.animatedMaps.lods[lod] ?? 0,
+ );
+ }
+}
diff --git a/packages/dna/src/space.ts b/packages/dna/src/space.ts
new file mode 100644
index 00000000..bc861aaa
--- /dev/null
+++ b/packages/dna/src/space.ts
@@ -0,0 +1,104 @@
+/**
+ * From a DNA file's space to glTF's. A DNA descriptor names where each of
+ * its axes points (`right`, `up`, `front`, …) and its units; glTF is y-up,
+ * the character faces +z, and the viewer's right (the character's left) is
+ * +x. Joint rotations are Euler angles in the file's order and signs.
+ *
+ * The Euler convention follows OpenRigLogic's `tdm` (MIT, Epic Games): for
+ * the order `xyz`, x turns first, then y, then z (q = qz · qy · qx).
+ */
+import { type Quat, quatMultiply, type Vec3 } from "@framefields/forge";
+import type { AxisDirection, DnaDescriptor, RotationSequence } from "./read.js";
+
+const DIRECTION: Record<AxisDirection, Vec3> = {
+ right: [1, 0, 0],
+ left: [-1, 0, 0],
+ up: [0, 1, 0],
+ down: [0, -1, 0],
+ front: [0, 0, 1],
+ back: [0, 0, -1],
+};
+
+/** A change of axes (orthonormal, maybe mirroring) and of units. */
+export interface Space {
+ /** Columns: where the file's x, y and z go in glTF. */
+ axes: [Vec3, Vec3, Vec3];
+ /** +1, or -1 when the file is mirrored relative to glTF (left-handed). */
+ handedness: 1 | -1;
+ /** File translation units to output units. */
+ scale: number;
+ /** File rotation units to radians. */
+ angle: number;
+ sequence: RotationSequence;
+ sign: [number, number, number];
+}
+
+export function spaceOf(d: DnaDescriptor, units: "cm" | "m"): Space {
+ const axes = d.coordinateSystem.map((a) => DIRECTION[a]) as [
+ Vec3,
+ Vec3,
+ Vec3,
+ ];
+ const [a, b, c] = axes;
+ const det =
+ a[0] * (b[1] * c[2] - b[2] * c[1]) -
+ a[1] * (b[0] * c[2] - b[2] * c[0]) +
+ a[2] * (b[0] * c[1] - b[1] * c[0]);
+ if (Math.abs(det) !== 1)
+ throw new Error(
+ `dna: axes ${d.coordinateSystem.join(", ")} do not span space`,
+ );
+ const fileCm = d.translationUnit === "m" ? 100 : 1;
+ return {
+ axes,
+ handedness: det > 0 ? 1 : -1,
+ scale: units === "m" ? fileCm / 100 : fileCm,
+ angle: d.rotationUnit === "degrees" ? Math.PI / 180 : 1,
+ sequence: d.rotationSequence,
+ sign: d.rotationSign,
+ };
+}
+
+/** A file direction (normal, axis) in glTF axes. */
+export function direction(s: Space, x: number, y: number, z: number): Vec3 {
+ const [a, b, c] = s.axes;
+ return [
+ a[0] * x + b[0] * y + c[0] * z,
+ a[1] * x + b[1] * y + c[1] * z,
+ a[2] * x + b[2] * y + c[2] * z,
+ ];
+}
+
+/** A file position (or offset) in glTF axes and output units. */
+export function point(s: Space, x: number, y: number, z: number): Vec3 {
+ const d = direction(s, x, y, z);
+ return [d[0] * s.scale, d[1] * s.scale, d[2] * s.scale];
+}
+
+const AXIS = { x: 0, y: 1, z: 2 } as const;
+
+/** Euler angles (file units, order and signs) as a quaternion in the file's axes. */
+export function eulerQuat(s: Space, x: number, y: number, z: number): Quat {
+ const angles = [
+ x * s.sign[0] * s.angle,
+ y * s.sign[1] * s.angle,
+ z * s.sign[2] * s.angle,
+ ];
+ let q: Quat = [0, 0, 0, 1];
+ for (const letter of s.sequence) {
+ const k = AXIS[letter as keyof typeof AXIS];
+ const half = (angles[k] as number) / 2;
+ const turn: Quat = [0, 0, 0, Math.cos(half)];
+ turn[k] = Math.sin(half);
+ // Each later axis turns after the earlier ones.
+ q = quatMultiply(turn, q);
+ }
+ return q;
+}
+
+/** A rotation in the file's axes as one in glTF's: the same turn, about the converted axis. */
+export function rotation(s: Space, q: Quat): Quat {
+ const v = direction(s, q[0], q[1], q[2]);
+ // A mirror flips which way a turn about an axis goes.
+ return [v[0] * s.handedness, v[1] * s.handedness, v[2] * s.handedness, q[3]];
+}
diff --git a/packages/dna/src/to-glb.ts b/packages/dna/src/to-glb.ts
new file mode 100644
index 00000000..c6ba2ea9
--- /dev/null
+++ b/packages/dna/src/to-glb.ts
@@ -0,0 +1,327 @@
+/**
+ * A DNA character as glTF: its joints at their neutral pose (with rest
+ * orientations), and the meshes of one LOD, skinned, with their blend shape
+ * targets as named morph targets. Loaded with `Layer.glb`, it then takes
+ * `pose`, `aim`, `lookAt`, IK and `morphs` like any character.
+ */
+import {
+ GltfDocument,
+ type MaterialRef,
+ type MaterialSpec,
+ type MorphTargetSpec,
+ type NodeRef,
+ type Quat,
+ quatMultiply,
+ quatRotate,
+ Skeleton,
+ type SkeletonRefs,
+ type Vec3,
+} from "@framefields/forge";
+import { meshRole, roleMaterial } from "./materials.js";
+import type { DnaFile, DnaMesh } from "./read.js";
+import {
+ direction,
+ eulerQuat,
+ point,
+ rotation,
+ type Space,
+ spaceOf,
+} from "./space.js";
+
+export interface DnaToGltfOptions {
+ /** Level of detail (0 is the most detailed). Default 0. */
+ lod?: number;
+ /** Output units. Default "cm", like forge humans. */
+ units?: "cm" | "m";
+ /** Blend shape targets as morph targets. Default true. */
+ blendShapes?: boolean;
+ /**
+ * Skin influences kept per vertex: 8 (glTF's two sets, only written
+ * where a vertex has more than four) or 4. Default 8.
+ */
+ influences?: 4 | 8;
+ /**
+ * Material per mesh, by mesh name (or a function of it, like
+ * `dnaMaterials(…).materials`). Default: the material of the mesh's role
+ * (skin, teeth, eye, eye shell, lashes, …) without textures.
+ */
+ materials?:
+ | Record<string, MaterialSpec>
+ | ((mesh: string) => MaterialSpec | undefined);
+ /** Name of the character's root node. Default: the descriptor's name. */
+ name?: string;
+}
+
+export interface AddedDna {
+ rig: SkeletonRefs;
+ /** Mesh nodes by DNA mesh name. */
+ meshes: Map<string, NodeRef>;
+ materials: Map<string, MaterialRef>;
+}
+
+/** The DNA character written as a GLB. */
+export function dnaToGlb(
+ dna: DnaFile,
+ options: DnaToGltfOptions = {},
+): Uint8Array {
+ const doc = new GltfDocument();
+ addDna(doc, dna, options);
+ return doc.toGlb();
+}
+
+/** Writes the DNA character into `doc`: skeleton, then one skinned node per mesh of the LOD. */
+export function addDna(
+ doc: GltfDocument,
+ dna: DnaFile,
+ options: DnaToGltfOptions = {},
+): AddedDna {
+ const space = spaceOf(dna.descriptor, options.units ?? "cm");
+ const skeleton = dnaSkeleton(dna, space);
+ const rig = doc.addSkeleton(skeleton.skeleton);
+ const meshes = new Map<string, NodeRef>();
+ const materials = new Map<string, MaterialRef>();
+ const geometry = dna.geometry?.meshes;
+ if (!geometry) return { rig, meshes, materials };
+ for (const m of lodMeshes(dna, options.lod ?? 0)) {
+ const mesh = geometry[m];
+ if (!mesh)
+ throw new Error(`dna: mesh ${m} is listed for the LOD but missing`);
+ const name = dna.definition.meshNames[m] ?? `mesh${m}`;
+ // Nothing to draw (an empty placeholder mesh).
+ if (!mesh.layouts.positions.length || !mesh.faces.length) continue;
+ const material = doc.addMaterial({ name, ...materialFor(options, name) });
+ materials.set(name, material);
+ const primitive = meshPrimitive(
+ dna,
+ mesh,
+ space,
+ skeleton.order,
+ options.blendShapes !== false,
+ options.influences ?? 8,
+ );
+ meshes.set(
+ name,
+ doc.addNode({
+ name,
+ mesh: doc.addMesh({ name, primitives: [{ ...primitive, material }] }),
+ skin: rig.skin,
+ }),
+ );
+ }
+ return { rig, meshes, materials };
+}
+
+function materialFor(options: DnaToGltfOptions, mesh: string): MaterialSpec {
+ const m = options.materials;
+ const own = typeof m === "function" ? m(mesh) : m?.[mesh];
+ return own ?? roleMaterial(meshRole(mesh));
+}
+
+/** The meshes a LOD uses. */
+export function lodMeshes(dna: DnaFile, lod: number): number[] {
+ const map = dna.definition.lodMeshMapping;
+ if (lod < 0 || lod >= map.lods.length)
+ throw new Error(
+ `dna: LOD ${lod} is not in the file (it has ${map.lods.length})`,
+ );
+ return Array.from(map.indices[map.lods[lod] as number] ?? []);
+}
+
+/**
+ * The joints at their neutral pose in glTF space, parents first. `order`
+ * maps a DNA joint index to its index in the skeleton (and so in the skin).
+ */
+export function dnaSkeleton(
+ dna: DnaFile,
+ space: Space,
+): { skeleton: Skeleton; order: Int32Array } {
+ const def = dna.definition;
+ const n = def.jointNames.length;
+ const parent = (j: number) => {
+ const p = def.jointHierarchy[j] as number;
+ return p === j || p >= n ? -1 : p;
+ };
+ // World transforms in the file's axes, parents first.
+ const worldRot: Quat[] = new Array(n);
+ const worldPos: Vec3[] = new Array(n);
+ const done = new Uint8Array(n);
+ const visit = (j: number, depth: number): void => {
+ if (done[j]) return;
+ if (depth > n) throw new Error("dna: the joint hierarchy has a cycle");
+ const p = parent(j);
+ if (p >= 0) visit(p, depth + 1);
+ const t = def.neutralJointTranslations;
+ const r = def.neutralJointRotations;
+ const local = eulerQuat(
+ space,
+ r.xs[j] as number,
+ r.ys[j] as number,
+ r.zs[j] as number,
+ );
+ const offset: Vec3 = [
+ t.xs[j] as number,
+ t.ys[j] as number,
+ t.zs[j] as number,
+ ];
+ if (p < 0) {
+ worldRot[j] = local;
+ worldPos[j] = offset;
+ } else {
+ worldRot[j] = quatMultiply(worldRot[p] as Quat, local);
+ const d = quatRotate(worldRot[p] as Quat, offset);
+ const pp = worldPos[p] as Vec3;
+ worldPos[j] = [pp[0] + d[0], pp[1] + d[1], pp[2] + d[2]];
+ }
+ done[j] = 1;
+ };
+ for (let j = 0; j < n; j++) visit(j, 0);
+
+ // Parents first: a depth-first walk from the roots.
+ const children: number[][] = Array.from({ length: n }, () => []);
+ const roots: number[] = [];
+ for (let j = 0; j < n; j++) {
+ const p = parent(j);
+ if (p < 0) roots.push(j);
+ else (children[p] as number[]).push(j);
+ }
+ const skeleton = new Skeleton();
+ const order = new Int32Array(n).fill(-1);
+ let next = 0;
+ const stack = [...roots].reverse();
+ while (stack.length) {
+ const j = stack.pop() as number;
+ const p = parent(j);
+ const w = worldPos[j] as Vec3;
+ skeleton.add(def.jointNames[j] ?? `joint${j}`, {
+ at: point(space, w[0], w[1], w[2]),
+ orient: rotation(space, worldRot[j] as Quat),
+ ...(p < 0 ? {} : { parent: def.jointNames[p] ?? `joint${p}` }),
+ });
+ order[j] = next++;
+ for (const c of [...(children[j] as number[])].reverse()) stack.push(c);
+ }
+ return { skeleton, order };
+}
+
+/**
+ * One mesh as a glTF primitive: a vertex per layout (position, UV and
+ * normal indices), polygons fanned into triangles, the strongest four skin
+ * influences per vertex, and blend shape targets spread to every vertex
+ * that shares a moved position.
+ */
+function meshPrimitive(
+ dna: DnaFile,
+ mesh: DnaMesh,
+ space: Space,
+ order: Int32Array,
+ blendShapes: boolean,
+ limit: 4 | 8,
+) {
+ const L = mesh.layouts.positions.length;
+ const positions = new Float32Array(L * 3);
+ const normals = new Float32Array(L * 3);
+ const uvs = new Float32Array(L * 2);
+ for (let v = 0; v < L; v++) {
+ const p = mesh.layouts.positions[v] as number;
+ const t = mesh.layouts.uvs[v] as number;
+ const nn = mesh.layouts.normals[v] as number;
+ positions.set(
+ point(
+ space,
+ mesh.positions.xs[p] ?? 0,
+ mesh.positions.ys[p] ?? 0,
+ mesh.positions.zs[p] ?? 0,
+ ),
+ v * 3,
+ );
+ const nv = direction(
+ space,
+ mesh.normals.xs[nn] ?? 0,
+ mesh.normals.ys[nn] ?? 0,
+ mesh.normals.zs[nn] ?? 1,
+ );
+ const l = Math.hypot(nv[0], nv[1], nv[2]) || 1;
+ normals.set([nv[0] / l, nv[1] / l, nv[2] / l], v * 3);
+ // DNA UVs have v up; glTF's v runs down the image.
+ uvs[v * 2] = mesh.uvs.us[t] ?? 0;
+ uvs[v * 2 + 1] = 1 - (mesh.uvs.vs[t] ?? 0);
+ }
+
+ // Mirrored axes or clockwise faces turn the winding around.
+ const flip =
+ (dna.descriptor.faceWindingOrder === "cw") !== space.handedness < 0;
+ const indices: number[] = [];
+ for (const face of mesh.faces)
+ for (let k = 1; k + 1 < face.length; k++) {
+ const a = face[0] as number;
+ const b = face[k] as number;
+ const c = face[k + 1] as number;
+ if (flip) indices.push(a, c, b);
+ else indices.push(a, b, c);
+ }
+
+ // Each vertex's influences: a joint listed more than once adds up, the
+ // strongest `limit` stay. Eight (two glTF sets) only when some vertex has more than four.
+ const influences = Array.from({ length: L }, (_, v) => {
+ const sw = mesh.skinWeights[mesh.layouts.positions[v] as number];
+ const byJoint = new Map<number, number>();
+ sw?.weights.forEach((w, i) => {
+ const j = order[sw.jointIndices[i] as number] as number;
+ if (w > 0 && j >= 0) byJoint.set(j, (byJoint.get(j) ?? 0) + w);
+ });
+ return [...byJoint].sort((x, y) => y[1] - x[1]).slice(0, limit);
+ });
+ const size = influences.some((list) => list.length > 4) ? 8 : 4;
+ const joints = new Uint16Array(L * size);
+ const weights = new Float32Array(L * size);
+ influences.forEach((list, v) => {
+ // Unweighted: follows the first joint.
+ if (!list.length) weights[v * size] = 1;
+ const sum = list.reduce((t, [, w]) => t + w, 0) || 1;
+ list.forEach(([j, w], k) => {
+ joints[v * size + k] = j;
+ weights[v * size + k] = w / sum;
+ });
+ });
+
+ const targets: MorphTargetSpec[] = [];
+ if (blendShapes && mesh.blendShapeTargets.length) {
+ // Every layout vertex that uses a position.
+ const users = new Map<number, number[]>();
+ for (let v = 0; v < L; v++) {
+ const p = mesh.layouts.positions[v] as number;
+ const list = users.get(p);
+ if (list) list.push(v);
+ else users.set(p, [v]);
+ }
+ const names = dna.definition.blendShapeChannelNames;
+ const seen = new Set<string>();
+ for (const target of mesh.blendShapeTargets) {
+ let name = names[target.channel] ?? `channel${target.channel}`;
+ // Morph target names must be unique within a mesh.
+ if (seen.has(name)) name = `${name}_${target.channel}`;
+ seen.add(name);
+ const deltas = new Float32Array(L * 3);
+ for (let i = 0; i < target.vertexIndices.length; i++) {
+ const d = point(
+ space,
+ target.deltas.xs[i] ?? 0,
+ target.deltas.ys[i] ?? 0,
+ target.deltas.zs[i] ?? 0,
+ );
+ for (const v of users.get(target.vertexIndices[i] as number) ?? [])
+ deltas.set(d, v * 3);
+ }
+ targets.push({ name, positions: deltas });
+ }
+ }
+ return {
+ positions,
+ normals,
+ uvs,
+ indices,
+ joints,
+ weights,
+ ...(targets.length ? { targets } : {}),
+ };
+}
diff --git a/packages/dna/src/write-dna.test-util.ts b/packages/dna/src/write-dna.test-util.ts
new file mode 100644
index 00000000..51a30a9f
--- /dev/null
+++ b/packages/dna/src/write-dna.test-util.ts
@@ -0,0 +1,300 @@
+/**
+ * Writes small DNA files for tests, in the layout `readDna` reads (file
+ * versions 2.1 and 2.8). Tests only: it covers the layers the reader reads.
+ */
+import type {
+ DnaBehavior,
+ DnaDefinition,
+ DnaDescriptor,
+ DnaMesh,
+ LodMapping,
+ Vec3Array,
+} from "./read.js";
+
+class ByteWriter {
+ private chunks: number[] = [];
+ private readonly view = new DataView(new ArrayBuffer(8));
+
+ get offset(): number {
+ return this.chunks.length;
+ }
+
+ private put(n: number) {
+ for (let i = 0; i < n; i++) this.chunks.push(this.view.getUint8(i));
+ }
+ u8(v: number) {
+ this.chunks.push(v & 255);
+ }
+ u16(v: number) {
+ this.view.setUint16(0, v);
+ this.put(2);
+ }
+ u32(v: number) {
+ this.view.setUint32(0, v >>> 0);
+ this.put(4);
+ }
+ i32(v: number) {
+ this.view.setInt32(0, v);
+ this.put(4);
+ }
+ f32(v: number) {
+ this.view.setFloat32(0, v);
+ this.put(4);
+ }
+ chars(s: string) {
+ for (const b of new TextEncoder().encode(s)) this.chunks.push(b);
+ }
+ string(s: string) {
+ const b = new TextEncoder().encode(s);
+ this.u32(b.length);
+ for (const x of b) this.chunks.push(x);
+ }
+ u16s(a: ArrayLike<number>) {
+ this.u32(a.length);
+ for (let i = 0; i < a.length; i++) this.u16(a[i] as number);
+ }
+ u32s(a: ArrayLike<number>) {
+ this.u32(a.length);
+ for (let i = 0; i < a.length; i++) this.u32(a[i] as number);
+ }
+ f32s(a: ArrayLike<number>) {
+ this.u32(a.length);
+ for (let i = 0; i < a.length; i++) this.f32(a[i] as number);
+ }
+ list<T>(items: readonly T[], each: (w: ByteWriter, item: T) => void) {
+ this.u32(items.length);
+ for (const item of items) each(this, item);
+ }
+ patchU32(at: number, v: number) {
+ this.view.setUint32(0, v >>> 0);
+ for (let i = 0; i < 4; i++) this.chunks[at + i] = this.view.getUint8(i);
+ }
+ bytes(): Uint8Array {
+ return Uint8Array.from(this.chunks);
+ }
+}
+
+const AXES = ["left", "right", "up", "down", "front", "back"];
+const SEQUENCES = ["xyz", "xzy", "yxz", "yzx", "zxy", "zyx"];
+
+export interface TestDna {
+ descriptor: DnaDescriptor;
+ definition: DnaDefinition;
+ behavior: DnaBehavior;
+ meshes: DnaMesh[];
+}
+
+function descriptor(w: ByteWriter, d: DnaDescriptor) {
+ w.string(d.name);
+ w.u16(d.archetype);
+ w.u16(d.gender);
+ w.u16(d.age);
+ w.list(d.metadata, (x, [k, v]) => {
+ x.string(k);
+ x.string(v);
+ });
+ w.u16(d.translationUnit === "m" ? 1 : 0);
+ w.u16(d.rotationUnit === "radians" ? 1 : 0);
+ for (const a of d.coordinateSystem) w.u16(AXES.indexOf(a));
+ w.u16(d.lodCount);
+ w.u16(d.maxLOD);
+ w.string(d.complexity);
+ w.string(d.dbName);
+}
+
+function descriptorExt(w: ByteWriter, d: DnaDescriptor) {
+ w.u32(SEQUENCES.indexOf(d.rotationSequence));
+ for (const s of d.rotationSign) w.i32(s);
+ w.u8(d.faceWindingOrder === "cw" ? 1 : 0);
+}
+
+function lodMapping(w: ByteWriter, m: LodMapping) {
+ w.u16s(m.lods);
+ w.list(m.indices, (x, row) => x.u16s(row));
+}
+
+function vec3s(w: ByteWriter, v: Vec3Array) {
+ w.f32s(v.xs);
+ w.f32s(v.ys);
+ w.f32s(v.zs);
+}
+
+function definition(w: ByteWriter, d: DnaDefinition) {
+ lodMapping(w, d.lodJointMapping);
+ lodMapping(w, d.lodBlendShapeMapping);
+ lodMapping(w, d.lodAnimatedMapMapping);
+ lodMapping(w, d.lodMeshMapping);
+ for (const names of [
+ d.guiControlNames,
+ d.rawControlNames,
+ d.jointNames,
+ d.blendShapeChannelNames,
+ d.animatedMapNames,
+ d.meshNames,
+ ])
+ w.list(names, (x, s) => x.string(s));
+ w.u16s(d.meshBlendShapeChannelMapping.from);
+ w.u16s(d.meshBlendShapeChannelMapping.to);
+ w.u16s(d.jointHierarchy);
+ vec3s(w, d.neutralJointTranslations);
+ vec3s(w, d.neutralJointRotations);
+}
+
+function conditional(
+ w: ByteWriter,
+ c: DnaBehavior["controls"]["conditionals"],
+) {
+ w.u16s(c.inputIndices);
+ w.u16s(c.outputIndices);
+ w.f32s(c.fromValues);
+ w.f32s(c.toValues);
+ w.f32s(c.slopeValues);
+ w.f32s(c.cutValues);
+}
+
+function controls(w: ByteWriter, b: DnaBehavior) {
+ w.u16(b.controls.psdCount);
+ conditional(w, b.controls.conditionals);
+ w.u16s(b.controls.psds.rows);
+ w.u16s(b.controls.psds.columns);
+ w.f32s(b.controls.psds.values);
+}
+function joints(w: ByteWriter, b: DnaBehavior) {
+ w.u16(b.joints.rowCount);
+ w.u16(b.joints.colCount);
+ w.list(b.joints.jointGroups, (x, g) => {
+ x.u16s(g.lods);
+ x.u16s(g.inputIndices);
+ x.u16s(g.outputIndices);
+ x.f32s(g.values);
+ x.u16s(g.jointIndices);
+ });
+}
+function blendShapes(w: ByteWriter, b: DnaBehavior) {
+ w.u16s(b.blendShapeChannels.lods);
+ w.u16s(b.blendShapeChannels.inputIndices);
+ w.u16s(b.blendShapeChannels.outputIndices);
+}
+function animatedMaps(w: ByteWriter, b: DnaBehavior) {
+ w.u16s(b.animatedMaps.lods);
+ conditional(w, b.animatedMaps.conditionals);
+}
+
+function meshBody(w: ByteWriter, m: DnaMesh) {
+ vec3s(w, m.positions);
+ w.f32s(m.uvs.us);
+ w.f32s(m.uvs.vs);
+ vec3s(w, m.normals);
+ w.u32s(m.layouts.positions);
+ w.u32s(m.layouts.uvs);
+ w.u32s(m.layouts.normals);
+ w.list(m.faces, (x, f) => x.u32s(f));
+ w.u16(m.maximumInfluencePerVertex);
+ w.list(m.skinWeights, (x, s) => {
+ x.f32s(s.weights);
+ x.u16s(s.jointIndices);
+ });
+ w.list(m.blendShapeTargets, (x, t) => {
+ vec3s(x, t.deltas);
+ x.u32s(t.vertexIndices);
+ x.u16(t.channel);
+ });
+}
+
+const sid = (s: string) =>
+ ((s.charCodeAt(0) << 24) |
+ (s.charCodeAt(1) << 16) |
+ (s.charCodeAt(2) << 8) |
+ s.charCodeAt(3)) >>>
+ 0;
+
+/** A 2.8 file: the layer index, then descriptor, extension, definition, behavior and geometry layers. */
+export function writeDna28(dna: TestDna): Uint8Array {
+ const w = new ByteWriter();
+ w.chars("DNA");
+ w.u16(2);
+ w.u16(8);
+ const layers: [string, number, (x: ByteWriter) => void][] = [
+ ["desc", 0x10001, (x) => descriptor(x, dna.descriptor)],
+ ["defn", 0x10001, (x) => definition(x, dna.definition)],
+ [
+ "bhvr",
+ 0x10001,
+ (x) => {
+ controls(x, dna.behavior);
+ joints(x, dna.behavior);
+ blendShapes(x, dna.behavior);
+ animatedMaps(x, dna.behavior);
+ },
+ ],
+ [
+ "geom",
+ 0x10001,
+ (x) =>
+ x.list(dna.meshes, (y, m) => {
+ const sizeAt = y.offset;
+ y.u32(0);
+ const base = y.offset;
+ meshBody(y, m);
+ y.patchU32(sizeAt, y.offset - base);
+ }),
+ ],
+ // A layer the reader skips: no twists, no swings.
+ [
+ "twsw",
+ 0x10000,
+ (x) => {
+ x.u32(0);
+ x.u32(0);
+ },
+ ],
+ ["dsce", 0x10000, (x) => descriptorExt(x, dna.descriptor)],
+ ];
+ w.u32(layers.length);
+ const slots = layers.map(([id, version]) => {
+ w.u32(sid(id));
+ w.u32(version);
+ const at = w.offset;
+ w.u32(0);
+ w.u32(0);
+ return at;
+ });
+ layers.forEach(([, , body], i) => {
+ const start = w.offset;
+ body(w);
+ w.patchU32(slots[i] as number, start);
+ w.patchU32((slots[i] as number) + 4, w.offset - start);
+ });
+ return w.bytes();
+}
+
+/** A 2.1 file: the section table, then the sections, then the closing signature. */
+export function writeDna21(dna: TestDna): Uint8Array {
+ const w = new ByteWriter();
+ w.chars("DNA");
+ w.u16(2);
+ w.u16(1);
+ const table = w.offset;
+ for (let i = 0; i < 8; i++) w.u32(0);
+ const section = (k: number, body: () => void) => {
+ w.patchU32(table + k * 4, w.offset);
+ body();
+ };
+ section(0, () => descriptor(w, dna.descriptor));
+ section(1, () => definition(w, dna.definition));
+ section(2, () => {});
+ section(3, () => controls(w, dna.behavior));
+ section(4, () => joints(w, dna.behavior));
+ section(5, () => blendShapes(w, dna.behavior));
+ section(6, () => animatedMaps(w, dna.behavior));
+ section(7, () =>
+ w.list(dna.meshes, (y, m) => {
+ const endAt = y.offset;
+ y.u32(0);
+ meshBody(y, m);
+ y.patchU32(endAt, y.offset);
+ }),
+ );
+ w.chars("AND");
+ return w.bytes();
+}
diff --git a/packages/dna/tsconfig.json b/packages/dna/tsconfig.json
new file mode 100644
index 00000000..c00e3e04
--- /dev/null
+++ b/packages/dna/tsconfig.json
@@ -0,0 +1,9 @@
+{
+ "extends": "@framefields/tsconfig/base.json",
+ "compilerOptions": {
+ "lib": ["ES2022", "ESNext"],
+ "types": ["node"]
+ },
+ "include": ["src"],
+ "exclude": ["dist", "node_modules"]
+}
diff --git a/packages/dna/tsdown.config.ts b/packages/dna/tsdown.config.ts
new file mode 100644
index 00000000..94257a01
--- /dev/null
+++ b/packages/dna/tsdown.config.ts
@@ -0,0 +1,10 @@
+import { defineConfig } from "tsdown";
+
+export default defineConfig({
+ entry: ["src/index.ts"],
+ format: ["esm"],
+ dts: true,
+ clean: true,
+ sourcemap: true,
+ treeshake: true,
+});
diff --git a/packages/forge/package.json b/packages/forge/package.json
index f5e33f3a..af5e6553 100644
--- a/packages/forge/package.json
+++ b/packages/forge/package.json
@@ -24,8 +24,7 @@
"dev": "tsdown --watch",
"typecheck": "tsc --noEmit -p .",
"test": "vitest run",
- "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
- "pin:makehuman": "tsx scripts/pin-makehuman.ts"
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},
"devDependencies": {
"@framefields/tsconfig": "workspace:*",
@@ -36,8 +35,5 @@
"typescript": "^5.8.3",
"vitest": "^4.1.5",
"tsx": "^4.20.3"
- },
- "dependencies": {
- "@framefields/storage": "workspace:*"
}
}
diff --git a/packages/forge/scripts/pin-makehuman.ts b/packages/forge/scripts/pin-makehuman.ts
deleted file mode 100644
index 8e31db35..00000000
--- a/packages/forge/scripts/pin-makehuman.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Regenerates src/human/makehuman-pins.ts: every CC0 asset file of the
- * MakeHuman commit below (base mesh, targets, rig, eyes), with its exact size
- * and SHA-256. Downloads each file once into the forge cache so the pins are
- * computed from the bytes themselves. Run with `pnpm --filter @framefields/forge pin:makehuman`.
- */
-import { createHash } from "node:crypto";
-import { mkdir, writeFile } from "node:fs/promises";
-import { dirname, join } from "node:path";
-import { MAKEHUMAN_SOURCE } from "../src/human/source.js";
-import { humanCacheDir } from "../src/human/store.js";
-
-const KEEP =
- /^makehuman\/data\/(3dobjs\/base\.obj|rigs\/default\.mhskel|rigs\/default_weights\.mhw|targets\/.+\.target|eyes\/.+)$/;
-
-const { repo, commit } = MAKEHUMAN_SOURCE;
-const tree = (await (
- await fetch(
- `https://api.github.com/repos/${repo}/git/trees/${commit}?recursive=1`,
- )
-).json()) as {
- truncated: boolean;
- tree: { path: string; type: string; size?: number }[];
-};
-if (tree.truncated) throw new Error("tree listing truncated");
-const files = tree.tree.filter((t) => t.type === "blob" && KEEP.test(t.path));
-const root = humanCacheDir();
-const pins: [string, number, string][] = [];
-let done = 0;
-const queue = [...files];
-await Promise.all(
- Array.from({ length: 16 }, async () => {
- for (let f = queue.shift(); f; f = queue.shift()) {
- const url = `https://raw.githubusercontent.com/${repo}/${commit}/${f.path}`;
- const res = await fetch(url);
- if (!res.ok) throw new Error(`${url}: HTTP ${res.status}`);
- const bytes = new Uint8Array(await res.arrayBuffer());
- if (bytes.byteLength !== f.size)
- throw new Error(
- `${f.path}: ${bytes.byteLength} bytes, tree says ${f.size}`,
- );
- const rel = f.path.replace(/^makehuman\/data\//, "");
- const dest = join(root, rel);
- await mkdir(dirname(dest), { recursive: true });
- await writeFile(dest, bytes);
- pins.push([
- rel,
- bytes.byteLength,
- createHash("sha256").update(bytes).digest("hex"),
- ]);
- if (++done % 200 === 0) console.log(`${done}/${files.length}`);
- }
- }),
-);
-pins.sort((a, b) => (a[0] < b[0] ? -1 : 1));
-const out = join(import.meta.dirname, "../src/human/makehuman-pins.ts");
-await writeFile(
- out,
- `// biome-ignore-all format: generated by scripts/pin-makehuman.ts
-// biome-ignore-all lint: generated data
-/** Every pinned MakeHuman asset file: [path under makehuman/data/, bytes, SHA-256]. Generated by \`pnpm pin:makehuman\`. */
-export const MAKEHUMAN_PINS: { commit: string; files: [string, number, string][] } = { commit: "${commit}", files: ${JSON.stringify(pins)} };
-`,
-);
-console.log(
- out,
- pins.length,
- "files",
- pins.reduce((s, p) => s + p[1], 0),
- "bytes",
-);
-process.exit(0);
diff --git a/packages/forge/src/document.ts b/packages/forge/src/document.ts
index 451b5ecd..c6cb95d7 100644
--- a/packages/forge/src/document.ts
+++ b/packages/forge/src/document.ts
@@ -21,7 +21,12 @@ import {
materialJson,
type TextureRef,
} from "./material.js";
-import type { Skeleton } from "./skeleton.js";
+import {
+ quatConjugate,
+ quatRotate,
+ type Skeleton,
+ type Vec3,
+} from "./skeleton.js";
import { computeTangents } from "./tangents.js";
type Numbers = ArrayLike<number>;
@@ -48,9 +53,12 @@ export interface PrimitiveSpec {
uvs1?: Numbers;
/** Vertex color, linear RGBA, 4 per vertex. */
colors?: Numbers;
- /** 4 joint indices per vertex, into the skin's joint list. */
+ /**
+ * 4 joint indices per vertex, into the skin's joint list, or 8 (written
+ * as glTF's two sets, JOINTS_0 and JOINTS_1) for faces that need them.
+ */
joints?: Numbers;
- /** 4 weights per vertex; normalized on write. */
+ /** 4 or 8 weights per vertex, like `joints`; normalized on write. */
weights?: Numbers;
/** Triangle (or line / point) indices; omit for an unindexed list. */
indices?: Numbers;
@@ -172,22 +180,40 @@ function floats(name: string, data: Numbers, size: number, count?: number) {
}
/** Weights normalized to sum 1 per vertex (glTF requires it). */
-function normalizedWeights(data: Numbers, count: number): Float32Array {
- const w = floats("weights", data, 4, count);
+function normalizedWeights(
+ data: Numbers,
+ count: number,
+ size: number,
+): Float32Array {
+ const w = floats("weights", data, size, count);
for (let v = 0; v < count; v++) {
- const o = v * 4;
+ const o = v * size;
let sum = 0;
- for (let i = 0; i < 4; i++) {
+ for (let i = 0; i < size; i++) {
if ((w[o + i] as number) < 0)
throw new Error(`weights: vertex ${v} has a negative weight`);
sum += w[o + i] as number;
}
if (sum <= 0) throw new Error(`weights: vertex ${v} has no weight`);
- for (let i = 0; i < 4; i++) w[o + i] = (w[o + i] as number) / sum;
+ for (let i = 0; i < size; i++) w[o + i] = (w[o + i] as number) / sum;
}
return w;
}
+/** Columns `from … from + 3` of an `size`-wide table: one glTF influence set. */
+function influenceSet<T extends Float32Array | Uint8Array | Uint16Array>(
+ data: T,
+ size: number,
+ from: number,
+): T {
+ const count = data.length / size;
+ const out = new (data.constructor as new (n: number) => T)(count * 4);
+ for (let v = 0; v < count; v++)
+ for (let k = 0; k < 4; k++)
+ out[v * 4 + k] = data[v * size + from + k] as number;
+ return out;
+}
+
export class GltfDocument {
private readonly bin = new GlbBuilder();
private readonly materials: Record<string, unknown>[] = [];
@@ -314,21 +340,30 @@ export class GltfDocument {
if (p.joints || p.weights) {
if (!p.joints || !p.weights)
throw new Error(`${label}: joints and weights go together`);
- const j = floats(`${label} joints`, p.joints, 4, count);
+ const size = p.joints.length / count;
+ if (size !== 4 && size !== 8)
+ throw new Error(
+ `${label}: ${p.joints.length} joints for ${count} vertices (4 or 8 per vertex)`,
+ );
+ const j = floats(`${label} joints`, p.joints, size, count);
for (const v of j) {
if (!Number.isInteger(v) || v < 0)
throw new Error(`${label}: joint index ${v} is not a whole number`);
maxJoint = Math.max(maxJoint, v);
}
- attributes.JOINTS_0 = this.bin.accessor(
- maxJoint < 256 ? Uint8Array.from(j) : Uint16Array.from(j),
- "VEC4",
- { target: "vertex" },
- );
- attributes.WEIGHTS_0 = vertex(
- normalizedWeights(p.weights, count),
- "VEC4",
- );
+ const joints = maxJoint < 256 ? Uint8Array.from(j) : Uint16Array.from(j);
+ const weights = normalizedWeights(p.weights, count, size);
+ for (let set = 0; set < size / 4; set++) {
+ attributes[`JOINTS_${set}`] = this.bin.accessor(
+ influenceSet(joints, size, set * 4),
+ "VEC4",
+ { target: "vertex" },
+ );
+ attributes[`WEIGHTS_${set}`] = vertex(
+ influenceSet(weights, size, set * 4),
+ "VEC4",
+ );
+ }
}
const json: Record<string, unknown> = { attributes };
if (p.indices) {
@@ -359,11 +394,11 @@ export class GltfDocument {
true,
),
};
- if (t.normals)
- target.NORMAL = this.targetAccessor(
- floats(`${name} normals`, t.normals, 3, count),
- false,
- );
+ // Normal deltas that are all zero say nothing: leave them out.
+ const normals =
+ t.normals && floats(`${name} normals`, t.normals, 3, count);
+ if (normals?.some((x) => x !== 0))
+ target.NORMAL = this.targetAccessor(normals, false);
return target;
});
}
@@ -476,6 +511,7 @@ export class GltfDocument {
this.addNode({
name: j.name,
translation: skeleton.local(j.name),
+ ...(j.orient ? { rotation: skeleton.localRotation(j.name) } : {}),
...(children.length ? { children } : {}),
...(j.extras ? { extras: j.extras } : {}),
}),
@@ -485,11 +521,22 @@ export class GltfDocument {
list.forEach((j, i) => {
joints.set(j.name, nodeOf.get(j.name) as NodeRef);
jointIndex.set(j.name, i);
+ // The inverse of the joint's rest transform: Rᵀ, then −Rᵀ·at.
const o = i * 16;
- ibm[o] = ibm[o + 5] = ibm[o + 10] = ibm[o + 15] = 1;
- ibm[o + 12] = 0 - j.at[0];
- ibm[o + 13] = 0 - j.at[1];
- ibm[o + 14] = 0 - j.at[2];
+ const q = skeleton.orientation(j.name);
+ const rt = [
+ quatRotate(quatConjugate(q), [1, 0, 0]),
+ quatRotate(quatConjugate(q), [0, 1, 0]),
+ quatRotate(quatConjugate(q), [0, 0, 1]),
+ ];
+ for (let c = 0; c < 3; c++)
+ for (let r = 0; r < 3; r++)
+ ibm[o + c * 4 + r] = ((rt[c] as Vec3)[r] as number) + 0; // no -0
+ const t = quatRotate(quatConjugate(q), j.at);
+ ibm[o + 12] = 0 - t[0];
+ ibm[o + 13] = 0 - t[1];
+ ibm[o + 14] = 0 - t[2];
+ ibm[o + 15] = 1;
});
const roots = list
.filter((j) => j.parent === undefined)
diff --git a/packages/forge/src/forge.test.ts b/packages/forge/src/forge.test.ts
index 53eb92f4..96de213f 100644
--- a/packages/forge/src/forge.test.ts
+++ b/packages/forge/src/forge.test.ts
@@ -3,7 +3,7 @@
* warnings, and the engine's own loader reads back exactly what was written
* (geometry, 32-bit indices, skins, named morph targets, materials, clips).
*/
-import { parseGLB } from "@framefields/webgpu-renderers";
+import { denseMorphDeltas, parseGLB } from "@framefields/webgpu-renderers";
import { validateBytes } from "gltf-validator";
import { describe, expect, it } from "vitest";
import {
@@ -204,7 +204,9 @@ describe("GltfDocument", () => {
expect(acc.sparse?.count).toBe(1);
expect(acc.max).toEqual([0, 0, 4]);
const m = parseGLB(glb).meshes[0]!;
- expect(Array.from(m.morphTargets![0]!.positions!)).toEqual(poke);
+ expect(Array.from(denseMorphDeltas(m.morphTargets![0]!, n))).toEqual(poke);
+ // Kept sparse in memory: only the moved vertex.
+ expect(Array.from(m.morphTargets![0]!.indices!)).toEqual([7]);
expect(m.morphTargetNames).toEqual(["poke"]);
});
@@ -398,6 +400,55 @@ describe("Skeleton", () => {
).toBe(true);
});
+ it("keeps rest orientations: node rotations, inverse bind matrices, mirrored copies", async () => {
+ // A forearm turned 90° about z at rest: its local x points up.
+ const turn: [number, number, number, number] = [
+ 0,
+ 0,
+ Math.SQRT1_2,
+ Math.SQRT1_2,
+ ];
+ const s = new Skeleton()
+ .add("Root", { at: [0, 0, 0] })
+ .add("LeftArm", { at: [10, 0, 0], parent: "Root", orient: turn })
+ .add("LeftHand", { at: [10, 8, 0], parent: "LeftArm", orient: turn })
+ .mirror();
+ expect(s.local("LeftHand")).toEqual([
+ expect.closeTo(8, 9),
+ expect.closeTo(0, 9),
+ expect.closeTo(0, 9),
+ ]);
+ const r = s.joint("RightArm").orient!;
+ expect(
+ [r[0], r[1], r[2], r[3]].map((x) => Math.round(x * 1e6) / 1e6 + 0),
+ ).toEqual([0, 0, -0.707107, 0.707107]);
+ const doc = new GltfDocument();
+ doc.addSkeleton(s);
+ const glb = doc.toGlb();
+ expect((await validate(glb)).issues).toEqual([]);
+ const model = parseGLB(glb);
+ const skin = model.skins![0]!;
+ const names = skin.joints.map((j) => model.nodes![j]!.name);
+ // Each inverse bind matrix takes its joint's rest position to the origin.
+ names.forEach((n, i) => {
+ const at = s.joint(n).at;
+ const m = skin.inverseBindMatrices;
+ for (let r = 0; r < 3; r++)
+ expect(
+ m[i * 16 + r]! * at[0] +
+ m[i * 16 + 4 + r]! * at[1] +
+ m[i * 16 + 8 + r]! * at[2] +
+ m[i * 16 + 12 + r]!,
+ ).toBeCloseTo(0, 5);
+ });
+ // The hand's node holds no extra turn: it rests as its parent does.
+ const hand = model.nodes![skin.joints[names.indexOf("LeftHand")]!]!;
+ expect(hand.rotation ?? [0, 0, 0, 1]).toEqual(
+ [0, 0, 0, 1].map((v) => expect.closeTo(v, 9)),
+ );
+ expect(hand.translation?.[0]).toBeCloseTo(8, 6);
+ });
+
it("writes a skeleton with its bone gizmo as a valid skinned GLB", async () => {
const skeleton = humanoidSkeleton();
const doc = new GltfDocument();
diff --git a/packages/forge/src/human/add-human.ts b/packages/forge/src/human/add-human.ts
deleted file mode 100644
index fcac81c9..00000000
--- a/packages/forge/src/human/add-human.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Writes a `human()` into a document in one call: skeleton, skinned body,
- * textured eyeballs, glass corneas and the rig's drivers, each part with a
- * material you can override.
- */
-import type {
- GltfDocument,
- MaterialRef,
- NodeRef,
- SkeletonRefs,
-} from "../document.js";
-import type { MaterialSpec } from "../material.js";
-import type { HumanModel, HumanPart } from "./human.js";
-import { type SkinOptions, skinTextures } from "./skin.js";
-
-export interface AddHumanOptions {
- /** Node name. Default "Human". */
- name?: string;
- /**
- * Skin material. Default: a warm skin with subsurface scattering. Its
- * `color` and `roughness` seed the baked skin textures; maps it sets
- * itself win over the baked ones.
- */
- skin?: MaterialSpec;
- /**
- * Baked skin textures (`skinTextures`): color with blush, lips and
- * mottling, roughness, and tiling pores. `false` leaves the skin a flat
- * color. Default: baked with the skin's color.
- */
- skinTextures?: SkinOptions | false;
- /** Eyeball material; its color texture defaults to the model's eye texture. */
- eyes?: MaterialSpec;
- /** Cornea material. Default: clear glass (IOR 1.376, 3 mm deep). */
- cornea?: MaterialSpec;
- /** Teeth and tongue material. Default: a wet, slightly translucent ivory. */
- mouth?: MaterialSpec;
-}
-
-export interface AddedHuman {
- rig: SkeletonRefs;
- nodes: { body: NodeRef; eyes: NodeRef; cornea: NodeRef; mouth: NodeRef };
- materials: {
- skin: MaterialRef;
- eyes: MaterialRef;
- cornea: MaterialRef;
- mouth: MaterialRef;
- };
-}
-
-export function addHuman(
- doc: GltfDocument,
- h: HumanModel,
- options: AddHumanOptions = {},
-): AddedHuman {
- const name = options.name ?? "Human";
- const rig = doc.addSkeleton(h.skeleton);
- const skinSpec: MaterialSpec = options.skin ?? {
- name: `${name}Skin`,
- color: "#d9b29a",
- roughness: 0.5,
- subsurface: { factor: 0.7, color: "#ff6a4a" },
- };
- const skin = doc.addMaterial(
- options.skinTextures === false
- ? skinSpec
- : texturedSkin(doc, h, skinSpec, options.skinTextures ?? {}),
- );
- const eyes = doc.addMaterial({
- name: `${name}Eyes`,
- roughness: 0.4,
- subsurface: { factor: 0.3, color: "#ff8a7a" },
- ...options.eyes,
- colorTexture:
- options.eyes?.colorTexture ??
- doc.addTexture({ image: h.eyeTexture, mimeType: "image/png" }),
- });
- const cornea = doc.addMaterial(
- options.cornea ?? {
- name: `${name}Cornea`,
- color: "#ffffff",
- roughness: 0.02,
- transmission: 1,
- ior: 1.376,
- volume: { thickness: 0.3 },
- },
- );
- const mouth = doc.addMaterial(
- options.mouth ?? {
- name: `${name}Mouth`,
- color: "#e8dccb",
- roughness: 0.3,
- subsurface: { factor: 0.5, color: "#ff8070" },
- },
- );
- const part = (part: string, primitive: HumanPart, material: MaterialRef) =>
- doc.addNode({
- name: `${name}${part}`,
- mesh: doc.addMesh({
- name: `${name}${part}`,
- primitives: [{ ...primitive, material }],
- }),
- skin: rig.skin,
- });
- const nodes = {
- body: part("Body", h.body, skin),
- eyes: part("Eyes", h.eyes, eyes),
- cornea: part("Cornea", h.cornea, cornea),
- mouth: part("Mouth", h.mouth, mouth),
- };
- for (const d of h.drivers) doc.addDriver(d);
- return { rig, nodes, materials: { skin, eyes, cornea, mouth } };
-}
-
-/** The skin spec with baked maps in the slots it leaves empty. */
-function texturedSkin(
- doc: GltfDocument,
- h: HumanModel,
- spec: MaterialSpec,
- options: SkinOptions,
-): MaterialSpec {
- const maps = skinTextures(h, {
- color: spec.color ?? "#d9b29a",
- roughness: spec.roughness ?? 0.5,
- ...options,
- });
- const png = (image: Uint8Array) =>
- doc.addTexture({ image, mimeType: "image/png" });
- const repeat = maps.detailRepeat;
- return {
- ...spec,
- // The maps carry the color and roughness; the factors pass them through.
- color: spec.colorTexture ? spec.color : "#ffffff",
- roughness: spec.metallicRoughnessTexture ? spec.roughness : 1,
- metallic: 0,
- colorTexture: spec.colorTexture ?? png(maps.color),
- metallicRoughnessTexture:
- spec.metallicRoughnessTexture ?? png(maps.roughness),
- normalTexture: spec.normalTexture ?? {
- texture: png(maps.detail),
- scale: 0.45,
- transform: { scale: [repeat, repeat] },
- },
- };
-}
diff --git a/packages/forge/src/human/expressions.ts b/packages/forge/src/human/expressions.ts
deleted file mode 100644
index bff4170b..00000000
--- a/packages/forge/src/human/expressions.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Facial blend shapes under ARKit's names, built from MakeHuman's CC0
- * expression units (one set per ethnic base, blended like the body). Units
- * made for one side map directly; symmetric mouth units are split into a
- * left and a right half with a soft seam across the midline, so each side
- * of a smile or a frown moves on its own. A face animated with ARKit names
- * (capture apps, other rigs) drives these unchanged.
- */
-
-/** One ARKit-named shape: MakeHuman units (path under `expression/units/<ethnicity>/`) and the half it keeps. */
-interface ShapeSource {
- units: string[];
- /** Keep the character's left (+x) or right (−x) half of a symmetric unit. */
- half?: "left" | "right";
-}
-
-const sided = (name: string, unit: (side: "left" | "right") => string) => ({
- [`${name}Left`]: { units: [unit("left")] },
- [`${name}Right`]: { units: [unit("right")] },
-});
-const split = (name: string, unit: string) => ({
- [`${name}Left`]: { units: [unit], half: "left" as const },
- [`${name}Right`]: { units: [unit], half: "right" as const },
-});
-
-/** The shapes `human()` builds, by ARKit name (plus a few MakeHuman extras with descriptive names). */
-export const FACE_SHAPES: Readonly<Record<string, ShapeSource>> = {
- ...sided("eyeBlink", (s) => `eye-${s}-closure`),
- ...sided("eyeWide", (s) => `eye-${s}-opened-up`),
- ...sided("eyeSquint", (s) => `eye-${s}-slit`),
- ...sided("browDown", (s) => `eyebrows-${s}-down`),
- ...sided("browOuterUp", (s) => `eyebrows-${s}-extern-up`),
- browInnerUp: { units: ["eyebrows-left-inner-up", "eyebrows-right-inner-up"] },
- ...sided("noseSneer", (s) => `nose-${s}-elevation`),
- jawOpen: { units: ["mouth-open"] },
- mouthPucker: { units: ["mouth-pursing"] },
- mouthFunnel: { units: ["mouth-protusion"] },
- mouthRollLower: { units: ["mouth-eversion"] },
- ...split("mouthSmile", "mouth-corner-puller"),
- ...split("mouthFrown", "mouth-depression"),
- ...split("mouthPress", "mouth-compression"),
- ...split("mouthStretch", "mouth-retraction"),
- ...split("mouthUpperUp", "mouth-elevation"),
- ...split("mouthLowerDown", "mouth-depression-retraction"),
- ...split("mouthDimple", "mouth-upward-retraction"),
- // Not in ARKit's set.
- ...sided("noseFlare", (s) => `nose-${s}-dilatation`),
- noseWrinkle: { units: ["nose-compression"] },
- mouthPart: { units: ["mouth-parling"] },
- neckTense: { units: ["neck-platysma"] },
-};
-
-/** Weight of the kept half at x (base mesh units, decimeters): a seam 2 cm wide across the midline. */
-export function halfWeight(
- half: "left" | "right" | undefined,
- x: number,
-): number {
- if (!half) return 1;
- const w = 0.1;
- const t = Math.min(1, Math.max(0, (x + w) / (2 * w)));
- const s = t * t * (3 - 2 * t);
- return half === "left" ? s : 1 - s;
-}
-
-export const ETHNIC_UNITS = ["african", "asian", "caucasian"] as const;
diff --git a/packages/forge/src/human/human.test.ts b/packages/forge/src/human/human.test.ts
deleted file mode 100644
index c9952553..00000000
--- a/packages/forge/src/human/human.test.ts
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * The human base: assets download lazily and verified, the macro targets
- * blend like MakeHuman's, and (when the pinned files are cached) a shaped
- * body comes out rigged on Mixamo names, skinned, at the asked height,
- * and writes a valid GLB.
- */
-import { createHash } from "node:crypto";
-import { existsSync } from "node:fs";
-import { mkdtemp, rm } from "node:fs/promises";
-import { tmpdir } from "node:os";
-import { join } from "node:path";
-import { validateBytes } from "gltf-validator";
-import { describe, expect, it } from "vitest";
-import {
- addHuman,
- GltfDocument,
- HumanAssetStore,
- human,
- humanCacheDir,
- skinTextures,
-} from "../index.js";
-import { readPng } from "../read-png.test-util.js";
-import { macroTargets } from "./human.js";
-
-const sha = (b: Uint8Array) => createHash("sha256").update(b).digest("hex");
-
-describe("HumanAssetStore", () => {
- it("downloads once, verified, and reuses the cache", async () => {
- const dir = await mkdtemp(join(tmpdir(), "forge-human-"));
- const bytes = new TextEncoder().encode("# target\n1 0.1 0 0\n");
- let calls = 0;
- const fetchImpl = (async () => {
- calls++;
- return new Response(bytes);
- }) as typeof fetch;
- const pins = new Map([
- ["targets/x.target", { size: bytes.length, sha256: sha(bytes) }],
- ]);
- const store = new HumanAssetStore({ dir, fetch: fetchImpl, pins });
- const [a, b] = await Promise.all([
- store.ensure("targets/x.target"),
- store.ensure("targets/x.target"),
- ]);
- expect(a).toEqual(bytes);
- expect(b).toEqual(bytes);
- expect(calls).toBe(1);
- // A new store (another process) reads the verified file from disk.
- const again = new HumanAssetStore({ dir, fetch: fetchImpl, pins });
- expect(await again.text("targets/x.target")).toContain("1 0.1 0 0");
- expect(calls).toBe(1);
- await rm(dir, { recursive: true, force: true });
- });
-
- it("refuses bytes that are not the pinned file, and unpinned paths", async () => {
- const dir = await mkdtemp(join(tmpdir(), "forge-human-"));
- const pins = new Map([
- ["a.target", { size: 3, sha256: sha(new TextEncoder().encode("abc")) }],
- ]);
- const store = new HumanAssetStore({
- dir,
- pins,
- fetch: (async () => new Response("xyz")) as typeof fetch,
- });
- await expect(store.ensure("a.target")).rejects.toThrow(
- /not the pinned file/,
- );
- await expect(store.ensure("b.target")).rejects.toThrow(
- /not a pinned MakeHuman file/,
- );
- await rm(dir, { recursive: true, force: true });
- });
-});
-
-describe("macro targets", () => {
- it("splits the default body evenly between the sexes and ethnicities", () => {
- const t = macroTargets({});
- const universal = [...t].filter(([p]) =>
- p.startsWith("macrodetails/universal-"),
- );
- expect(universal.reduce((s, [, w]) => s + w, 0)).toBeCloseTo(1, 9);
- expect(
- t.get("macrodetails/universal-female-young-averagemuscle-averageweight"),
- ).toBeCloseTo(0.5);
- expect(t.get("macrodetails/caucasian-male-young")).toBeCloseTo(1 / 6);
- });
-
- it("moves between the named levels of each dimension", () => {
- const t = macroTargets({ sex: 1, age: 0.75, muscle: 1, weight: 0.25 });
- // age 0.75: halfway from young to old; weight 0.25: halfway from min to average.
- expect(
- t.get("macrodetails/universal-male-young-maxmuscle-minweight"),
- ).toBeCloseTo(0.25);
- expect(
- t.get("macrodetails/universal-male-old-maxmuscle-averageweight"),
- ).toBeCloseTo(0.25);
- expect([...t.keys()].some((p) => p.includes("female"))).toBe(false);
- });
-});
-
-const cached = existsSync(join(humanCacheDir(), "3dobjs/base.obj"));
-
-describe.skipIf(!cached)("human (cached MakeHuman assets)", () => {
- it("builds a rigged, skinned body at the asked height", async () => {
- const h = await human({ sex: 1, muscle: 0.7, height: 182 });
- expect(h.height).toBeCloseTo(182, 5);
- let minY = Number.POSITIVE_INFINITY;
- let maxY = Number.NEGATIVE_INFINITY;
- for (let i = 1; i < h.body.positions.length; i += 3) {
- minY = Math.min(minY, h.body.positions[i] as number);
- maxY = Math.max(maxY, h.body.positions[i] as number);
- }
- expect(minY).toBeCloseTo(0, 5);
- expect(maxY).toBeCloseTo(182, 5);
- for (const n of [
- "Hips",
- "Spine",
- "Spine2",
- "Neck",
- "Head",
- "LeftArm",
- "LeftForeArm",
- "RightHand",
- "LeftHandIndex1",
- "LeftUpLeg",
- "RightLeg",
- "LeftFoot",
- ])
- expect(h.skeleton.has(n), n).toBe(true);
- // Joints follow the shaped body: the hand sits below the shoulder in the rest A-pose, the head on top.
- expect(h.skeleton.joint("LeftHand").at[1]).toBeLessThan(
- h.skeleton.joint("LeftArm").at[1],
- );
- expect(h.skeleton.joint("LeftArm").at[0]).toBeGreaterThan(0);
- expect(h.skeleton.joint("Head").at[1]).toBeGreaterThan(150);
- for (let v = 0; v < h.body.weights.length; v += 4) {
- const s =
- (h.body.weights[v] as number) +
- (h.body.weights[v + 1] as number) +
- (h.body.weights[v + 2] as number) +
- (h.body.weights[v + 3] as number);
- expect(Math.abs(s - 1)).toBeLessThan(1e-6);
- }
- const doc = new GltfDocument();
- addHuman(doc, h);
- const report = await validateBytes(doc.toGlb(), { maxIssues: 20 });
- expect(report.issues.messages.filter((m) => m.severity <= 1)).toEqual([]);
- });
-
- it("fits eyeballs that turn about their own centers", async () => {
- const h = await human({ sex: 0, height: 170 });
- const left = h.skeleton.joint("LeftEye");
- const right = h.skeleton.joint("RightEye");
- expect(left.at[0]).toBeGreaterThan(0);
- expect(right.at[0]).toBeCloseTo(-left.at[0], 1);
- const { positions, joints, weights } = h.eyes;
- const n = positions.length / 3;
- expect(n).toBeGreaterThan(400);
- // Every vertex follows its own side's eye, rigidly; each lies on a
- // sphere around that eye's joint (the pivot is the ball's center).
- const radii: number[] = [];
- for (let v = 0; v < n; v++) {
- const x = positions[v * 3] as number;
- const j = joints[v * 4];
- expect(j).toBe(x > 0 ? left.index : right.index);
- expect(weights[v * 4]).toBe(1);
- const c = x > 0 ? left.at : right.at;
- radii.push(
- Math.hypot(
- x - c[0],
- (positions[v * 3 + 1] as number) - c[1],
- (positions[v * 3 + 2] as number) - c[2],
- ),
- );
- }
- const mean = radii.reduce((s, r) => s + r, 0) / n;
- expect(mean).toBeGreaterThan(0.9);
- expect(mean).toBeLessThan(1.8);
- expect(Math.max(...radii.map((r) => Math.abs(r - mean)))).toBeLessThan(
- mean * 0.15,
- );
- // Corneas: their own shells, in front of the eyeballs, skinned the same way.
- expect(h.cornea.positions.length).toBeGreaterThan(300);
- const frontEye = Math.max(
- ...Array.from({ length: n }, (_, v) => positions[v * 3 + 2] as number),
- );
- const frontCornea = Math.max(
- ...Array.from(
- { length: h.cornea.positions.length / 3 },
- (_, v) => h.cornea.positions[v * 3 + 2] as number,
- ),
- );
- expect(frontCornea).toBeGreaterThan(frontEye);
- // The lid drivers name joints the skeleton has.
- for (const d of h.drivers) {
- expect(h.skeleton.has(d.joint), d.joint).toBe(true);
- expect(h.skeleton.has(d.from), d.from).toBe(true);
- }
- // The texture is a PNG.
- expect(Array.from(h.eyeTexture.slice(1, 4))).toEqual([0x50, 0x4e, 0x47]);
- });
-
- it("builds ARKit-named face shapes, split into sides, on the body and mouth", async () => {
- const h = await human({});
- const byName = new Map(h.body.targets.map((t) => [t.name, t.positions]));
- for (const name of [
- "eyeBlinkLeft",
- "eyeBlinkRight",
- "jawOpen",
- "mouthSmileLeft",
- "mouthSmileRight",
- "browInnerUp",
- ])
- expect(byName.has(name)).toBe(true);
- // Each side's shape moves its own side: the character's left is +x.
- const sideOf = (d: ArrayLike<number>) => {
- let left = 0;
- let right = 0;
- for (let v = 0; v < d.length / 3; v++) {
- const m = Math.hypot(
- d[v * 3] as number,
- d[v * 3 + 1] as number,
- d[v * 3 + 2] as number,
- );
- if ((h.body.positions[v * 3] as number) > 0) left += m;
- else right += m;
- }
- return { left, right };
- };
- for (const shape of ["eyeBlink", "mouthSmile"]) {
- const l = sideOf(byName.get(`${shape}Left`)!);
- const r = sideOf(byName.get(`${shape}Right`)!);
- expect(l.left).toBeGreaterThan(l.right * 5);
- expect(r.right).toBeGreaterThan(r.left * 5);
- }
- // The split halves of a symmetric unit add back up to the whole unit.
- const l = byName.get("mouthSmileLeft")!;
- const r = byName.get("mouthSmileRight")!;
- const sum = Array.from(l, (x, i) => x + (r[i] as number));
- expect(sum.some((x) => Math.abs(x) > 0.05)).toBe(true);
- // The jaw opens the teeth too; the mouth carries only shapes that move it.
- const mouth = new Map(h.mouth.targets.map((t) => [t.name, t.positions]));
- expect(
- Array.from(mouth.get("jawOpen")!).some((d) => Math.abs(d) > 0.1),
- ).toBe(true);
- expect(mouth.has("eyeBlinkLeft")).toBe(false);
- });
-
- it("bakes skin textures with red lips and a tiling pore map", async () => {
- const h = await human({});
- const maps = skinTextures(h, { size: 512 });
- const color = readPng(maps.color);
- expect(color.width).toBe(512);
- // Sample the map at a vertex's UV.
- const at = (v: number) => {
- const x = Math.min(511, Math.floor((h.body.uvs[v * 2] as number) * 512));
- const y = Math.min(
- 511,
- Math.floor((h.body.uvs[v * 2 + 1] as number) * 512),
- );
- const i = (y * 512 + x) * 4;
- return [color.rgba[i], color.rgba[i + 1], color.rgba[i + 2]] as [
- number,
- number,
- number,
- ];
- };
- // The front-most vertex of the lips (at the mouth corners' height) and of the forehead.
- const p = h.body.positions;
- const n = p.length / 3;
- const frontMost = (y0: number, y1: number) => {
- let best = 0;
- for (let v = 0; v < n; v++) {
- const y = (p[v * 3 + 1] as number) / h.height;
- if (
- y > y0 &&
- y < y1 &&
- Math.abs(p[v * 3] as number) < 0.5 &&
- (p[v * 3 + 2] as number) > (p[best * 3 + 2] as number)
- )
- best = v;
- }
- return best;
- };
- const lip = at(frontMost(0.891, 0.895));
- const brow = at(frontMost(0.96, 0.97));
- expect(lip[1] / lip[0]).toBeLessThan((brow[1] / brow[0]) * 0.85);
- const rough = readPng(maps.roughness);
- expect(rough.rgba[2]).toBe(0); // no metal
- const detail = readPng(maps.detail);
- // Tangent-space normals point out of the surface on average.
- let z = 0;
- for (let i = 2; i < detail.rgba.length; i += 4)
- z += detail.rgba[i] as number;
- expect(z / (detail.rgba.length / 4)).toBeGreaterThan(240);
- expect(maps.detailRepeat).toBeGreaterThan(5);
- });
-
- it("adds named targets on top of the macro shape", async () => {
- const plain = await human({});
- const shaped = await human({ targets: { "nose/nose-base-up": 1 } });
- let moved = 0;
- for (let i = 0; i < plain.body.positions.length; i++)
- if (
- Math.abs(
- (plain.body.positions[i] as number) -
- (shaped.body.positions[i] as number),
- ) > 1e-4
- )
- moved++;
- expect(moved).toBeGreaterThan(10);
- expect(moved).toBeLessThan(plain.body.positions.length / 10);
- });
-});
diff --git a/packages/forge/src/human/human.ts b/packages/forge/src/human/human.ts
deleted file mode 100644
index 5d434a37..00000000
--- a/packages/forge/src/human/human.ts
+++ /dev/null
@@ -1,803 +0,0 @@
-/**
- * Realistic human bodies from MakeHuman's CC0 base mesh and shape targets:
- * sex, age, muscle, weight, proportions and ethnicity blend the macro
- * targets exactly as MakeHuman does, any other target (nose, jaw, torso,
- * …) adds by name, and the skeleton is placed from the shaped body, so
- * bones fit every build. The skeleton's main bones carry Mixamo names
- * (Hips, Spine, LeftArm, LeftForeArm, …), so clips, `pose`, `aim` and
- * retargeting drive it unchanged; twist, extra spine and face bones keep
- * MakeHuman's names. Skin weights are MakeHuman's painted weights.
- *
- * Assets download lazily on first use (see `HumanAssetStore`), only the
- * targets a body needs.
- *
- * ```ts
- * const elf = await human({ sex: 1, age: 0.55, muscle: 0.55, weight: 0.35, height: 184,
- * targets: { "ears/l-ear-shape-pointed": 1, "ears/r-ear-shape-pointed": 1 } });
- * const doc = new GltfDocument();
- * const rig = doc.addSkeleton(elf.skeleton);
- * doc.addNode({ mesh: doc.addMesh({ name: "Body", primitives: [{ ...elf.body, material: skin }] }), skin: rig.skin });
- * ```
- */
-import type {
- DriverSpec,
- MorphTargetSpec,
- PrimitiveSpec,
-} from "../document.js";
-import { Skeleton, type Vec3 } from "../skeleton.js";
-import { subdivide } from "../subdivide.js";
-import { ETHNIC_UNITS, FACE_SHAPES, halfWeight } from "./expressions.js";
-import {
- type BaseMesh,
- fitProxy,
- type MhProxy,
- type MhSkeleton,
- parseBaseObj,
- parseObj,
- parseProxy,
- parseSkeleton,
- parseTarget,
- parseWeights,
- type Target,
-} from "./makehuman.js";
-import { HumanAssetStore } from "./store.js";
-
-export interface HumanOptions {
- /** 0 female … 1 male. Default 0.5 (MakeHuman's androgynous middle). */
- sex?: number;
- /** 0 baby (1 yr), 0.1875 child (11), 0.5 adult (25), 1 old (90). Default 0.5. */
- age?: number;
- /** 0 … 1; 0.5 average. Default 0.5. */
- muscle?: number;
- /** 0 … 1; 0.5 average. Default 0.5. */
- weight?: number;
- /** 0 … 1 body proportions, 0.5 regular, 1 idealized. Default 0.5. */
- proportions?: number;
- /** Shares of each ethnic base, normalized. Default a third each. */
- ethnicity?: { african?: number; asian?: number; caucasian?: number };
- /** Final standing height, model units (cm). Default: the shaped body's own height. */
- height?: number;
- /**
- * Extra targets by path under `targets/` without `.target`, with their
- * weights: `{ "nose/nose-base-up": 0.6, "chin/chin-jut-in": 0.3 }`.
- */
- targets?: Record<string, number>;
- /**
- * Loop subdivision levels for the body and mouth (each multiplies the
- * triangles by four; blend shapes and weights carry through exactly).
- * 1 smooths faceting in close-ups. Default 0.
- */
- subdivide?: number;
- /**
- * Facial blend shapes on the body under ARKit names (`eyeBlinkLeft`,
- * `jawOpen`, `mouthSmileRight`, …; see `FACE_SHAPES`). Default true.
- */
- expressions?: boolean;
- /** Where the assets come from (default: a store on the shared cache). */
- store?: HumanAssetStore;
-}
-
-/** A skinned, UV-mapped part of a human. */
-export type HumanPart = Required<
- Pick<
- PrimitiveSpec,
- "positions" | "normals" | "uvs" | "joints" | "weights" | "indices"
- >
->;
-
-export interface HumanModel {
- skeleton: Skeleton;
- /** The skinned body with its facial blend shapes, ready for `GltfDocument.addMesh` (add a material). */
- body: HumanPart & { targets: MorphTargetSpec[] };
- /** Teeth and tongue, skinned to the head and jaw, with the expression shapes that move them. */
- mouth: HumanPart & { targets: MorphTargetSpec[] };
- /**
- * Both eyeballs (sclera, iris, pupil), fitted to the shaped head and
- * skinned to `LeftEye` / `RightEye`, so `lookAt` on those joints aims
- * them. Give them a material with `eyeTexture` as its color texture.
- */
- eyes: HumanPart;
- /**
- * The clear corneas over the irises, skinned like `eyes`. Give them a
- * transmissive material (`transmission`, `ior` ≈ 1.376, `volume.thickness`
- * ≈ 0.3 cm, the depth of the chamber in front of the iris) and they
- * refract the iris: it shifts with the viewing angle like a real eye's.
- */
- cornea: HumanPart;
- /** MakeHuman's brown eye texture (PNG, CC0): sclera, iris and pupil, mapped to `eyes`' UVs. */
- eyeTexture: Uint8Array;
- /**
- * Rig drivers that come with the body: the upper lids follow the eyes'
- * up-and-down turn by 65%, the lower lids by 35%, so a gaze aimed with
- * `lookAt` carries the lids with it. Write them with `GltfDocument.addDriver`
- * (`addHuman` does).
- */
- drivers: DriverSpec[];
- /** Model height after shaping and scaling, model units. */
- height: number;
-}
-
-/** Lid joints per side: MakeHuman's orbicularis03 (upper) and 04 (lower) pivot at the eyeball's center. */
-const LID_DRIVERS: DriverSpec[] = (["L", "R"] as const).flatMap((side) => {
- const eye = side === "L" ? "LeftEye" : "RightEye";
- return [
- { joint: `orbicularis03.${side}`, from: eye, rotate: { x: 0.65 } },
- { joint: `orbicularis04.${side}`, from: eye, rotate: { x: 0.35 } },
- ];
-});
-
-/** MakeHuman bone → Mixamo joint name, for the bones Mixamo has. */
-const MIXAMO: Record<string, string> = {
- root: "Hips",
- "eye.L": "LeftEye",
- "eye.R": "RightEye",
- spine05: "Spine",
- spine03: "Spine1",
- spine01: "Spine2",
- neck01: "Neck",
- head: "Head",
-};
-for (const [side, S] of [
- ["L", "Left"],
- ["R", "Right"],
-] as const) {
- Object.assign(MIXAMO, {
- [`clavicle.${side}`]: `${S}Shoulder`,
- [`upperarm01.${side}`]: `${S}Arm`,
- [`lowerarm01.${side}`]: `${S}ForeArm`,
- [`wrist.${side}`]: `${S}Hand`,
- [`upperleg01.${side}`]: `${S}UpLeg`,
- [`lowerleg01.${side}`]: `${S}Leg`,
- [`foot.${side}`]: `${S}Foot`,
- });
- ["Thumb", "Index", "Middle", "Ring", "Pinky"].forEach((finger, i) => {
- for (let k = 1; k <= 3; k++)
- MIXAMO[`finger${i + 1}-${k}.${side}`] = `${S}Hand${finger}${k}`;
- });
-}
-
-const clamp01 = (v: number) => Math.min(1, Math.max(0, v));
-
-/** MakeHuman's macro weights: each dimension splits into its named levels. */
-function levels(o: HumanOptions) {
- const sex = clamp01(o.sex ?? 0.5);
- const age = clamp01(o.age ?? 0.5);
- const muscle = clamp01(o.muscle ?? 0.5);
- const weight = clamp01(o.weight ?? 0.5);
- const prop = clamp01(o.proportions ?? 0.5);
- const three = (v: number) => {
- const min = Math.max(0, 1 - v * 2);
- const max = Math.max(0, (v - 0.5) * 2);
- return { min, average: 1 - min - max, max };
- };
- let ages: Record<string, number>;
- if (age < 0.5) {
- const adult = Math.max(0, (age - 0.1875) * 3.2);
- ages = {
- baby: Math.max(0, 1 - age * 5.333),
- child: Math.max(0, Math.min(1, 5.333 * age) - adult),
- young: adult,
- old: 0,
- };
- } else
- ages = {
- baby: 0,
- child: 0,
- young: Math.max(0, 1 - (age - 0.5) * 2),
- old: Math.max(0, (age - 0.5) * 2),
- };
- const eth = o.ethnicity ?? {};
- const e = {
- african: eth.african ?? 1 / 3,
- asian: eth.asian ?? 1 / 3,
- caucasian: eth.caucasian ?? 1 / 3,
- };
- const eSum = e.african + e.asian + e.caucasian || 1;
- return {
- sexes: { female: 1 - sex, male: sex },
- ages,
- muscles: three(muscle),
- weights: three(weight),
- proportions: {
- uncommon: Math.max(0, 1 - prop * 2),
- ideal: Math.max(0, (prop - 0.5) * 2),
- },
- ethnic: {
- african: e.african / eSum,
- asian: e.asian / eSum,
- caucasian: e.caucasian / eSum,
- },
- };
-}
-
-/** Every macro target with a non-zero weight. */
-export function macroTargets(o: HumanOptions): Map<string, number> {
- const L = levels(o);
- const out = new Map<string, number>();
- const put = (path: string, w: number) => {
- if (w > 1e-6) out.set(path, (out.get(path) ?? 0) + w);
- };
- const mw = (m: string) => (m === "average" ? "averagemuscle" : `${m}muscle`);
- const ww = (m: string) => (m === "average" ? "averageweight" : `${m}weight`);
- for (const [sex, ws] of Object.entries(L.sexes))
- for (const [age, wa] of Object.entries(L.ages))
- for (const [mus, wm] of Object.entries(L.muscles))
- for (const [wt, wwt] of Object.entries(L.weights)) {
- const w = ws * wa * wm * wwt;
- put(`macrodetails/universal-${sex}-${age}-${mw(mus)}-${ww(wt)}`, w);
- // Proportions exist for child, young and old; height targets are handled by scaling.
- if (age !== "baby")
- for (const [p, wp] of Object.entries(L.proportions))
- put(
- `macrodetails/proportions/${sex}-${age}-${mw(mus)}-${ww(wt)}-${p}proportions`,
- w * wp,
- );
- }
- for (const [race, wr] of Object.entries(L.ethnic))
- for (const [sex, ws] of Object.entries(L.sexes))
- for (const [age, wa] of Object.entries(L.ages))
- put(`macrodetails/${race}-${sex}-${age}`, wr * ws * wa);
- return out;
-}
-
-/** Applies weighted targets to a copy of the base positions. */
-function shape(base: Float32Array, targets: [Target, number][]): Float32Array {
- const p = Float32Array.from(base);
- for (const [t, w] of targets)
- for (let i = 0; i < t.indices.length; i++) {
- const v = (t.indices[i] as number) * 3;
- p[v] = (p[v] as number) + (t.deltas[i * 3] as number) * w;
- p[v + 1] = (p[v + 1] as number) + (t.deltas[i * 3 + 1] as number) * w;
- p[v + 2] = (p[v + 2] as number) + (t.deltas[i * 3 + 2] as number) * w;
- }
- return p;
-}
-
-const cache = new WeakMap<
- HumanAssetStore,
- Promise<{
- base: BaseMesh;
- rig: MhSkeleton;
- weights: Map<string, [number, number][]>;
- eyes: {
- obj: ReturnType<typeof parseObj>;
- proxy: MhProxy;
- texture: Uint8Array;
- };
- }>
->();
-const targetCache = new WeakMap<
- HumanAssetStore,
- Map<string, Promise<Target>>
->();
-
-function baseAssets(store: HumanAssetStore) {
- let p = cache.get(store);
- if (!p) {
- p = Promise.all([
- store.text("3dobjs/base.obj"),
- store.text("rigs/default.mhskel"),
- store.text("rigs/default_weights.mhw"),
- store.text("eyes/high-poly/high-poly.obj"),
- store.text("eyes/high-poly/high-poly.mhclo"),
- store.ensure("eyes/materials/brown_eye.png"),
- ]).then(([obj, skel, w, eyeObj, eyeClo, eyeTex]) => ({
- base: parseBaseObj(obj),
- rig: parseSkeleton(skel),
- weights: parseWeights(w),
- eyes: {
- obj: parseObj(eyeObj),
- proxy: parseProxy(eyeClo),
- texture: eyeTex,
- },
- }));
- cache.set(store, p);
- }
- return p;
-}
-
-function target(store: HumanAssetStore, path: string): Promise<Target> {
- let m = targetCache.get(store);
- if (!m) {
- m = new Map();
- targetCache.set(store, m);
- }
- let p = m.get(path);
- if (!p) {
- p = store.text(`targets/${path}.target`).then(parseTarget);
- m.set(path, p);
- }
- return p;
-}
-
-let defaultStore: HumanAssetStore | undefined;
-
-/** Builds a shaped, rigged, skinned human. Model units are centimeters; feet on y = 0, facing +z. */
-export async function human(options: HumanOptions = {}): Promise<HumanModel> {
- defaultStore ??= new HumanAssetStore();
- const store = options.store ?? defaultStore;
- const { base, rig, weights, eyes } = await baseAssets(store);
- const wanted = macroTargets(options);
- for (const [path, w] of Object.entries(options.targets ?? {}))
- if (w) wanted.set(path, (wanted.get(path) ?? 0) + w);
- const loaded = await Promise.all(
- [...wanted].map(
- async ([path, w]) => [await target(store, path), w] as [Target, number],
- ),
- );
- const shaped = shape(base.positions, loaded);
-
- // Body vertices: every (vertex, uv) pair used by the body's faces.
- const corner = new Map<number, number>();
- const src: number[] = [];
- const uvs: number[] = [];
- const indices: number[] = [];
- const nUv = base.uvs.length / 2;
- const vertexOf = (v: number, vt: number) => {
- const key = v * nUv + vt;
- let i = corner.get(key);
- if (i === undefined) {
- i = src.length;
- corner.set(key, i);
- src.push(v);
- // glTF's v runs down from the top of the image.
- uvs.push(
- base.uvs[vt * 2] as number,
- 1 - (base.uvs[vt * 2 + 1] as number),
- );
- }
- return i;
- };
- for (const f of base.faces) {
- const c = f.v.map((v, k) => vertexOf(v, f.vt[k] as number));
- for (let k = 1; k + 1 < c.length; k++)
- indices.push(c[0] as number, c[k] as number, c[k + 1] as number);
- }
-
- // Feet on y = 0, decimeters → centimeters, then the requested height.
- let minY = Number.POSITIVE_INFINITY;
- let maxY = Number.NEGATIVE_INFINITY;
- for (const v of src) {
- const y = shaped[v * 3 + 1] as number;
- minY = Math.min(minY, y);
- maxY = Math.max(maxY, y);
- }
- const natural = (maxY - minY) * 10;
- const scale = 10 * (options.height ? options.height / natural : 1);
- const at = (v: number): Vec3 => [
- (shaped[v * 3] as number) * scale,
- ((shaped[v * 3 + 1] as number) - minY) * scale,
- (shaped[v * 3 + 2] as number) * scale,
- ];
- const positions = src.flatMap((v) => at(v));
- const bodyNormals = vertexNormals(positions, indices, src);
-
- // Skeleton: each bone's head is the mean of its joint group on the shaped body.
- const skeleton = new Skeleton();
- const nameOf = (b: string) => MIXAMO[b] ?? b;
- const jointAt = (group: string): Vec3 => {
- const vs = rig.joints.get(group);
- if (!vs?.length)
- throw new Error(`human: rig joint "${group}" has no vertices`);
- const sum: Vec3 = [0, 0, 0];
- for (const v of vs) {
- const p = at(v);
- sum[0] += p[0];
- sum[1] += p[1];
- sum[2] += p[2];
- }
- return [sum[0] / vs.length, sum[1] / vs.length, sum[2] / vs.length];
- };
- // Eyes turn about their centers; MakeHuman's eye bones start at the back of the eyeball.
- const toModel = (x: number, y: number, z: number): Vec3 => [
- x * scale,
- (y - minY) * scale,
- z * scale,
- ];
- const fittedEyes = fitEyes(eyes, shaped);
- const centers = eyeCenters(fittedEyes, toModel);
- const pivot: Record<string, Vec3> = {
- "eye.L": centers.left,
- "eye.R": centers.right,
- };
- for (const b of rig.bones)
- skeleton.add(nameOf(b.name), {
- at: pivot[b.name] ?? jointAt(b.head),
- ...(b.parent ? { parent: nameOf(b.parent) } : {}),
- });
-
- // Painted weights, top four per vertex.
- const perVertex = new Map<number, [number, number][]>();
- rig.bones.forEach((b, j) => {
- for (const [v, w] of weights.get(b.name) ?? []) {
- let l = perVertex.get(v);
- if (!l) {
- l = [];
- perVertex.set(v, l);
- }
- l.push([j, w]);
- }
- });
- /** Top four painted weights per vertex, normalized. */
- const skinOf = (list: number[]) => {
- const joints = new Array<number>(list.length * 4).fill(0);
- const weights = new Array<number>(list.length * 4).fill(0);
- list.forEach((v, i) => {
- const l = (perVertex.get(v) ?? [[0, 1]])
- .sort((a, b) => b[1] - a[1])
- .slice(0, 4);
- const sum = l.reduce((t, x) => t + x[1], 0) || 1;
- l.forEach(([j, w], k) => {
- joints[i * 4 + k] = j;
- weights[i * 4 + k] = w / sum;
- });
- });
- return { joints, weights };
- };
- const { joints, weights: wts } = skinOf(src);
-
- // Teeth and tongue: helper geometry of the base mesh, skinned and shaped like the body.
- const mouthFaces = [...base.helpers.values()].flat();
- const mouthSrc: number[] = [];
- const mouthUvs: number[] = [];
- const mouthIndices: number[] = [];
- const mouthCorner = new Map<number, number>();
- for (const f of mouthFaces) {
- const c = f.v.map((v, k) => {
- const vt = f.vt[k] as number;
- const key = v * nUv + vt;
- let i = mouthCorner.get(key);
- if (i === undefined) {
- i = mouthSrc.length;
- mouthCorner.set(key, i);
- mouthSrc.push(v);
- mouthUvs.push(base.uvs[vt * 2] ?? 0, 1 - (base.uvs[vt * 2 + 1] ?? 0));
- }
- return i;
- });
- for (let k = 1; k + 1 < c.length; k++)
- mouthIndices.push(c[0] as number, c[k] as number, c[k + 1] as number);
- }
- const mouthPositions = mouthSrc.flatMap((v) => at(v));
- const mouthNormals = vertexNormals(mouthPositions, mouthIndices, mouthSrc);
- const mouthSkin = skinOf(mouthSrc);
- const expressions = options.expressions !== false;
- const ethnic = levels(options).ethnic;
-
- const subdivisions = Math.max(0, Math.floor(options.subdivide ?? 0));
- const smooth = <T extends HumanPart & { targets: MorphTargetSpec[] }>(
- part: T,
- weld: number[],
- ): T =>
- subdivisions
- ? { ...part, ...(subdivide(part, { levels: subdivisions, weld }) as T) }
- : part;
- const model = {
- skeleton,
- body: {
- positions,
- normals: bodyNormals,
- uvs,
- joints,
- weights: wts,
- indices,
- targets: expressions
- ? await faceTargets(
- store,
- ethnic,
- base.positions,
- src,
- scale,
- positions,
- indices,
- bodyNormals,
- )
- : [],
- },
- mouth: {
- positions: mouthPositions,
- normals: mouthNormals,
- uvs: mouthUvs,
- joints: mouthSkin.joints,
- weights: mouthSkin.weights,
- indices: mouthIndices,
- // Only the shapes that move the teeth or tongue (jaw, lips).
- targets: expressions
- ? (
- await faceTargets(
- store,
- ethnic,
- base.positions,
- mouthSrc,
- scale,
- mouthPositions,
- mouthIndices,
- mouthNormals,
- )
- ).filter((t) => Array.from(t.positions).some((d) => d !== 0))
- : [],
- },
- eyes: eyeballs(eyes.obj, fittedEyes, toModel, skeleton, false),
- cornea: eyeballs(eyes.obj, fittedEyes, toModel, skeleton, true),
- eyeTexture: eyes.texture,
- drivers: LID_DRIVERS,
- height: natural * (scale / 10),
- };
- // Copies of a base vertex at UV seams weld into one surface point.
- return {
- ...model,
- body: smooth(model.body, src),
- mouth: smooth(model.mouth, mouthSrc),
- };
-}
-
-/** The eye mesh fitted to the shaped head, with each vertex's shell marked. */
-interface FittedEyes {
- fitted: Float32Array;
- /** Per vertex: part of a cornea shell (left out). */
- cornea: Uint8Array;
-}
-
-/**
- * Each eye in MakeHuman's mesh is two shells: the eyeball and, just
- * outside it, a clear cornea mapped to the texture's transparent corner.
- * Per side, the shell reaching further forward is the cornea.
- */
-function fitEyes(
- eyes: { obj: ReturnType<typeof parseObj>; proxy: MhProxy },
- shaped: Float32Array,
-): FittedEyes {
- const fitted = fitProxy(eyes.proxy, shaped);
- const nv = fitted.length / 3;
- const parent = Array.from({ length: nv }, (_, i) => i);
- const find = (x: number): number => {
- while (parent[x] !== x) {
- parent[x] = parent[parent[x] as number] as number;
- x = parent[x] as number;
- }
- return x;
- };
- for (const f of eyes.obj.faces)
- for (const v of f.v) parent[find(v)] = find(f.v[0] as number);
- const shells = new Map<number, { maxZ: number; side: number }>();
- for (let v = 0; v < nv; v++) {
- const r = find(v);
- const sh = shells.get(r) ?? { maxZ: Number.NEGATIVE_INFINITY, side: 0 };
- sh.maxZ = Math.max(sh.maxZ, fitted[v * 3 + 2] as number);
- sh.side += fitted[v * 3] as number;
- shells.set(r, sh);
- }
- const corneaRoots = new Set<number>();
- for (const side of [-1, 1]) {
- const mine = [...shells].filter(([, sh]) => Math.sign(sh.side) === side);
- if (mine.length > 1) {
- mine.sort((a, b) => b[1].maxZ - a[1].maxZ);
- corneaRoots.add((mine[0] as [number, unknown])[0]);
- }
- }
- const cornea = new Uint8Array(nv);
- for (let v = 0; v < nv; v++) if (corneaRoots.has(find(v))) cornea[v] = 1;
- return { fitted, cornea };
-}
-
-/**
- * Each eyeball's center, model space: where the eye turns. The shell is
- * only the front of the ball, so its mean sits forward of the center; the
- * least-squares sphere through its vertices finds the real one.
- */
-function eyeCenters(
- e: FittedEyes,
- toModel: (x: number, y: number, z: number) => Vec3,
-) {
- const side = (sign: number): Vec3 => {
- const pts: Vec3[] = [];
- for (let v = 0; v < e.cornea.length; v++)
- if (!e.cornea[v] && Math.sign(e.fitted[v * 3] as number) === sign)
- pts.push(
- toModel(
- e.fitted[v * 3] as number,
- e.fitted[v * 3 + 1] as number,
- e.fitted[v * 3 + 2] as number,
- ),
- );
- return sphereCenter(pts);
- };
- return { left: side(1), right: side(-1) };
-}
-
-/** Center of the least-squares sphere through points: |p|² = 2c·p + k, solved by normal equations. */
-function sphereCenter(pts: Vec3[]): Vec3 {
- const A = Array.from({ length: 4 }, () => [0, 0, 0, 0]);
- const b = [0, 0, 0, 0];
- for (const p of pts) {
- const row = [2 * p[0], 2 * p[1], 2 * p[2], 1];
- const rhs = p[0] * p[0] + p[1] * p[1] + p[2] * p[2];
- for (let i = 0; i < 4; i++) {
- b[i] = (b[i] as number) + (row[i] as number) * rhs;
- for (let j = 0; j < 4; j++)
- (A[i] as number[])[j] =
- ((A[i] as number[])[j] as number) +
- (row[i] as number) * (row[j] as number);
- }
- }
- // Gaussian elimination with partial pivoting on the 4×4 system.
- const M = A.map((r, i) => [...r, b[i] as number]);
- for (let c = 0; c < 4; c++) {
- let piv = c;
- for (let r = c + 1; r < 4; r++)
- if (
- Math.abs((M[r] as number[])[c] as number) >
- Math.abs((M[piv] as number[])[c] as number)
- )
- piv = r;
- [M[c], M[piv]] = [M[piv] as number[], M[c] as number[]];
- const d = (M[c] as number[])[c] as number;
- if (Math.abs(d) < 1e-12) throw new Error("human: eye shell is degenerate");
- for (let r = 0; r < 4; r++) {
- if (r === c) continue;
- const f = ((M[r] as number[])[c] as number) / d;
- for (let k = c; k < 5; k++)
- (M[r] as number[])[k] =
- ((M[r] as number[])[k] as number) -
- f * ((M[c] as number[])[k] as number);
- }
- }
- const x = M.map((r, i) => (r[4] as number) / (r[i] as number));
- return [x[0] as number, x[1] as number, x[2] as number];
-}
-
-/** The eyeballs (or their corneas) as a primitive, each moved by its eye joint. */
-function eyeballs(
- obj: ReturnType<typeof parseObj>,
- e: FittedEyes,
- toModel: (x: number, y: number, z: number) => Vec3,
- skeleton: Skeleton,
- cornea: boolean,
-): HumanPart {
- const leftEye = skeleton.joint("LeftEye").index;
- const rightEye = skeleton.joint("RightEye").index;
- const corner = new Map<number, number>();
- const positions: number[] = [];
- const uvs: number[] = [];
- const joints: number[] = [];
- const weights: number[] = [];
- const indices: number[] = [];
- const src: number[] = [];
- const nUv = obj.uvs.length / 2;
- const { fitted } = e;
- for (const f of obj.faces) {
- if (Boolean(e.cornea[f.v[0] as number]) !== cornea) continue;
- const c = f.v.map((v, k) => {
- const vt = f.vt[k] as number;
- const key = v * nUv + vt;
- let i = corner.get(key);
- if (i === undefined) {
- i = src.length;
- corner.set(key, i);
- src.push(v);
- positions.push(
- ...toModel(
- fitted[v * 3] as number,
- fitted[v * 3 + 1] as number,
- fitted[v * 3 + 2] as number,
- ),
- );
- uvs.push(
- obj.uvs[vt * 2] as number,
- 1 - (obj.uvs[vt * 2 + 1] as number),
- );
- // The character's left is +x.
- joints.push(
- (fitted[v * 3] as number) > 0 ? leftEye : rightEye,
- 0,
- 0,
- 0,
- );
- weights.push(1, 0, 0, 0);
- }
- return i;
- });
- for (let k = 1; k + 1 < c.length; k++)
- indices.push(c[0] as number, c[k] as number, c[k + 1] as number);
- }
- return {
- positions,
- normals: vertexNormals(positions, indices, src),
- uvs,
- joints,
- weights,
- indices,
- };
-}
-/** Smooth normals, averaged across UV seams (vertices with the same source vertex share one). */
-function vertexNormals(
- positions: number[],
- indices: number[],
- src: number[],
-): number[] {
- const acc = new Map<number, Vec3>();
- for (let t = 0; t < indices.length; t += 3) {
- const [a, b, c] = [indices[t], indices[t + 1], indices[t + 2]] as [
- number,
- number,
- number,
- ];
- const p = (i: number): Vec3 => [
- positions[i * 3] as number,
- positions[i * 3 + 1] as number,
- positions[i * 3 + 2] as number,
- ];
- const [pa, pb, pc] = [p(a), p(b), p(c)];
- const u: Vec3 = [pb[0] - pa[0], pb[1] - pa[1], pb[2] - pa[2]];
- const w: Vec3 = [pc[0] - pa[0], pc[1] - pa[1], pc[2] - pa[2]];
- const n: Vec3 = [
- u[1] * w[2] - u[2] * w[1],
- u[2] * w[0] - u[0] * w[2],
- u[0] * w[1] - u[1] * w[0],
- ];
- for (const i of [a, b, c]) {
- const s = src[i] as number;
- const cur = acc.get(s) ?? [0, 0, 0];
- acc.set(s, [cur[0] + n[0], cur[1] + n[1], cur[2] + n[2]]);
- }
- }
- return src.flatMap((s) => {
- const n = acc.get(s) ?? [0, 1, 0];
- const l = Math.hypot(n[0], n[1], n[2]) || 1;
- return [n[0] / l, n[1] / l, n[2] / l];
- });
-}
-
-/**
- * The facial blend shapes on the body: each ARKit-named shape sums its
- * MakeHuman units (blended by ethnicity, halved for one side where the
- * unit is symmetric) into model units, with normal deltas so the shaded
- * surface follows the shape.
- */
-async function faceTargets(
- store: HumanAssetStore,
- ethnic: Record<string, number>,
- basePositions: Float32Array,
- src: number[],
- scale: number,
- positions: number[],
- indices: number[],
- normals: number[],
-): Promise<MorphTargetSpec[]> {
- const bodyOf = new Map<number, number[]>();
- src.forEach((v, i) => {
- const list = bodyOf.get(v);
- if (list) list.push(i);
- else bodyOf.set(v, [i]);
- });
- const n = src.length;
- const shapes = await Promise.all(
- Object.entries(FACE_SHAPES).map(async ([name, source]) => {
- const delta = new Float32Array(n * 3);
- for (const unit of source.units)
- for (const race of ETHNIC_UNITS) {
- const we = ethnic[race] ?? 0;
- if (we <= 0) continue;
- const t = await target(store, `expression/units/${race}/${unit}`);
- for (let k = 0; k < t.indices.length; k++) {
- const v = t.indices[k] as number;
- const w =
- we *
- scale *
- halfWeight(source.half, basePositions[v * 3] as number);
- if (!w) continue;
- for (const i of bodyOf.get(v) ?? [])
- for (let a = 0; a < 3; a++)
- delta[i * 3 + a] =
- (delta[i * 3 + a] as number) +
- (t.deltas[k * 3 + a] as number) * w;
- }
- }
- const moved = positions.map((p, i) => p + (delta[i] as number));
- const shaped = vertexNormals(moved, indices, src);
- const normalDelta = shaped.map((v, i) => v - (normals[i] as number));
- return { name, positions: delta, normals: normalDelta };
- }),
- );
- return shapes;
-}
diff --git a/packages/forge/src/human/makehuman-pins.ts b/packages/forge/src/human/makehuman-pins.ts
deleted file mode 100644
index dba906e9..00000000
--- a/packages/forge/src/human/makehuman-pins.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// biome-ignore-all format: generated by scripts/pin-makehuman.ts
-// biome-ignore-all lint: generated data
-/** Every pinned MakeHuman asset file: [path under makehuman/data/, bytes, SHA-256]. Generated by `pnpm pin:makehuman`. */
-export const MAKEHUMAN_PINS: { commit: string; files: [string, number, string][] } = { commit: "a8bc2d54ff0ac92e78ff71431b1023eda42bf482", files: [["3dobjs/base.obj",1749303,"8e761e6624b8f54536409135d1636da63b32486a90d4897f84e121d144f6fb4c"],["eyes/clear.thumb",2339,"f1dcd985cdb6e4c36d4c12ed3ef41c1c66588da38c0d2c41d0785e5df0ba4e67"],["eyes/high-poly/high-poly.mhclo",72490,"b183cfe37120ab726f9b3f2ea6cd3a64c44ce7b4bd91a77c841cf70c04f83a0d"],["eyes/high-poly/high-poly.obj",100882,"da2493215b708a344c33dc72f2a9a5b8fa985dcc5a70ad3b208995cf871da8e1"],["eyes/high-poly/high-poly.thumb",21076,"97730eb579e1a81a63f38f53125ad8d375556f222882704fbec7dd83d4f24916"],["eyes/low-poly/low-poly.mhclo",1344,"68582e28e9176cba7cfcf35208f671b6201b8d1bc95c32decff61a3160ec34d8"],["eyes/low-poly/low-poly.obj",6604,"783fe1e6331162c876520b4c2bed7a8ca06354ca15497e8ebd68bb1b59f4d3de"],["eyes/low-poly/low-poly.thumb",15938,"27b09c5a2bd792671c99a00016ec836855278f199bc4753c3018f1ac73068c72"],["eyes/materials/brown.mhmat",1247,"4abad93ce50541c08127721e77bce035640c9f16bed16cd0f5524b1cd5908465"],["eyes/materials/brown.thumb",29627,"5bd2de12f0c04d423ab00fa13f691a1879b944e63947e228117ddcce31f9cff9"],["eyes/materials/brown_eye.png",610817,"4659691c7295ad6206c78b003e5fd0e5f91dcd53032fa914a229bb48cabe424b"],["rigs/default.mhskel",117790,"99f179bce0aa850b45d4191a1d0d234c5851f881c057439470ded3bddf729a24"],["rigs/default_weights.mhw",897521,"0f3641d651ae3d00ad6b4ccee43142edb109d3bd909d27d9e4139ef1beed8625"],["targets/armslegs/l-foot-scale-decr.target",37491,"e59bd7901a5286bf2a7c07e9fcf13b4116f58314ed5b2e98736fe6aed712d175"],["targets/armslegs/l-foot-scale-depth-decr.target",25784,"7c76d5001c35c44050cdbdae1f724456a68461c69d5566dcafc72a565c6721dd"],["targets/armslegs/l-foot-scale-depth-incr.target",24570,"a03d9a0e1de38b0ae906bfec54820ace06212cab8f1ed71d46de095d6f44ff9b"],["targets/armslegs/l-foot-scale-horiz-decr.target",25216,"e5441c2b4d74968c8f1ac4bef840e6dc736d843cf7cd6f2e23449931d47cd030"],["targets/armslegs/l-foot-scale-horiz-incr.target",25139,"45f69339d4522ff5f9cc7f4b08eff9176fc0bbc62e5b6bb02d870c476b5e40e7"],["targets/armslegs/l-foot-scale-incr.target",35666,"a1ac805fd451f7d22ca38102f697f7205070645b67c75b1260d394d0961f1e9a"],["targets/armslegs/l-foot-scale-vert-decr.target",24142,"bc205dc522e50fc9f7b77a0b8310440d94de2cefd9bab53c9afeb4a9325433c2"],["targets/armslegs/l-foot-scale-vert-incr.target",25512,"bcfa1e990c8346b5c80c80e99751c4bc9d1c43d633c91d0e40b5ce95a73fba9b"],["targets/armslegs/l-foot-trans-backward.target",34307,"157fc65e07954131892e3bca07389ab57357902b686334e70886d3971223b6df"],["targets/armslegs/l-foot-trans-down.target",25664,"69897d283859744d1626a1a30501124d6d0f16e5d6ced8a00ac6a32718e6c843"],["targets/armslegs/l-foot-trans-forward.target",32201,"5a50a2f28b8e454d00596e37a6156a45737279a1a01cd1d2705a1b52aa8d396c"],["targets/armslegs/l-foot-trans-in.target",27705,"a62648175da30a1c4ca6e5ad2de0940076a6911040ee601885f514fc401e8d2a"],["targets/armslegs/l-foot-trans-out.target",29569,"3bf8bf3f057e1edc6ef49d0bf07e20c7b0f8acbf8dc2c0e3bba453026a7caeac"],["targets/armslegs/l-foot-trans-up.target",25766,"6ad3debc437b93666229e372e2a76ec185b667130ff267d88e38f6f65b8f1646"],["targets/armslegs/l-hand-fingers-diameter-decr.target",30148,"840202f321faf16ac1d5be7226f8be143fa29f239aadb4ed16deb1abbb784861"],["targets/armslegs/l-hand-fingers-diameter-incr.target",30945,"3ef4b754e4aee45a29484c85116462cad1a31d59f6f41c7b4e5949d439c1b133"],["targets/armslegs/l-hand-fingers-distance-decr.target",30351,"68bd07c0b3d457a5712b9eef4b704f5eaf1aa0db4feff07eab1ae2284d0b6564"],["targets/armslegs/l-hand-fingers-distance-incr.target",30346,"f208c9566dc3c8ff32b4931fb221e251077a86a0b89059b4ef8871a7cac346a1"],["targets/armslegs/l-hand-fingers-length-decr.target",30732,"c250ec553e173f240250713af34587dc5d577bfd0828a7f863fc0316e2e21ba4"],["targets/armslegs/l-hand-fingers-length-incr.target",29122,"8208583f3f806b09a4c523da7f0a67206c8e47ca60390b389c2b717722628477"],["targets/armslegs/l-hand-scale-decr.target",41816,"fa2ea6da6bb973caf38f64d8f4d9e03403b55dc0e0da252a0efdee83be0d874e"],["targets/armslegs/l-hand-scale-incr.target",40538,"9f10606963738b9961dd48c724e577250d411539bc13adc2ad02171a921ae97b"],["targets/armslegs/l-hand-trans-in.target",44279,"3a21331269acc42b7b5927c9f697a53bb3e7aa20203d8030ab310b9686286c63"],["targets/armslegs/l-hand-trans-out.target",40879,"84c81299567ec2da7a4df7c1144e8c66c309becd2910de8023e4da9da04b0968"],["targets/armslegs/l-leg-valgus-decr.target",22545,"7df387622520ebd0faee22c4dcd6cad3b9dfdccd708db354707e7bb9f79634fa"],["targets/armslegs/l-leg-valgus-incr.target",16852,"16b370fd03d5251c7cf9237f8bffe4966a05c4d5a5c2f34d4c094b4889f4e49b"],["targets/armslegs/l-lowerarm-fat-decr.target",6903,"06097e5a8f5e8788deada7f0d7e8f82cd88d4b82c17a71535b4add7b9f30f0d3"],["targets/armslegs/l-lowerarm-fat-incr.target",13422,"6d0575b89fce778662b55dbd2e9a3c086153020faa1f844491e775ca2e1b7abd"],["targets/armslegs/l-lowerarm-muscle-decr.target",5306,"fbc97f1acc93c4733d71a984fc33dfca873a23f9624461cf4784e1b4af87d975"],["targets/armslegs/l-lowerarm-muscle-incr.target",5706,"68511185971789f16fc625788f6abd61bfee61d5580b015745ad4fa7faa83d6b"],["targets/armslegs/l-lowerarm-scale-depth-decr.target",9771,"1ce9261eea8c4dcdf9003133976f4a5d8631163d8822fb075a8654244ed1b84b"],["targets/armslegs/l-lowerarm-scale-depth-incr.target",9554,"93f2c88eb2714a44c297243f3c5dd297d029bd5817b3644effbbc02052c960f3"],["targets/armslegs/l-lowerarm-scale-horiz-decr.target",46539,"b441a3ace7cfc69faa4f34d2e3b1e1aa8ba95548081d87cc68eb645aa412ff43"],["targets/armslegs/l-lowerarm-scale-horiz-incr.target",42666,"3a3580208fa4bc8359529923e7df7d90e949b25521f53314d2177a40b17719e4"],["targets/armslegs/l-lowerarm-scale-vert-decr.target",8956,"40a5cf49b52ec056c8944ef2b5d6e3de1f060a8f7cdd99173e526935c61a41a4"],["targets/armslegs/l-lowerarm-scale-vert-incr.target",8395,"20b2853fb05a0575cb355e344e59daa59ac441eafb3daf54d7c9215bdd48cea6"],["targets/armslegs/l-lowerleg-fat-decr.target",6606,"b0e1ce287d4198b2dbc7eeaf111bb14cbfae7e465ebe18290ac54d27bb354b84"],["targets/armslegs/l-lowerleg-fat-incr.target",8639,"921a06554e0fa8536d6fec16d43359fa5aaac5bb7bb8c973013fd9425e4aef17"],["targets/armslegs/l-lowerleg-muscle-decr.target",6512,"5d9502debebfe219ba56a514d606dbca61ca4a97500501c04250291fc8dbf590"],["targets/armslegs/l-lowerleg-muscle-incr.target",7083,"5c4323925e92e0875d4a3ce5e72db3ee0394dc865183349ac12ac8051dc1bd53"],["targets/armslegs/l-lowerleg-scale-depth-decr.target",10280,"ea2c098901598d324315ff32fe224544c183411f1e21e37106a460db3134a250"],["targets/armslegs/l-lowerleg-scale-depth-incr.target",12948,"addd47b8df8bb0d371b09a5660aaf90d9113351d320247e96723af29b2bddadc"],["targets/armslegs/l-lowerleg-scale-horiz-decr.target",7995,"c1bf1697bfa0bd34ad928b7a221bd343db64ddbb837cd960f51e122d0eb088b4"],["targets/armslegs/l-lowerleg-scale-horiz-incr.target",10386,"8c7aab0753b1a96ec9501abff886c0076b55568ac963a24206967e7df4410730"],["targets/armslegs/l-lowerleg-scale-vert-decr.target",35551,"5192ff54d531a10fec28212f685acf1c32d9239b10597ea916b37c43324d9ae7"],["targets/armslegs/l-lowerleg-scale-vert-incr.target",37234,"a429a1656d12627ecbe585183427fa0de279f5e2fef9c3d9d8cc55ed4a1204f3"],["targets/armslegs/l-upperarm-fat-decr.target",12917,"90da5db1d04f0276fb530ba7e64cc4dce987a68e2e1d51f374bd9349d163f05a"],["targets/armslegs/l-upperarm-fat-incr.target",13437,"08a049b2e9037f26bebb8e46965cb8b25edcdb56fc057f210b5666fc3101af79"],["targets/armslegs/l-upperarm-muscle-decr.target",7128,"a913ae38aad73505edd536f2cfd67cfce099d6efc723971cd9be798c1230fb60"],["targets/armslegs/l-upperarm-muscle-incr.target",6926,"61440e900b9e65748005e837b129abd48b1cd8fb98a653a2288a1bd3ace810d7"],["targets/armslegs/l-upperarm-scale-depth-decr.target",6452,"1de76b08f66810a4faa4f10d02753c954a155259e3bf2da4ac1a1c601cbc9a9e"],["targets/armslegs/l-upperarm-scale-depth-incr.target",6479,"078b51ab8384a712ea3928fe9daad5412eda597be6a883783a9a089679e96aa8"],["targets/armslegs/l-upperarm-scale-horiz-decr.target",44043,"55910a23ec39a334c20a4d624b676e62aaf7b900c146ef306b75b1e58eec98b8"],["targets/armslegs/l-upperarm-scale-horiz-incr.target",41574,"923b08690dc1ad59f019600623a4a06e8b4830d7e871d75477017cae0f589187"],["targets/armslegs/l-upperarm-scale-vert-decr.target",6141,"0ab970d41543592b704e3420f74ebdac4c519758fe89aa4b464ded139bdb35f9"],["targets/armslegs/l-upperarm-scale-vert-incr.target",6085,"a06044a28208a74e8212d808f593fbba949aaea25bcc3eb77413edd63c3333b7"],["targets/armslegs/l-upperarm-shoulder-muscle-decr.target",1973,"b78c40015e3e623294f6e4a00a176557ddd31e4424e46c1ed817b48711301b5f"],["targets/armslegs/l-upperarm-shoulder-muscle-incr.target",5387,"0d1994d9d45b5f7b5d4884262514fee53c6fd111bce1cc931a6fcb69f60aa8b6"],["targets/armslegs/l-upperleg-fat-decr.target",9846,"202ec2e30eac3424f4cae8c1af7684c2bcf7b7d0e7b40c714189d8fd818154a4"],["targets/armslegs/l-upperleg-fat-incr.target",21834,"08a6a96b7773f7ccfd1b96f7eee36030c5d7794a457913ccc393b0d21569ae8e"],["targets/armslegs/l-upperleg-muscle-decr.target",9314,"9fb9c83fa191b0e498f97e934f65f5a37a4d173e6d7e01c73065ed5610ed70ef"],["targets/armslegs/l-upperleg-muscle-incr.target",10261,"f5804422cee551ab197a7e41b4d1a9c25d5f7c2d8277e0615c1b61341bc65647"],["targets/armslegs/l-upperleg-scale-depth-decr.target",8626,"b64837b66d00dba69a081947236ee92bd6c79271b7234b0366537738e700eea0"],["targets/armslegs/l-upperleg-scale-depth-incr.target",8883,"8ec16d3f707db4e2fdd967b257d9999530fcb8a68507103a297796556ec430c3"],["targets/armslegs/l-upperleg-scale-horiz-decr.target",9541,"e6f86444cf78f3e0cd63bdd05e6073c8412e29b4579089efb7381b3196b7e690"],["targets/armslegs/l-upperleg-scale-horiz-incr.target",12354,"6c92349bc515e50e94adfbfe12f522dcb5c35d84e9cb4763f573b1543609d4f6"],["targets/armslegs/l-upperleg-scale-vert-decr.target",13080,"b76d5a7dc14e04d93d9a105e3da412fd06866a5bde14df238b8232a6f987c38a"],["targets/armslegs/l-upperleg-scale-vert-incr.target",10553,"0a4dc4d99c5f7480e24c28fb8c8e713b3302ef1c281b3fc28fb09e9962c51ec7"],["targets/armslegs/lowerlegs-height-decr.target",59660,"267a461a42209dc1547fba016179646d38f9148fa177867e234b6018a404e98a"],["targets/armslegs/lowerlegs-height-incr.target",75540,"b76887923140e6fbf91d3488f10faff33f9ad0269e614061592ba324e9384d7b"],["targets/armslegs/r-foot-scale-decr.target",36597,"2638e599ef976b8d8cfd812dfef327604cec4820779a1f0cf669c7da065a787c"],["targets/armslegs/r-foot-scale-depth-decr.target",24643,"5fbbc5d7ef211565a04a3bdadf103e348e824171ec31e0b2ccf307ebff81e8d1"],["targets/armslegs/r-foot-scale-depth-incr.target",23430,"f19f17ff30e2653f6a6763cd5fc3751cbb50253d7c7278077c868b1c2370f61f"],["targets/armslegs/r-foot-scale-horiz-decr.target",24031,"d2f8dc8e8340fbb6be9d7b4b69f2058edfd65fa7b971d3926812e7977e2f890b"],["targets/armslegs/r-foot-scale-horiz-incr.target",24037,"d1469ecfe268cc1de20eb42ff7436ce7fc8d12a551f13c4c98d3b126b4a5b4de"],["targets/armslegs/r-foot-scale-incr.target",35118,"5fbf7378adcb257ddb469239faa69061ec1b7879bdf25cf43144f709c7e37d17"],["targets/armslegs/r-foot-scale-vert-decr.target",23053,"06b1b50a4c28d28c40350f4d9fc17ebaf2ac65f2625f7e1bf1b24169e0b557bf"],["targets/armslegs/r-foot-scale-vert-incr.target",24374,"9d45b723be9d37d8ddf9fd757338e6e43a15c1500670f3d6663776c56cd528d2"],["targets/armslegs/r-foot-trans-backward.target",31901,"50b2f6026edc2a5ae88a53f2d769cc023a05e889ff80244b564ad1ef18a639c1"],["targets/armslegs/r-foot-trans-down.target",24504,"56f86781208eb1fa0f8061ce8c56dd1760cb132f5fa31b60e4b94af11ba9db80"],["targets/armslegs/r-foot-trans-forward.target",29795,"17bfb9a75248471aabceb097c28bc9fbe47471ceaff62526e2fb73034f4a3411"],["targets/armslegs/r-foot-trans-in.target",24819,"81c0dcef3b63d708b31515c6e46d84404a617a138beda5196f725479f9ba0773"],["targets/armslegs/r-foot-trans-out.target",30283,"b87d7939587142f2772ca6c8f7819f2143f9bee80240e58bd2e29afccc4e68a9"],["targets/armslegs/r-foot-trans-up.target",24600,"88771d5a368f455b87505e926fc6da7e056e3ba58ce47f15cac54828c1fff145"],["targets/armslegs/r-hand-fingers-diameter-decr.target",29890,"70285ebf2151020a4f6601ee31dfad10b5db1e13af6f63746a0e3eb98cffebbe"],["targets/armslegs/r-hand-fingers-diameter-incr.target",30988,"abef31ebfe5fcceb8b6fddb6a082d4629af078625cbbf64d46e0de626e0c6297"],["targets/armslegs/r-hand-fingers-distance-decr.target",29990,"783dda2401f2b253ea70a7bf12fb55c66abd2e6223000afd26607b008d27a316"],["targets/armslegs/r-hand-fingers-distance-incr.target",30367,"64fdced29a3bfa288ad012e407e747e0669f7079b1b30856c1c4b6f052f3fc7b"],["targets/armslegs/r-hand-fingers-length-decr.target",29678,"9a73335aaa70960e850feb13dc505fdf9b5554e370cfc02e238a7dc590faab01"],["targets/armslegs/r-hand-fingers-length-incr.target",30087,"84d0cfff9a002a6be6cb6a1d7186f9782827af432671ffb5e0430bbbb9c2d33a"],["targets/armslegs/r-hand-scale-decr.target",40238,"bdf34b740afc5b1d2045ed4dbb8e4340a94c7b10795b2b4922b2ea4110bad737"],["targets/armslegs/r-hand-scale-incr.target",41556,"004a3ea8336c2c13cf7fd2b4f08bf444ad5614f027ebd109a983a66e06140d6d"],["targets/armslegs/r-hand-trans-in.target",42034,"a8065fd48ab39d89d75b6c16cbcc77d5f5bfeddf0dc0b60d4e2d7b3680b041a2"],["targets/armslegs/r-hand-trans-out.target",42500,"ffcf628b7da1c492a72c09c5c0ecf2a8237a9ac17ca9b1dd8e5e31814a888b4a"],["targets/armslegs/r-leg-valgus-decr.target",23186,"06618e8364a0095b6010691b2b0e73eac2dafaca4191cd2e28988e5136020e94"],["targets/armslegs/r-leg-valgus-incr.target",15629,"6bb7d54fc92481a88774701e05352253f401bf5af6d493315f51aabe5ed7daf2"],["targets/armslegs/r-lowerarm-fat-decr.target",6704,"e9312da4a3025b6ed1e8fcdfa38cc298f4db02beceeb1212ad9bd48a8b5c7c0f"],["targets/armslegs/r-lowerarm-fat-incr.target",12993,"3540d0be75dbb416ba754a38a0279f01900c17b4d12153dafeb69b4e6051fe86"],["targets/armslegs/r-lowerarm-muscle-decr.target",5093,"b1698f5e436ca0a495944513f15ae71c08f2b87ec32211118f67e81fcf3f7625"],["targets/armslegs/r-lowerarm-muscle-incr.target",5585,"f4c207478c621e2ac9c0c1e6e1e67803e25a7ee083fe2aa8e31cf831d20d1ab3"],["targets/armslegs/r-lowerarm-scale-depth-decr.target",9548,"581e6ed77ebbb6cd1db63afa24a4146260fa5927afb9988a0d3488abb8c88777"],["targets/armslegs/r-lowerarm-scale-depth-incr.target",9215,"7ee60418258fa9dfa11bf922bfa3c2954633c7c2e048530ec731c6a5f64ee2de"],["targets/armslegs/r-lowerarm-scale-horiz-decr.target",44099,"ff7e60f30207421ae6e091114d2d3c5f4dac689d6c60b55360a89854eaeca67c"],["targets/armslegs/r-lowerarm-scale-horiz-incr.target",44346,"4b3e2bd2035f0315a5c9096b8cbfdcae6264ab50166eb13600d3c5998d3bf11f"],["targets/armslegs/r-lowerarm-scale-vert-decr.target",8380,"3bc171a9aa18248cd381761f8ec154dc57e77d2e2bfa44353cfda0795e13a3b6"],["targets/armslegs/r-lowerarm-scale-vert-incr.target",8381,"305e3937ade1d8b89ed4a07f963b6bd4a3953c8f21dce04158d26743a50d569f"],["targets/armslegs/r-lowerleg-fat-decr.target",6511,"002a19486b6b99815a285c8b5bebf97d6cd44e157f58c938956c45163fdbb20e"],["targets/armslegs/r-lowerleg-fat-incr.target",8402,"274093edb93620b0ee7dfc8ca1a634bc624d084308edf6d415c316b1f452a5b8"],["targets/armslegs/r-lowerleg-muscle-decr.target",6404,"0160fc21d13bb2770f009e2edcbf51d0c4ccf87293cb80ab371b67f9ba09279e"],["targets/armslegs/r-lowerleg-muscle-incr.target",6661,"e2d438a2ef32948d77316343f7882cfabe5cfe447b8b96bc31131c6812f10792"],["targets/armslegs/r-lowerleg-scale-depth-decr.target",9906,"6513000bde3a5940ed0d91dd665459ce4df12da6c3f47db8b1abd1cb3deab8cf"],["targets/armslegs/r-lowerleg-scale-depth-incr.target",12547,"77bb2981b13251d4d8239ea65fab03b5737e5f46cf26da047fbd8ad7ea74f05e"],["targets/armslegs/r-lowerleg-scale-horiz-decr.target",7674,"e0b927142b28b4493b745434a83887b34f6e2ce09a43044c328bb0bef66afddb"],["targets/armslegs/r-lowerleg-scale-horiz-incr.target",10296,"171ae3ccbc187e1fcdf86dd2b6b3ff04a3c29c2be93b7e9fc61fdc5ddaa29d98"],["targets/armslegs/r-lowerleg-scale-vert-decr.target",35878,"114693f0acd00df3580b0741f79969a24c48af6a58f4a4b89cc22c7adb97bc0b"],["targets/armslegs/r-lowerleg-scale-vert-incr.target",37878,"1effc9813ad8d901218b59d79a89583de6cd7572d84b9317d16c58843478d307"],["targets/armslegs/r-upperarm-fat-decr.target",12697,"7f48a4016e4ed9657fe15d2695430d4b8a2e481f32153a7caf807e0d40950bc0"],["targets/armslegs/r-upperarm-fat-incr.target",13333,"9f7148e31f9c94d0c82313885395a198505e5526951eb76d08ff587a53700f04"],["targets/armslegs/r-upperarm-muscle-decr.target",6983,"0af83fa2b0c4940f09580eb309d26a96587184ddb0b1e6929051fa32453deb85"],["targets/armslegs/r-upperarm-muscle-incr.target",6953,"cf81df0a8d38bd66742d017dbcfe77f180659dfd61ed3fc94cb25751ccd4417b"],["targets/armslegs/r-upperarm-scale-depth-decr.target",6355,"a8913975db1d75cf8b5e40aff5e76e5dc1e08d844fe15ac02d512c885a8655d5"],["targets/armslegs/r-upperarm-scale-depth-incr.target",6382,"3a613a9d9b953f4b45d23566c3da943c3615ec6f2929f29cd12832191d6d90c0"],["targets/armslegs/r-upperarm-scale-horiz-decr.target",41190,"c03c978a63bfe7e40e7fce0abc92b3316ed58359e3235671a9f8b20d2b3c2158"],["targets/armslegs/r-upperarm-scale-horiz-incr.target",43440,"b947543cedd93d2c6ed0561ec8f01d3b6ffa592e76c1c1c64a299722fb3b98ea"],["targets/armslegs/r-upperarm-scale-vert-decr.target",6074,"9b17594d6e21866e63ba83ae8aae3c08a9525d982f2f4084ccaaa2f86b88d057"],["targets/armslegs/r-upperarm-scale-vert-incr.target",6043,"e17caf49c2d53291b558cc7ccb25d22aafc9583822d916e919e9ee8263b0ae98"],["targets/armslegs/r-upperarm-shoulder-muscle-decr.target",1914,"ad633eb4c77f9868866472f23d2e413042ce6e051b01b081f8633e999d6e000f"],["targets/armslegs/r-upperarm-shoulder-muscle-incr.target",5529,"33d8d39af985071484836ebda826ab50332408256b1e6d2ab2240d480fd00295"],["targets/armslegs/r-upperleg-fat-decr.target",9485,"a19f7c805c17cf6fe579732f77e012b48de1fd9e677b341bfa604019883fa235"],["targets/armslegs/r-upperleg-fat-incr.target",21608,"fa3fcd659cd9b66b1c62c2bdb28ee69989f648fcbc6687b4d8f2e4d2422356c4"],["targets/armslegs/r-upperleg-muscle-decr.target",9006,"f9832787b194f23d684918c0a4d91ab0b4c17782be92820c39fca57ed00543fa"],["targets/armslegs/r-upperleg-muscle-incr.target",10099,"833d03f125d75a933164e69918fdc075080ea453a11091a132f58f3d68f7def8"],["targets/armslegs/r-upperleg-scale-depth-decr.target",8497,"9baaffb218826e978fc8b6396c5b4e9a759c185a5f9dca7562575edec97bad58"],["targets/armslegs/r-upperleg-scale-depth-incr.target",8631,"2a4652084365f7d75732282fc32c6fc8cab9ae3917b05ddeedbdd73382e85f92"],["targets/armslegs/r-upperleg-scale-horiz-decr.target",9393,"91a2d656fe2dc04f204ceada36bbca9d8709d1489fc95585888b5a95462321ae"],["targets/armslegs/r-upperleg-scale-horiz-incr.target",12309,"98301ec81e4771f0c367e08734a7a421986f6b7dea8e10846d5f69e86c78243d"],["targets/armslegs/r-upperleg-scale-vert-decr.target",12057,"3ed01a679f78bd66ee68181f1ef9913624496fde33294c1496b1ece90f6ccd7f"],["targets/armslegs/r-upperleg-scale-vert-incr.target",10753,"2f68bbc82c91eb39238e2131ed4b555294c216808e41bf809c1102e8e033fe42"],["targets/armslegs/upperlegs-height-decr.target",93294,"56fae81607701bdae1f0b3b6cd6b013cd047a71442cbfafe256867157affec3d"],["targets/armslegs/upperlegs-height-incr.target",107509,"8668f753040f677f683b00176f6aaecb117b1c8bb3539438e38753a176ff0b31"],["targets/asym/asym-brown-1-l.target",5589,"1d30894d6db8b0ecb0fde3466e461e1e8d44c0ba129e26b4e0d58f65409aa2be"],["targets/asym/asym-brown-1-r.target",8294,"15f1632502243b9171848ca06cd13d1f8fb31529f68124de31edaa6a9fb97a15"],["targets/asym/asym-brown-2-l.target",2338,"83e46b322d754539f3bee047f7e29cf5eb4248c370d6a5b2abfef49c85a6d52b"],["targets/asym/asym-brown-2-r.target",2468,"412279f7afe36be4ce37568d8be43e32c212c74bcc121298c9ee0e9be3f3be65"],["targets/asym/asym-cheek-1-l.target",3988,"9b66764a954119158a8b25a840ab01269f4602394fee40eb33e80bb77da32a57"],["targets/asym/asym-cheek-1-r.target",6984,"e6762fd926dc11f70b480a59970e1e8ab8978fd95197fad20d41cc2405f1b7ba"],["targets/asym/asym-cheek-2-l.target",6117,"242d5ee4088629ecff1bc28c427985a017d4c1f0a61ff2973eb07797be6b7f70"],["targets/asym/asym-cheek-2-r.target",7209,"9f93d0e9d610f304b757293b7e55354907ab64c972369abc3788c8123181ef02"],["targets/asym/asym-ear-1-l.target",10796,"981434e644c4f81678184b7a9cba8a39ffbc633114ea1693adf651c8778e68e6"],["targets/asym/asym-ear-1-r.target",11706,"ff0100c4228b474d924f5776e79a6a97c3fa644d7cbf23a54f55b0b0f217bd13"],["targets/asym/asym-ear-2-l.target",10614,"8c2a8ddb62b8d482796394ca83574017202b801f0be03e92cd423391082bf06f"],["targets/asym/asym-ear-2-r.target",8511,"c867b1e18fde3b6395d9b75ee21df2ac9510a385c0e1914cb8577c6ea11c7872"],["targets/asym/asym-ear-3-l.target",2436,"b34b64f31eef5500f7ddf04c684ef684db286988b3c72451db8c707b6f9b5062"],["targets/asym/asym-ear-3-r.target",2178,"bb8d6066faa58056790bad032414ed07c3c97f50eec0ca8da3e7419da7840a28"],["targets/asym/asym-ear-4-l.target",5458,"bdccb48bc6a80e2cdd9a09e9500d3eebc9023a81a56902807f8c6a8d348e6412"],["targets/asym/asym-ear-4-r.target",6918,"d560ac5b3858327a3d3f75856765fc26d8ff8c8e2aa4bcb2b9a4618609970842"],["targets/asym/asym-eye-1-l.target",29029,"524aed9eda6acfc0047a13c3b891394843e0f7cb6b2efd53438b58a0427679d1"],["targets/asym/asym-eye-1-r.target",31025,"4850d5755dc519489a3d743b0e54df40f8b80afe095cdbeac3cd296aea491ec3"],["targets/asym/asym-eye-2-l.target",29938,"612e9f53c58d2ad520eba52137ef8867d51a5d60bea0f87f1cd711f261412172"],["targets/asym/asym-eye-2-r.target",28790,"ef557eeb0c635d0fca8154501c30ee91ccf2fd21128b4185c02ff2a944f1465b"],["targets/asym/asym-eye-3-l.target",8226,"f12127391c15e8e8ded8050e7fd6194e806c817fb5fb0896e55defdc7d3a1512"],["targets/asym/asym-eye-3-r.target",10198,"d632fbfc57c77215099a3a63bc4d713ad280eca21ffa6ba7114b3482664147bb"],["targets/asym/asym-eye-4-l.target",8752,"b82a0bfb5c05a88aa2524a001434174f38304b86a65b13af5d89d389ff74756e"],["targets/asym/asym-eye-4-r.target",10823,"e51fda792263b6d5c50723d55aeac5e8e3824c34373e2a78a8b8aad3e8bc4781"],["targets/asym/asym-eye-5-l.target",10399,"27a423c415fe23c8abf7374c003a90eb639c1f26d7cb228167687bf8121ecc5e"],["targets/asym/asym-eye-5-r.target",10463,"163167ff5e5a1e1430ed03ef0ad9e9f54dbee74a744461beb536b824e10fecd2"],["targets/asym/asym-eye-6-l.target",4795,"0c629fa66adfea5c34fba4caa69cedb276ea9c8640c8fb05602f88874fb92dfd"],["targets/asym/asym-eye-6-r.target",4093,"682c3af7c1b60f6fcdc25f4ffa002a917b31f08eac13a1ee100b22133373e411"],["targets/asym/asym-eye-7-l.target",7259,"55a7ddc71883d358a77e1cb8adaabc644aa205e9939193fa9c430916b8c09dd5"],["targets/asym/asym-eye-7-r.target",6740,"53232be5b34677f45c7fd56ab7f0eccca386ba85b6fef2d0db4343b294e6e946"],["targets/asym/asym-eye-8-l.target",5473,"61d96711441581facc1c075fd08368d1cb561bd618efea1f1cf54f90d52dd455"],["targets/asym/asym-eye-8-r.target",6100,"33c0ad14e09c24c6b7630f56ae1271fe0a27a15f6db8784809a259b992044368"],["targets/asym/asym-jaw-1-l.target",5068,"425c211e0ac80d96e3de9682a60b8f65167fa0e8ed00a499f01acd7496c323f0"],["targets/asym/asym-jaw-1-r.target",4804,"f0cb9b5e9e33da9cc9106f31b9e54bef12c6895bedbfc7de965d37c2cd3a9acb"],["targets/asym/asym-jaw-2-l.target",3466,"6c75f845775888ed9ce05d12eaaaaaa73d012604ec395e2496d9c3dc34219885"],["targets/asym/asym-jaw-2-r.target",3477,"fa9f270714d3176781175160a673d96d7bdcf9419003cf81bbf8789596a5c20c"],["targets/asym/asym-jaw-3-l.target",6360,"ce6e64cb94419d392417f5d37f080094da4b0a581d6cc6ed080a8c0afa89d1e8"],["targets/asym/asym-jaw-3-r.target",6745,"1388854b1c425af062f755d2951bdbb6866d2b9fa0b9ae79d04594c5762a89d8"],["targets/asym/asym-mouth-1-l.target",16850,"c1d9e96131abb8bdaa98e6ec7583b9903926656a8d544206cb95ed67324d6dbc"],["targets/asym/asym-mouth-1-r.target",17178,"7910002a8025e75a34996c8e604a29bf134177cfe3fdc5f587819e89397ea736"],["targets/asym/asym-mouth-2-l.target",9511,"b7705490f83aa9b867fd0435fecab37bd139719c12ffdc8e5bc45bdda88d19a9"],["targets/asym/asym-mouth-2-r.target",10109,"348fb39bf7e8247eda0e3f0a288135f11e1be69155441eff89e0449cba1b7250"],["targets/asym/asym-nose-1-l.target",4863,"d55ddab568b13e1653d08e421e18dce5a8338716e8b46d12a326f5a5c53400cc"],["targets/asym/asym-nose-1-r.target",5169,"17d9d2d5b9adb1d420394f3c453a5160925a18e78366fd35151a4be43f603f06"],["targets/asym/asym-nose-2-l.target",5159,"bf6d9eaa29ca6c1710f4b428f494c7e9dae53246ac8f1326314b33a5cdf8c470"],["targets/asym/asym-nose-2-r.target",5205,"81bed7711b11229db54364304dd1fbcc1c1b5e47c0ffce0452688b4c24f17abb"],["targets/asym/asym-nose-3-l.target",2762,"4993a573687c9c7377b4f91a5d30b4cb575ac60ec8801c401c8824449ab7bf8b"],["targets/asym/asym-nose-3-r.target",2911,"8837034d32a6148c4ca0d82c9f10451bc993ff8124b193ddfcbc7119ef12a765"],["targets/asym/asym-nose-4-l.target",1940,"641795a4180ac061a74c24bf6eff858c5e0918c7da1964dddef800a8b7d9e76a"],["targets/asym/asym-nose-4-r.target",2024,"7eee5b5d8d3b9f23b707a55fc4c3eb707f3e6f63fe27a4f5be5992bcd596a5b7"],["targets/asym/asym-temple-1-l.target",15050,"3680d5fa9ded4d8e98c346f4b220a95954afc5bb853b63f58054d8ad18753a1b"],["targets/asym/asym-temple-1-r.target",16072,"0babd60aad9111496595f83159eb4b0664bb60afa8d25a239330c4bed2fa76ad"],["targets/asym/asym-temple-2-l.target",19604,"eb91f5cc4f95a7ac013e7e52fb6104172cc0b15d24f4e5add8a5205623528177"],["targets/asym/asym-temple-2-r.target",19643,"70227bfef51138c08a2b048d1541b029c74a708fecf45a2bf71107a299016535"],["targets/asym/asym-top-1-l.target",7998,"1eef621855bf0952a99968ba123382150de06717a41653471f03f3ae2888d265"],["targets/asym/asym-top-1-r.target",8664,"defe4b55d13c7802a5820884d2da3f9f0dfd7c18209fcdc7194f8c8648fb0faf"],["targets/asym/asym-top-2-l.target",15887,"2caf18aae9279ca6650616ef8ea2f73f7739c315beeb6c04ec08e7970797fe39"],["targets/asym/asym-top-2-r.target",15868,"d562e34108a41bb871de327642baa7237c639cf50e479c48aebdf330e842d6f0"],["targets/asym/asymm-breast-1-l.target",11229,"2f81f4075b7034ee98dad5ebd2a7baaeef55558026bdc12652bddea8651592fd"],["targets/asym/asymm-breast-1-r.target",11081,"34d013a753b5ebe017b2f28d105349e8d1963945e7e83e9ca263b49ea605dfb6"],["targets/asym/asymm-trunk-1-l.target",77142,"007e71ee1d27880e704c46de9c66b0a903b70e603cc933ae5b3fbf2317bb89ce"],["targets/asym/asymm-trunk-1-r.target",77359,"8fabb89c2a1a1e0bacd6a4854c2c91cabc0db072eab374524ae148eee0a9b9e9"],["targets/bodyshapes/bodyshapes-elvs-fem-adrenal.target",125035,"23528d8cc1c43416aacdafb86f99642f49762b9421c3854df9a7980e93ab70e3"],["targets/bodyshapes/bodyshapes-elvs-fem-apple.target",78391,"2bfda4a6057bb6daa5b108cc85dd141ce4f09bcdf652a8aea77e1bd15b757e49"],["targets/bodyshapes/bodyshapes-elvs-fem-diamond.target",76202,"0efb32f32ef0e1c15fdb9b6160d95fe430ac858b1230d40a83061cc3a0ccd8f4"],["targets/bodyshapes/bodyshapes-elvs-fem-full-hourglass.target",82389,"d7afcaf88bd5f027b86e53f7613b0bacd1c49f92de856eb8323efb725ef1d967"],["targets/bodyshapes/bodyshapes-elvs-fem-invert-triangle.target",71942,"f4e4bded4c5db8586236b1e2e9cb65ea9a055101becfa6f3c72c354813dddbfe"],["targets/bodyshapes/bodyshapes-elvs-fem-lean-column.target",71991,"170942f78210859465bfa909d6a5f72b3cddb9c128db996cc529649a76e90b1a"],["targets/bodyshapes/bodyshapes-elvs-fem-liver.target",128924,"b18d21ff3049e31a2f1cb933e05c36cb8d9886fe6010483fbf7db14bf49e4b70"],["targets/bodyshapes/bodyshapes-elvs-fem-neat-hourglass.target",70340,"e1c9d307eeddc3b372ab24e7ad764a47b055a556025a74a2ac6c3bcac9734075"],["targets/bodyshapes/bodyshapes-elvs-fem-ovary.target",91845,"6265318ada9260170a2bc3a06a736aac6b7e528599f9e43208da034deccf3ad7"],["targets/bodyshapes/bodyshapes-elvs-fem-rectangle.target",54913,"d41b931863c38cfb978478b191b2a229e0dbcfe8c713ef78eb6965e1eb5ce0e2"],["targets/bodyshapes/bodyshapes-elvs-fem-thyroid.target",239975,"a334d857359f6acf2ffe61c27438a6fe18ed4eca26bf56bff45dbd87a6dd424b"],["targets/bodyshapes/bodyshapes-elvs-fem-triangle.target",80767,"95a2a644e8628193774dc04d9736265a40a83b669f60ce8e49126cd7c9bc4541"],["targets/bodyshapes/bodyshapes-elvs-man-adrenal.target",92059,"919f759bac47a244765cf4911876b4f15443b462f68d262fe15ba72a9a9a997a"],["targets/bodyshapes/bodyshapes-elvs-man-apple.target",46712,"cec77c5100901e378d44b7ff8a85a7defcada74509831d681c02232e05d500e9"],["targets/bodyshapes/bodyshapes-elvs-man-gonadal.target",60589,"11df77013fca0394b6392b7e9d2a0c0cf8f97939a0b15e5cf62761493d67a488"],["targets/bodyshapes/bodyshapes-elvs-man-invert-triangle.target",69189,"723c0d3707d0f95f92d71e92b4a2af5287185987b877e64e426ae85ddbfdd635"],["targets/bodyshapes/bodyshapes-elvs-man-lean-column.target",51161,"bc3e0dc6e507cea2effd0ae7f16327a6de4433bd42dcc70e978c96fc3c83e3c8"],["targets/bodyshapes/bodyshapes-elvs-man-liver.target",19950,"27e86c033be521a48c0d8578e6ede527e7755c76aa00852a836ce025b1bd41aa"],["targets/bodyshapes/bodyshapes-elvs-man-rectangle.target",29039,"a02eb0c4a37617a92297dc1f3b996a2f524ef9b715c2c6cbbe5632f0e7e4d895"],["targets/bodyshapes/bodyshapes-elvs-man-thyroid.target",219665,"f3ba41185dbc0493dfb1928e87acaa7fc70353f11c0d8f8e003c5e5e661f821d"],["targets/bodyshapes/bodyshapes-elvs-man-trapezoid.target",67101,"70008ee6a816c36064f7e3bd8ee6a71122499de964275108fdb57d36c0dbedc4"],["targets/bodyshapes/bodyshapes-elvs-man-triangle.target",58265,"f3355c1371bdfb96f68661efa9b2bcd04a5d7ce79561d3ab716fd5af9ad692d8"],["targets/breast/breast-dist-decr.target",8270,"a052af5c0b7bac35b0ce429ebbf240da036d93941370d8b576e19ec837d110a3"],["targets/breast/breast-dist-incr.target",10604,"52f631c09ff5ebaa7d350cc966d2cc531017d9d554bd42a98bc3b0aee98af55f"],["targets/breast/breast-point-decr.target",9250,"aaf081541b8fc812f433b01d94ec27aa9c27e59280b0c291eb8b0962201d5ed6"],["targets/breast/breast-point-incr.target",6048,"0e5b90f891c9a84df0a19472014a78e98090247dfcc6e4edc8f2ede3215e1397"],["targets/breast/breast-trans-down.target",14280,"8174c965a1c9cd8628a5a9cca9f695ced09688a8f6a53664765778c5d95c002e"],["targets/breast/breast-trans-up.target",13392,"e8f4205ffd756416f9607afa6864291d151d6419dbb8149522c544d931ec3aca"],["targets/breast/breast-volume-vert-down.target",6320,"1689663bfae4a32e7480770269f78022b011b02c9a6a7246674a830f4f82a6b0"],["targets/breast/breast-volume-vert-up.target",10409,"12345ed40a248104c51c63aac01380502ef651fcadd0c7e8e9445bde68427b05"],["targets/breast/female-child-averagemuscle-averageweight-averagecup-maxfirmness.target",6185,"8be6f61da3536a09c9f03717867bd0f2f791aad002375d8fa700efb68dac08bf"],["targets/breast/female-child-averagemuscle-averageweight-averagecup-minfirmness.target",5333,"6ac85ee18cf424cfc8d15eb4ee4678d2ec24d27d7f1f6b3a8e1aa506ced389ec"],["targets/breast/female-child-averagemuscle-averageweight-maxcup-averagefirmness.target",15680,"1287b1dd4b67b3872b4dea44e83b0dc5437431cd9e9f87499f435ca54d9752ae"],["targets/breast/female-child-averagemuscle-averageweight-maxcup-maxfirmness.target",15365,"3eeac3052ad5fabcc8afa0796e7c5f00031326d796afccc314e0b6b129da89a8"],["targets/breast/female-child-averagemuscle-averageweight-maxcup-minfirmness.target",19114,"6791cb94c9225adefafcf068178fb0666834e894ab3b199543c5e8622eed4bd2"],["targets/breast/female-child-averagemuscle-averageweight-mincup-averagefirmness.target",6648,"b92a2de380ff77c50f64768b09f06ec815c2653ffb16fd0da8a54efafabe1125"],["targets/breast/female-child-averagemuscle-averageweight-mincup-maxfirmness.target",6648,"b92a2de380ff77c50f64768b09f06ec815c2653ffb16fd0da8a54efafabe1125"],["targets/breast/female-child-averagemuscle-averageweight-mincup-minfirmness.target",6648,"b92a2de380ff77c50f64768b09f06ec815c2653ffb16fd0da8a54efafabe1125"],["targets/breast/female-child-averagemuscle-maxweight-averagecup-maxfirmness.target",5825,"2829e7dcc9bff9b283936dc3a7c96e760f7e9033d3768de633cbb4d07b97f3b2"],["targets/breast/female-child-averagemuscle-maxweight-averagecup-minfirmness.target",5124,"e109f76b24d6440c1aaf498d15eff5faef4723b21e9f5ce060b3e124b63731d7"],["targets/breast/female-child-averagemuscle-maxweight-maxcup-averagefirmness.target",15495,"2c40384adfc19e7c2467814b2a5a7a0ed5df605473af3fda7f30f388073a1232"],["targets/breast/female-child-averagemuscle-maxweight-maxcup-maxfirmness.target",17107,"6a5c96e9dd4bf812a58a4862d7027f3fb99f26d363007d03fa99d47587e6bc41"],["targets/breast/female-child-averagemuscle-maxweight-maxcup-minfirmness.target",20098,"f2462ffd82065bd5d9ef5dac37fc64ff397f85b5cf1297ddaeb483305b4c3fcf"],["targets/breast/female-child-averagemuscle-maxweight-mincup-averagefirmness.target",6481,"6d3f536b954a05d54037981b6ec273dd715978b43bc7f7b2543c0d2389f9a8b4"],["targets/breast/female-child-averagemuscle-maxweight-mincup-maxfirmness.target",6481,"6d3f536b954a05d54037981b6ec273dd715978b43bc7f7b2543c0d2389f9a8b4"],["targets/breast/female-child-averagemuscle-maxweight-mincup-minfirmness.target",6481,"6d3f536b954a05d54037981b6ec273dd715978b43bc7f7b2543c0d2389f9a8b4"],["targets/breast/female-child-averagemuscle-minweight-averagecup-maxfirmness.target",6524,"d9a607382d166bff59e1516050514831b21b1073a0d222a8c3e24a7fc3dba2ad"],["targets/breast/female-child-averagemuscle-minweight-averagecup-minfirmness.target",5124,"e109f76b24d6440c1aaf498d15eff5faef4723b21e9f5ce060b3e124b63731d7"],["targets/breast/female-child-averagemuscle-minweight-maxcup-averagefirmness.target",15500,"3a5ee60a9268c73a3536b020aada20eb6d09df234bef3f56c87b8acbe0102159"],["targets/breast/female-child-averagemuscle-minweight-maxcup-maxfirmness.target",15331,"dc9434afcb50ab7d68d688fce668aaf44900cf95b850b2f5596721ee7a15c176"],["targets/breast/female-child-averagemuscle-minweight-maxcup-minfirmness.target",19219,"7f91887f5a5feddec41aaf4f7dfc9421fa55c073c5acf0d907ef3324718bef9b"],["targets/breast/female-child-averagemuscle-minweight-mincup-averagefirmness.target",4907,"12f345bf72dde714b9ed14e43406188a957c92bee20ccbc6db0c5689317f4d25"],["targets/breast/female-child-averagemuscle-minweight-mincup-maxfirmness.target",4907,"12f345bf72dde714b9ed14e43406188a957c92bee20ccbc6db0c5689317f4d25"],["targets/breast/female-child-averagemuscle-minweight-mincup-minfirmness.target",4907,"12f345bf72dde714b9ed14e43406188a957c92bee20ccbc6db0c5689317f4d25"],["targets/breast/female-child-maxmuscle-averageweight-averagecup-maxfirmness.target",5992,"5252bce227d728aac84862aa8f4bacf36f56edf8725cb6b9b14544bb37ff44d8"],["targets/breast/female-child-maxmuscle-averageweight-averagecup-minfirmness.target",5124,"e109f76b24d6440c1aaf498d15eff5faef4723b21e9f5ce060b3e124b63731d7"],["targets/breast/female-child-maxmuscle-averageweight-maxcup-averagefirmness.target",15693,"9bd69313fb273efb09005fe6c79468375a36fc6ee6aec05e83cfab9a4fac61da"],["targets/breast/female-child-maxmuscle-averageweight-maxcup-maxfirmness.target",15335,"e1b93b57117b4ec7e5026e52f8f73c8ef42d81c4b85a5467db80474c5cd42607"],["targets/breast/female-child-maxmuscle-averageweight-maxcup-minfirmness.target",19201,"040760f5bfb0d2482be93ad00125f3632755cd80d9a72563b9135939f654122d"],["targets/breast/female-child-maxmuscle-averageweight-mincup-averagefirmness.target",6943,"8ee9b0bca9f6efbe797eee8a194944705475f73c9331bfa295de336452d98c15"],["targets/breast/female-child-maxmuscle-averageweight-mincup-maxfirmness.target",6943,"8ee9b0bca9f6efbe797eee8a194944705475f73c9331bfa295de336452d98c15"],["targets/breast/female-child-maxmuscle-averageweight-mincup-minfirmness.target",6943,"8ee9b0bca9f6efbe797eee8a194944705475f73c9331bfa295de336452d98c15"],["targets/breast/female-child-maxmuscle-maxweight-averagecup-maxfirmness.target",5952,"08376a37f4bd5cadd5ef033567bb817ffc77c42d3f615f2b695456f9b609cf89"],["targets/breast/female-child-maxmuscle-maxweight-averagecup-minfirmness.target",5124,"e109f76b24d6440c1aaf498d15eff5faef4723b21e9f5ce060b3e124b63731d7"],["targets/breast/female-child-maxmuscle-maxweight-maxcup-averagefirmness.target",15561,"90610fe85f6dd1236768b97412f8404bc81dccc2c936092f1ba30dc42ae78bc6"],["targets/breast/female-child-maxmuscle-maxweight-maxcup-maxfirmness.target",15320,"b68a1a7112aeb15cb625aad8d032668914ef957f10b02a80c1d9a2f05bf78d3f"],["targets/breast/female-child-maxmuscle-maxweight-maxcup-minfirmness.target",19252,"08150fd5a45155f47df95958c1392da35851003bd13f539ba46f6021a8f9e726"],["targets/breast/female-child-maxmuscle-maxweight-mincup-averagefirmness.target",7034,"26eabbd267d1e005ffb8a5c38ba78d30b1c6598359d20477e1b190295d580490"],["targets/breast/female-child-maxmuscle-maxweight-mincup-maxfirmness.target",7034,"26eabbd267d1e005ffb8a5c38ba78d30b1c6598359d20477e1b190295d580490"],["targets/breast/female-child-maxmuscle-maxweight-mincup-minfirmness.target",7034,"26eabbd267d1e005ffb8a5c38ba78d30b1c6598359d20477e1b190295d580490"],["targets/breast/female-child-maxmuscle-minweight-averagecup-maxfirmness.target",5726,"399fa65ee226d102f8332761158bee1fae924b8f6f5adb0aa705fd8026f457f8"],["targets/breast/female-child-maxmuscle-minweight-averagecup-minfirmness.target",5124,"e109f76b24d6440c1aaf498d15eff5faef4723b21e9f5ce060b3e124b63731d7"],["targets/breast/female-child-maxmuscle-minweight-maxcup-averagefirmness.target",15582,"9f545220450650a337184f6bcad8f938821e5c4b62707320f1ff1f56ca253d15"],["targets/breast/female-child-maxmuscle-minweight-maxcup-maxfirmness.target",15315,"b47c05ebc6e70240d1acb2887527db3354b7b7bb055415fa45b4c47a64fd1564"],["targets/breast/female-child-maxmuscle-minweight-maxcup-minfirmness.target",19124,"a631c8a1291a3dfb804b6a6670b885db4aae3d82682027922673f26151ecc205"],["targets/breast/female-child-maxmuscle-minweight-mincup-averagefirmness.target",6400,"4101c429b7a4967129a9457dc4cb69199d6a73f47a2a48fa5aac3d99c03bfd66"],["targets/breast/female-child-maxmuscle-minweight-mincup-maxfirmness.target",6400,"4101c429b7a4967129a9457dc4cb69199d6a73f47a2a48fa5aac3d99c03bfd66"],["targets/breast/female-child-maxmuscle-minweight-mincup-minfirmness.target",6400,"4101c429b7a4967129a9457dc4cb69199d6a73f47a2a48fa5aac3d99c03bfd66"],["targets/breast/female-child-minmuscle-averageweight-averagecup-maxfirmness.target",5842,"793dae48f4ac5fde4f559b077a4fae298a8f1b376266e3efb373bf61428dc734"],["targets/breast/female-child-minmuscle-averageweight-averagecup-minfirmness.target",5772,"bfb5361da58ef7a5d09a9bd34fced1c63aa8f6d101a93d1d8c04b56defa2302c"],["targets/breast/female-child-minmuscle-averageweight-maxcup-averagefirmness.target",15511,"df90a22ba6ce77531ce7adeae703e6e925372957e96e63064dff816891981a62"],["targets/breast/female-child-minmuscle-averageweight-maxcup-maxfirmness.target",15347,"ff08ebd4087ab601e612ba840c9188b0b31f96976cd0cc7fa5abdd22b2c9611f"],["targets/breast/female-child-minmuscle-averageweight-maxcup-minfirmness.target",19513,"1a7bbb6bc6dc933007a4f688f902a087aaf8df62bdb804d00d47cc6e9012c288"],["targets/breast/female-child-minmuscle-averageweight-mincup-averagefirmness.target",6481,"6d3f536b954a05d54037981b6ec273dd715978b43bc7f7b2543c0d2389f9a8b4"],["targets/breast/female-child-minmuscle-averageweight-mincup-maxfirmness.target",6481,"6d3f536b954a05d54037981b6ec273dd715978b43bc7f7b2543c0d2389f9a8b4"],["targets/breast/female-child-minmuscle-averageweight-mincup-minfirmness.target",6481,"6d3f536b954a05d54037981b6ec273dd715978b43bc7f7b2543c0d2389f9a8b4"],["targets/breast/female-child-minmuscle-maxweight-averagecup-maxfirmness.target",5852,"f3e73d9eb98c98a1bff3a7b9a287b9fab26216b1e3e5cd9ef945e3ee83beadb2"],["targets/breast/female-child-minmuscle-maxweight-averagecup-minfirmness.target",5598,"c928ff99a9f917bafda0a812ed510b7bde8adec3dce7312c5020b1d05d9ebf7c"],["targets/breast/female-child-minmuscle-maxweight-maxcup-averagefirmness.target",15501,"e4cef8d52578b2e46c5571411cc3de88766994186b2882c44a1c1a6caa9205b1"],["targets/breast/female-child-minmuscle-maxweight-maxcup-maxfirmness.target",15323,"b83acb2bf83d82b266580bcbed49f2197f1a9fbb58d4d3e6aebb2ea7dff72663"],["targets/breast/female-child-minmuscle-maxweight-maxcup-minfirmness.target",19269,"0cf28aa8c9672a73954d4e58c23443152caf888a4ca08cf40611ccbcb5bebf85"],["targets/breast/female-child-minmuscle-maxweight-mincup-averagefirmness.target",6638,"8f9b4f7642563c6435eac5b0e41f48b88ba4b092f62b05f042b00833148f25c1"],["targets/breast/female-child-minmuscle-maxweight-mincup-maxfirmness.target",6638,"8f9b4f7642563c6435eac5b0e41f48b88ba4b092f62b05f042b00833148f25c1"],["targets/breast/female-child-minmuscle-maxweight-mincup-minfirmness.target",6638,"8f9b4f7642563c6435eac5b0e41f48b88ba4b092f62b05f042b00833148f25c1"],["targets/breast/female-child-minmuscle-minweight-averagecup-maxfirmness.target",5817,"005d3fec765fefd294338e18c20dd9c8152cda4c616e0fdef1917d08450b9a3c"],["targets/breast/female-child-minmuscle-minweight-averagecup-minfirmness.target",5152,"4351a601fa9d4020981d38122e8a50ef2259b23cbe177ef82d71d74df0fa0c79"],["targets/breast/female-child-minmuscle-minweight-maxcup-averagefirmness.target",14588,"1947efabd39e7410b250580b8781202f5cd6b22daa67f7b67d2607014abfd0ad"],["targets/breast/female-child-minmuscle-minweight-maxcup-maxfirmness.target",15365,"cc9d1e6686a4243418b0dad0d9468e5f09ab342181f326ae17f2d100dcd9b013"],["targets/breast/female-child-minmuscle-minweight-maxcup-minfirmness.target",19283,"ea4019b1f442cc040e6e56f4d186a2bdd6580379f371ec4481e3b5ba882f0515"],["targets/breast/female-child-minmuscle-minweight-mincup-averagefirmness.target",6750,"098df66d3ccd4efbf0c5fa23efb936bd2f3acbe1f27a8db8b689ac84c4e4b7d3"],["targets/breast/female-child-minmuscle-minweight-mincup-maxfirmness.target",6750,"098df66d3ccd4efbf0c5fa23efb936bd2f3acbe1f27a8db8b689ac84c4e4b7d3"],["targets/breast/female-child-minmuscle-minweight-mincup-minfirmness.target",6750,"098df66d3ccd4efbf0c5fa23efb936bd2f3acbe1f27a8db8b689ac84c4e4b7d3"],["targets/breast/female-old-averagemuscle-averageweight-averagecup-maxfirmness.target",6213,"8598aea676cdb96d93a9dcdc662a483045efab2fd32789fcadee8961d34e1b81"],["targets/breast/female-old-averagemuscle-averageweight-averagecup-minfirmness.target",6838,"98a8378ed036a27f44a8010adf1d44f72f226c005ce2e16375cad116a9748b11"],["targets/breast/female-old-averagemuscle-averageweight-maxcup-averagefirmness.target",17006,"036c61a1a56a98bcced358f9f997b5d20d638d071c9afeda4611d1c04f8da3c5"],["targets/breast/female-old-averagemuscle-averageweight-maxcup-maxfirmness.target",16895,"aee90ac32cc8f529d2ede399d3d0d0409516ee3d23566a8a578d7cc8c9c4ac0a"],["targets/breast/female-old-averagemuscle-averageweight-maxcup-minfirmness.target",18890,"9b61b0f8657797bca2cbd789e031763d04afa739286a5379508f220bd99c3362"],["targets/breast/female-old-averagemuscle-averageweight-mincup-averagefirmness.target",15069,"13f4eab82fc190401f6d35e6828a2bbc7ad97a0d07dad0a87c93871ce5e2874e"],["targets/breast/female-old-averagemuscle-averageweight-mincup-maxfirmness.target",15069,"13f4eab82fc190401f6d35e6828a2bbc7ad97a0d07dad0a87c93871ce5e2874e"],["targets/breast/female-old-averagemuscle-averageweight-mincup-minfirmness.target",15069,"13f4eab82fc190401f6d35e6828a2bbc7ad97a0d07dad0a87c93871ce5e2874e"],["targets/breast/female-old-averagemuscle-maxweight-averagecup-maxfirmness.target",6084,"c372b5e3a4d42c093fcc622c70b1b7ee758e44ff939f846d51ccac901284fedb"],["targets/breast/female-old-averagemuscle-maxweight-averagecup-minfirmness.target",6496,"5a0cc6e300aaa7b0d4aca66d33f33d2614cec1e91af498e36791f784b75d3380"],["targets/breast/female-old-averagemuscle-maxweight-maxcup-averagefirmness.target",17058,"815d13e4d3035cdf20eb68692d1a2813fdbda34916a242bdfcdf38fc51609bb7"],["targets/breast/female-old-averagemuscle-maxweight-maxcup-maxfirmness.target",17055,"e4be003069674312b03beb863faa3c367312add58dc2939379537b32bcea4444"],["targets/breast/female-old-averagemuscle-maxweight-maxcup-minfirmness.target",18923,"f6d7816e230327501652e78d52bb3a178c4f923f1ef41fcf77bbd6f77d049ff9"],["targets/breast/female-old-averagemuscle-maxweight-mincup-averagefirmness.target",15030,"123e0988e60fba6dfae60afb0e4de3790eac80411f3f02cfd62301384461f653"],["targets/breast/female-old-averagemuscle-maxweight-mincup-maxfirmness.target",15030,"123e0988e60fba6dfae60afb0e4de3790eac80411f3f02cfd62301384461f653"],["targets/breast/female-old-averagemuscle-maxweight-mincup-minfirmness.target",15030,"123e0988e60fba6dfae60afb0e4de3790eac80411f3f02cfd62301384461f653"],["targets/breast/female-old-averagemuscle-minweight-averagecup-maxfirmness.target",6050,"b4a2b0cfb5208d1ef61284580a3ba5c248999aeacb47111fda750f350e8359ea"],["targets/breast/female-old-averagemuscle-minweight-averagecup-minfirmness.target",6050,"b4a2b0cfb5208d1ef61284580a3ba5c248999aeacb47111fda750f350e8359ea"],["targets/breast/female-old-averagemuscle-minweight-maxcup-averagefirmness.target",17264,"31fd9f7675cbd61dc1fe1d9ae2dc1f349ae95291772bb5d5d377918183a31982"],["targets/breast/female-old-averagemuscle-minweight-maxcup-maxfirmness.target",18085,"3f3ddd679ee72f3ad9d09c58ebd7450f06ab474039787f4db024e5ab114e7c3a"],["targets/breast/female-old-averagemuscle-minweight-maxcup-minfirmness.target",19164,"86db380ec947dea2416030fa9490114900c99784674ae9a3bf9f8312be0a6795"],["targets/breast/female-old-averagemuscle-minweight-mincup-averagefirmness.target",7757,"1ec30cec3bd25ffe4ad8388f570b84ee70cf446cb9e5b6b7998359c5a10238a4"],["targets/breast/female-old-averagemuscle-minweight-mincup-maxfirmness.target",7757,"1ec30cec3bd25ffe4ad8388f570b84ee70cf446cb9e5b6b7998359c5a10238a4"],["targets/breast/female-old-averagemuscle-minweight-mincup-minfirmness.target",7757,"1ec30cec3bd25ffe4ad8388f570b84ee70cf446cb9e5b6b7998359c5a10238a4"],["targets/breast/female-old-maxmuscle-averageweight-averagecup-maxfirmness.target",5592,"9c16b1c497ff3aa1303b8fd53d9758e13cdf98e1f0ed6fdce9dca48fbe611307"],["targets/breast/female-old-maxmuscle-averageweight-averagecup-minfirmness.target",8092,"7be6b922be66f57fecdedc279eb35c03411ba44e4a9db4514cb6bcd6f3cdc07d"],["targets/breast/female-old-maxmuscle-averageweight-maxcup-averagefirmness.target",17004,"69d2b57c133017c41f7969c1bcec4f8f25aca16d6a906075c268fd07d636e4c6"],["targets/breast/female-old-maxmuscle-averageweight-maxcup-maxfirmness.target",17284,"8629aab40c06c21780cfd159232575ce55bf73d78428da34512ef61e71faf061"],["targets/breast/female-old-maxmuscle-averageweight-maxcup-minfirmness.target",18878,"bcc6f37750cb00cb4243a623c84cb78fe29f92cf3aa32fd34165c16de9398835"],["targets/breast/female-old-maxmuscle-averageweight-mincup-averagefirmness.target",6917,"7eb55cb317edcec94ba946e226b849b66260ac82e733d7e22ff2d9c44401403b"],["targets/breast/female-old-maxmuscle-averageweight-mincup-maxfirmness.target",6917,"7eb55cb317edcec94ba946e226b849b66260ac82e733d7e22ff2d9c44401403b"],["targets/breast/female-old-maxmuscle-averageweight-mincup-minfirmness.target",6917,"7eb55cb317edcec94ba946e226b849b66260ac82e733d7e22ff2d9c44401403b"],["targets/breast/female-old-maxmuscle-maxweight-averagecup-maxfirmness.target",17083,"4d9beb05083a1baa2acc1ef1adf84591e29adc70bddb86cff52fd07ba409d2c4"],["targets/breast/female-old-maxmuscle-maxweight-averagecup-minfirmness.target",8343,"609c7d7fe515656e27d332efc20f2570ac08c59251ddb2529f0ca58234a4af0c"],["targets/breast/female-old-maxmuscle-maxweight-maxcup-averagefirmness.target",17223,"a9de2de4e82bde1f13f5bf8413c06fc80eb4041c8e6566a6046ab911d6a09e09"],["targets/breast/female-old-maxmuscle-maxweight-maxcup-maxfirmness.target",17083,"4d9beb05083a1baa2acc1ef1adf84591e29adc70bddb86cff52fd07ba409d2c4"],["targets/breast/female-old-maxmuscle-maxweight-maxcup-minfirmness.target",19085,"137a1b9095c75d25b1d952ecec2b158c6a074730908deafd607a8c6d5d80cf53"],["targets/breast/female-old-maxmuscle-maxweight-mincup-averagefirmness.target",15018,"5c96e45b139f96852eae2b3caae9e6599d15ba185fb955bc3d2c5cb70409b560"],["targets/breast/female-old-maxmuscle-maxweight-mincup-maxfirmness.target",15018,"5c96e45b139f96852eae2b3caae9e6599d15ba185fb955bc3d2c5cb70409b560"],["targets/breast/female-old-maxmuscle-maxweight-mincup-minfirmness.target",15018,"5c96e45b139f96852eae2b3caae9e6599d15ba185fb955bc3d2c5cb70409b560"],["targets/breast/female-old-maxmuscle-minweight-averagecup-maxfirmness.target",5361,"cdbe6b8bffe2137fdd0bf7e9e424104a60d5c979bf726cce1983eb022127a042"],["targets/breast/female-old-maxmuscle-minweight-averagecup-minfirmness.target",8384,"25a9b76558a8518a5cbd9ccf0320cf88ca57b56deafb6be43a545b377a75949b"],["targets/breast/female-old-maxmuscle-minweight-maxcup-averagefirmness.target",17067,"fe30750b6df1aa68b362c249439d474e185592d674ce664cc05dec42b0afa6f7"],["targets/breast/female-old-maxmuscle-minweight-maxcup-maxfirmness.target",16875,"8f55f22e5c60dc99359eb485508b78261ba459a136d1a701f0f23007152b8ffa"],["targets/breast/female-old-maxmuscle-minweight-maxcup-minfirmness.target",19625,"6339bed7d94f58cddff4b5e127dbc44047436666ec67865a56175fa56450e4cb"],["targets/breast/female-old-maxmuscle-minweight-mincup-averagefirmness.target",5890,"b762a8b639336e6c04ef2aeba6ea83d415f8e752fac66b8de1ad79df4680ed09"],["targets/breast/female-old-maxmuscle-minweight-mincup-maxfirmness.target",5890,"b762a8b639336e6c04ef2aeba6ea83d415f8e752fac66b8de1ad79df4680ed09"],["targets/breast/female-old-maxmuscle-minweight-mincup-minfirmness.target",5890,"b762a8b639336e6c04ef2aeba6ea83d415f8e752fac66b8de1ad79df4680ed09"],["targets/breast/female-old-minmuscle-averageweight-averagecup-maxfirmness.target",5602,"425e86bdd0b528df19086beaf676eee2b60a1c629a1c884e0afa373adf730802"],["targets/breast/female-old-minmuscle-averageweight-averagecup-minfirmness.target",6750,"599d42c2acd7c9f03183ef11a43d2bf68f79742dfdb892bab5b4fc194a22e281"],["targets/breast/female-old-minmuscle-averageweight-maxcup-averagefirmness.target",17037,"835b679c41c93d32534c7f859d0f351d19dab8d9e59aa23d70027e4b1df7d665"],["targets/breast/female-old-minmuscle-averageweight-maxcup-maxfirmness.target",16871,"42aba289a702a0003707ca8a3a1ea90b471fcfbd86c880f6d8748d6faaa45a75"],["targets/breast/female-old-minmuscle-averageweight-maxcup-minfirmness.target",14877,"4b241092e4d09027889728ce670ee187f6a77d7f4b3c3bf42ff750790d3d3837"],["targets/breast/female-old-minmuscle-averageweight-mincup-averagefirmness.target",15002,"dd6bd63583873e2867303008c8bd08e597e52dc3971bf58e58213a20aa4c4597"],["targets/breast/female-old-minmuscle-averageweight-mincup-maxfirmness.target",15002,"dd6bd63583873e2867303008c8bd08e597e52dc3971bf58e58213a20aa4c4597"],["targets/breast/female-old-minmuscle-averageweight-mincup-minfirmness.target",15002,"dd6bd63583873e2867303008c8bd08e597e52dc3971bf58e58213a20aa4c4597"],["targets/breast/female-old-minmuscle-maxweight-averagecup-maxfirmness.target",11147,"aea258da3a233920b226283057dcd7c254547de06352a7e76d5492f1e2f0bdff"],["targets/breast/female-old-minmuscle-maxweight-averagecup-minfirmness.target",12033,"503b6f3c2184014a9f84b4808b27a68d3626652120028b171b7ff529ad4d2da9"],["targets/breast/female-old-minmuscle-maxweight-maxcup-averagefirmness.target",18605,"17df95a233fa83dc3e4ef7f14ab912e20e92021054de43cec3159a4450679a3b"],["targets/breast/female-old-minmuscle-maxweight-maxcup-maxfirmness.target",16192,"97cd7f433ed79b53ae0ecf2e0379325750688fab22e91005d72f56e4cd954dd8"],["targets/breast/female-old-minmuscle-maxweight-maxcup-minfirmness.target",16219,"58263f04487bb2b20669b1a24be6661fe6400a6f925d782d101e805ce0a0b02b"],["targets/breast/female-old-minmuscle-maxweight-mincup-averagefirmness.target",13684,"4e2d421ce38bdbfd509b5a828ce3ce15fd6acaae3a602c91644123a4fb44944b"],["targets/breast/female-old-minmuscle-maxweight-mincup-maxfirmness.target",13684,"4e2d421ce38bdbfd509b5a828ce3ce15fd6acaae3a602c91644123a4fb44944b"],["targets/breast/female-old-minmuscle-maxweight-mincup-minfirmness.target",13684,"4e2d421ce38bdbfd509b5a828ce3ce15fd6acaae3a602c91644123a4fb44944b"],["targets/breast/female-old-minmuscle-minweight-averagecup-maxfirmness.target",5874,"7290a217d143c98e34150e9979b327e9ce79b112d6befb01dae775ca61f998cc"],["targets/breast/female-old-minmuscle-minweight-averagecup-minfirmness.target",4633,"476e737714bbc82c73282037aac4cc091440f55336b01783d032f2a2fe40dc1e"],["targets/breast/female-old-minmuscle-minweight-maxcup-averagefirmness.target",16299,"faa75b3abb5c34828e2f0ed4b5f3ef5d02b2631848376a65fefd99f4dde065bd"],["targets/breast/female-old-minmuscle-minweight-maxcup-maxfirmness.target",14005,"9d318fd60548c7fac4cafa9b4f30ef1a2035ca47a5cd11ac29a2db991e35d9e3"],["targets/breast/female-old-minmuscle-minweight-maxcup-minfirmness.target",15633,"376cfc28eee204e01c06225201fe139e6da988da25a9f94bb82f3c34ed2c7325"],["targets/breast/female-old-minmuscle-minweight-mincup-averagefirmness.target",9194,"3ed55f690b9b456250307a0ae73ee113f94eb3385b778fa8f0eb032e22c8ed97"],["targets/breast/female-old-minmuscle-minweight-mincup-maxfirmness.target",9194,"3ed55f690b9b456250307a0ae73ee113f94eb3385b778fa8f0eb032e22c8ed97"],["targets/breast/female-old-minmuscle-minweight-mincup-minfirmness.target",9194,"3ed55f690b9b456250307a0ae73ee113f94eb3385b778fa8f0eb032e22c8ed97"],["targets/breast/female-young-averagemuscle-averageweight-averagecup-maxfirmness.target",6193,"31f1d91824fcbb98ccf52f2c4d20c8e7c77c77ae596c58d1cf91c34801552b60"],["targets/breast/female-young-averagemuscle-averageweight-averagecup-minfirmness.target",7331,"0034893c985e04012db712bc140d83a41ea3b9e12c48df1461dad388a716b553"],["targets/breast/female-young-averagemuscle-averageweight-maxcup-averagefirmness.target",15334,"b5aaa1595cf4efcee69022fc60034d93ab6f6fc473e6f8e162e5526803b074bf"],["targets/breast/female-young-averagemuscle-averageweight-maxcup-maxfirmness.target",15581,"76737472bf148e69bd5e80da982b88aa0926b51ef9ea1ac6217da88d86cf55cf"],["targets/breast/female-young-averagemuscle-averageweight-maxcup-minfirmness.target",18870,"86b295a63ad779e7e86051a166a8b5fb76c35814c03b66a63b68b803edfcd5d3"],["targets/breast/female-young-averagemuscle-averageweight-mincup-averagefirmness.target",12019,"65e4ca16353f6c0e23b420cf5d9b31d8993943b76e6cd3a6961943371dd6bc2f"],["targets/breast/female-young-averagemuscle-averageweight-mincup-maxfirmness.target",12019,"65e4ca16353f6c0e23b420cf5d9b31d8993943b76e6cd3a6961943371dd6bc2f"],["targets/breast/female-young-averagemuscle-averageweight-mincup-minfirmness.target",12019,"65e4ca16353f6c0e23b420cf5d9b31d8993943b76e6cd3a6961943371dd6bc2f"],["targets/breast/female-young-averagemuscle-maxweight-averagecup-maxfirmness.target",6228,"02a3f8a7422aaf1655a9e8f0c3edd276581d07482ad8b59057d6c6397dfb4c90"],["targets/breast/female-young-averagemuscle-maxweight-averagecup-minfirmness.target",7408,"71348a68fe579f11554afb702062220cedca22cf7ca6ae8222d34af0a9c62a84"],["targets/breast/female-young-averagemuscle-maxweight-maxcup-averagefirmness.target",15338,"05544ef4bed841fa7944335aedc887abad0b442c3209fa3254ba47f8631a9f82"],["targets/breast/female-young-averagemuscle-maxweight-maxcup-maxfirmness.target",15444,"16ccf9ae926c23b4b215173f4edde6b79d2cffc51ebe7108c61e1dfc3bb5fb89"],["targets/breast/female-young-averagemuscle-maxweight-maxcup-minfirmness.target",17859,"8c05c6d7fcca0111ab9d08869748b0fe554a985381b53c527c3a7c916f25333a"],["targets/breast/female-young-averagemuscle-maxweight-mincup-averagefirmness.target",11902,"f7b60522393f5b7d82ac3fa14ec903b26e031d77b83c41f8cffd80e845bf804f"],["targets/breast/female-young-averagemuscle-maxweight-mincup-maxfirmness.target",11902,"f7b60522393f5b7d82ac3fa14ec903b26e031d77b83c41f8cffd80e845bf804f"],["targets/breast/female-young-averagemuscle-maxweight-mincup-minfirmness.target",11902,"f7b60522393f5b7d82ac3fa14ec903b26e031d77b83c41f8cffd80e845bf804f"],["targets/breast/female-young-averagemuscle-minweight-averagecup-maxfirmness.target",4866,"cb35d792634d1cba1a532c7e172f44bd6db563ab45b42faa91fe794e8cb1e697"],["targets/breast/female-young-averagemuscle-minweight-averagecup-minfirmness.target",8920,"c1c1ac06662211505f5d710149275ef76f431f98ada24fdf0706d367c1e0760c"],["targets/breast/female-young-averagemuscle-minweight-maxcup-averagefirmness.target",15444,"bc0653099dc3c7bd490642b0a5e718939bbeec33f86095b69d724567adfba3b6"],["targets/breast/female-young-averagemuscle-minweight-maxcup-maxfirmness.target",15446,"2e975bc0268147d938198ca76093fdfc44279be08a80052e7e73926ab29e97fb"],["targets/breast/female-young-averagemuscle-minweight-maxcup-minfirmness.target",17806,"106393b8e3a1ee69eb0b17c3c2a37c99c061ed88210ae347480b1d71304ea112"],["targets/breast/female-young-averagemuscle-minweight-mincup-averagefirmness.target",13084,"f7c34c72a4461cbf8edc9f615613e2d19dd164a1d19022d72bd67efb7248f5ca"],["targets/breast/female-young-averagemuscle-minweight-mincup-maxfirmness.target",12865,"659b0475b08964d373a5af7f405e86c88ce8d76dbdbafff5db955b6bda65e005"],["targets/breast/female-young-averagemuscle-minweight-mincup-minfirmness.target",13118,"d7166c4bb33cc47c50a8a1b29c4e548d3ceca0783ecd24a26ea58359b4d89b57"],["targets/breast/female-young-maxmuscle-averageweight-averagecup-maxfirmness.target",6236,"2a7f7d1cfeab45fba2b2f89318694c89f7b5afa1ab4395fdf2f5e37c46e6f634"],["targets/breast/female-young-maxmuscle-averageweight-averagecup-minfirmness.target",7261,"e841c5ea679fd911e8fd60e42d987ec4513185f81918d3545f9c3f52f9f6a0fa"],["targets/breast/female-young-maxmuscle-averageweight-maxcup-averagefirmness.target",15430,"ee30c72778b92897da2cb71c65cee08a0f9d299d19d26a99288ad7bf13e5b4b1"],["targets/breast/female-young-maxmuscle-averageweight-maxcup-maxfirmness.target",15460,"3a99cd342479e57e1b20aae5515d87cbd17499505dbdffd6346d1d734b250f65"],["targets/breast/female-young-maxmuscle-averageweight-maxcup-minfirmness.target",17780,"e5dae9aba6fb8acbb4462c85fcbfd44e6041461c01130813fc7d372c33b77925"],["targets/breast/female-young-maxmuscle-averageweight-mincup-averagefirmness.target",12856,"f9e827e1f0af0dec1f04f96f1ce771f281bb51fbcf6e4a01be5cb6be24a89383"],["targets/breast/female-young-maxmuscle-averageweight-mincup-maxfirmness.target",12856,"f9e827e1f0af0dec1f04f96f1ce771f281bb51fbcf6e4a01be5cb6be24a89383"],["targets/breast/female-young-maxmuscle-averageweight-mincup-minfirmness.target",12650,"89a9fbb1ccb21da2a54a647a7c08ead8a527425786c2f3d2f218d5c81b14ffa2"],["targets/breast/female-young-maxmuscle-maxweight-averagecup-maxfirmness.target",6157,"1119cc2d73994980bb2bba6eca663395ddcdc0ef25825e545e72d20fdb68b191"],["targets/breast/female-young-maxmuscle-maxweight-averagecup-minfirmness.target",7234,"3be15013427705e85aa0066017827fd0bcc2f45effca8b0b4c9ccfaa2dcd0d52"],["targets/breast/female-young-maxmuscle-maxweight-maxcup-averagefirmness.target",15396,"cea1964ff0831345fe431f288fdffacf60d252476d384e34b8b8ae144499caa9"],["targets/breast/female-young-maxmuscle-maxweight-maxcup-maxfirmness.target",14549,"bf446331f05d008280a35b4c6a02b4a45c8ca293f6c859076f3f1362516a6d39"],["targets/breast/female-young-maxmuscle-maxweight-maxcup-minfirmness.target",18850,"2775ca7573c3528d048dcb06bfcdc46c75a771ad82e717be4719f569e9800099"],["targets/breast/female-young-maxmuscle-maxweight-mincup-averagefirmness.target",13527,"ccae5bd0f7f146615e89a49db08e4457399331d1793353c6f30786c5999e52cc"],["targets/breast/female-young-maxmuscle-maxweight-mincup-maxfirmness.target",13042,"fbf037406329c35d0271ecf283e3ea076d64e4a4aad013364fed6345f3b2d94c"],["targets/breast/female-young-maxmuscle-maxweight-mincup-minfirmness.target",13643,"539fd6a14663b06c2d1d6d912dbf34d07403cb70a90c41622fa9844fae6554ad"],["targets/breast/female-young-maxmuscle-minweight-averagecup-maxfirmness.target",4866,"cb35d792634d1cba1a532c7e172f44bd6db563ab45b42faa91fe794e8cb1e697"],["targets/breast/female-young-maxmuscle-minweight-averagecup-minfirmness.target",8579,"c9cde97bdb7133e9a4edd76091123dfe8f89361dc9c986ec05e7c3012dbeaae8"],["targets/breast/female-young-maxmuscle-minweight-maxcup-averagefirmness.target",15450,"1ea8f093dda8a93c04608a4f78bc54898e6979105244f21946e11db3f7514c2a"],["targets/breast/female-young-maxmuscle-minweight-maxcup-maxfirmness.target",15400,"4a4230c96fbe4d7dc68f6088923c1705d47f81534c50573afd9366e191a96aac"],["targets/breast/female-young-maxmuscle-minweight-maxcup-minfirmness.target",18993,"e5291365623120b763a0ed391c403245e58176d66c5fbf6e2265fcf976bb70c8"],["targets/breast/female-young-maxmuscle-minweight-mincup-averagefirmness.target",13282,"1b6085d02be8be5dfd696ec665f9be30aac3515940d050a86100bac92b4031b1"],["targets/breast/female-young-maxmuscle-minweight-mincup-maxfirmness.target",12960,"04a0d1c6c549dc660695e6a79c57423c046bdabd122a500d3213a82f885879c8"],["targets/breast/female-young-maxmuscle-minweight-mincup-minfirmness.target",13366,"fef224d937ac950c8e420486bff9f86ddb87d282ab31d19e384f524d069754fe"],["targets/breast/female-young-minmuscle-averageweight-averagecup-maxfirmness.target",6548,"9ff0ace7b46b0fa6125878370ceb6a1d8b851c3b14f240d69ab0dfb81c15f674"],["targets/breast/female-young-minmuscle-averageweight-averagecup-minfirmness.target",7240,"74162081c370b9034398cd9b5f083741f1f428035a6d12a4d578b05a4568548e"],["targets/breast/female-young-minmuscle-averageweight-maxcup-averagefirmness.target",15330,"a7d6f2b5d5137ad5a0db49536e5444b4731a168694457d49010bb644948e258b"],["targets/breast/female-young-minmuscle-averageweight-maxcup-maxfirmness.target",15421,"b8a003853aa186aed5309990812c079e0c4271af989fdc42c30cbb2b180eab30"],["targets/breast/female-young-minmuscle-averageweight-maxcup-minfirmness.target",18835,"5fb89ec9b435e47c3423d7fe03d2a111f507ead15fd94cc540c4f2de1f9b3d2b"],["targets/breast/female-young-minmuscle-averageweight-mincup-averagefirmness.target",12113,"05b12acef7b7a925a0fb3ab45bb807e340eaccbe8489c4d74a75ed0080715e1b"],["targets/breast/female-young-minmuscle-averageweight-mincup-maxfirmness.target",12113,"05b12acef7b7a925a0fb3ab45bb807e340eaccbe8489c4d74a75ed0080715e1b"],["targets/breast/female-young-minmuscle-averageweight-mincup-minfirmness.target",12113,"05b12acef7b7a925a0fb3ab45bb807e340eaccbe8489c4d74a75ed0080715e1b"],["targets/breast/female-young-minmuscle-maxweight-averagecup-maxfirmness.target",10639,"59ec723fd1e302b927539a8c316937943464bf44dc080fe351494b7e16474279"],["targets/breast/female-young-minmuscle-maxweight-averagecup-minfirmness.target",11523,"63ca4f85add90fd93c1d9828923cc99a2d6ca2226c3e677852c4f3a7746c3df0"],["targets/breast/female-young-minmuscle-maxweight-maxcup-averagefirmness.target",18131,"f539179d07844f9c1d8da2546c17f629280ab2d6193e3468efbc9513a230255d"],["targets/breast/female-young-minmuscle-maxweight-maxcup-maxfirmness.target",15643,"d16f4bc9030b2d11cd058ae61e8f453da23c9a45b73da6801beb6ac05fd6ec4b"],["targets/breast/female-young-minmuscle-maxweight-maxcup-minfirmness.target",22358,"3469a74ca86b2d51183c71bc003867be9e1bccb7d95d00725f713665f560dd35"],["targets/breast/female-young-minmuscle-maxweight-mincup-averagefirmness.target",12654,"ffae4061ee4052322ce72bb329da3c36e5fba6d83aed6418ef83f4217ef687da"],["targets/breast/female-young-minmuscle-maxweight-mincup-maxfirmness.target",12724,"8fa69893682557517da462aeff32981475f037b925bc3cfb56494f14f565e842"],["targets/breast/female-young-minmuscle-maxweight-mincup-minfirmness.target",12577,"14f53af3f31f0c0a7d19c0e0dcf7fdeb75f337da5a55acd40a09dcece1e579a8"],["targets/breast/female-young-minmuscle-minweight-averagecup-maxfirmness.target",4866,"cb35d792634d1cba1a532c7e172f44bd6db563ab45b42faa91fe794e8cb1e697"],["targets/breast/female-young-minmuscle-minweight-averagecup-minfirmness.target",8920,"c1c1ac06662211505f5d710149275ef76f431f98ada24fdf0706d367c1e0760c"],["targets/breast/female-young-minmuscle-minweight-maxcup-averagefirmness.target",15505,"1ea1ef84b46fa73ac64d411b4b1aee1189b31f52137844aa9da99f6206dd24a0"],["targets/breast/female-young-minmuscle-minweight-maxcup-maxfirmness.target",15450,"4548bc7e2721d950b90a36fd3df688537e7c8b849b39dc5ecc2437dbad20c070"],["targets/breast/female-young-minmuscle-minweight-maxcup-minfirmness.target",18817,"5be9bd2c0a6a4799038585dfea5b67b36f747cd564e8672ba79e401ffa520979"],["targets/breast/female-young-minmuscle-minweight-mincup-averagefirmness.target",12976,"8c42c8301090775b6e545706fce62460a9eeedd7cf2f7e4b193a359b668871be"],["targets/breast/female-young-minmuscle-minweight-mincup-maxfirmness.target",13069,"e4b0dd2758d4620cf2f26e1f7829541b9773846140879f5ecb233a175fbf2d94"],["targets/breast/female-young-minmuscle-minweight-mincup-minfirmness.target",13008,"8ae3416520b514a150ea1d297a968855b0b3aebf53e9bc6a16abe5a748bd671d"],["targets/breast/nipple-point-decr.target",1270,"0f4fe64476e45dfc77a302bf373dffc33dc6b5f1b256589e3f74e23ce1fba120"],["targets/breast/nipple-point-incr.target",1272,"2f9ac628bf9cf2b2e84bc2d93c81764f4d703405b49016bf6ae8b39901616781"],["targets/breast/nipple-size-decr.target",4003,"af1a11c39faaef789dc0c9e9a88f9dc2f703df460a07a0c17a7d849dbd268d5c"],["targets/breast/nipple-size-incr.target",1294,"4b23e80e1f7678951900c903b3d6a90fedad2f023c57e4d164dd47701c33a8a7"],["targets/buttocks/buttocks-volume-decr.target",7599,"cbead3b5ea8fb4726e77b2ef16d8c4fa3df54ed3787338bc9bc8271cd400dcc9"],["targets/buttocks/buttocks-volume-incr.target",22351,"1ba81c82932e21420ff20bc8f35489061f2f3d79d4b3130b61fe872602156b01"],["targets/cheek/l-cheek-bones-decr.target",2290,"0da776725aabc2cbc602d805e50d0dfbc98b0519a0d65f21b7e6f133562e56f9"],["targets/cheek/l-cheek-bones-incr.target",1519,"244ffa39d2d2db94ff15130719346b4cae2236bf2a309c5682eac352da06be50"],["targets/cheek/l-cheek-inner-decr.target",1480,"db665941e27c700ca6ccb514efcdf108d4100efcae6e68b0abf3f95333924dd1"],["targets/cheek/l-cheek-inner-incr.target",2373,"ab5aa2087e0e384f8ca7cc5abe9c03755ed1db1679a59651f8c65aa2788e622f"],["targets/cheek/l-cheek-trans-down.target",3599,"66210ebfcb05056429dcce2c34ee366be25e316ea5c26bf4813b87e6d3b9f974"],["targets/cheek/l-cheek-trans-up.target",2277,"a538a79637616b18f0ba6b0ec749d7b8548791fcb0f9352b37fa82ef4840df39"],["targets/cheek/l-cheek-volume-decr.target",3619,"527d19395f33c02caf3b32254e78702156cdf63c17e4c0e3dd79cca004fa27be"],["targets/cheek/l-cheek-volume-incr.target",4754,"edb0bf9389aa7fd00f9d735603729b687b3899e9a6df0934ca14aa4d44574e27"],["targets/cheek/r-cheek-bones-decr.target",2123,"a336b46fe613d85763fb01ca79758039b15daef1930600e36dc420e799b683d4"],["targets/cheek/r-cheek-bones-incr.target",1514,"a393f67acce21568ab832091daadab267685d464492647cb0c4e8cb5af58c4c9"],["targets/cheek/r-cheek-inner-decr.target",1275,"931435368577ebb410f2179e7e1ed121f741e6ad18fd7eb92ec96c679db1608f"],["targets/cheek/r-cheek-inner-incr.target",2974,"83fd5033cca2fcedc470050d87ac75c037ffc2403bb7ea85ae31eb81de62f0c5"],["targets/cheek/r-cheek-trans-down.target",3382,"27921a4e0920e419f6848a4f08b29a29adc76ce3bae76a44fa5dc5fd1302cddc"],["targets/cheek/r-cheek-trans-up.target",2122,"c776254ff7fc00dc8cae1fb957605291042cbe1b30c519c2079a75a1ca409231"],["targets/cheek/r-cheek-volume-decr.target",3274,"3a356f2f6434ccefa633981dff1b7866ce1feb8427918f35f81b6adffa4599b5"],["targets/cheek/r-cheek-volume-incr.target",4690,"dfdde51eb34b3e2c70a4c0c9fe876339dd80ee6ec0fbb3f798e630af556f9695"],["targets/chin/chin-bones-decr.target",3902,"fc54c1572b2562b095e5a5e48882bab16c1b24e64b106b2d54e6be64ce20121c"],["targets/chin/chin-bones-incr.target",11831,"245b7a9506a10d5828531922ab2ec6da0e813f71bd995dae48c9a4dfad171a49"],["targets/chin/chin-cleft-decr.target",1001,"1ef80a998633e3905b098c546198ffdc14dd4d8171b93bd337b2e058dcffce1a"],["targets/chin/chin-cleft-incr.target",1323,"93f523e952d436094321a5ec8ea38bafcdbe272ada894d3dfa12de7bd4c717d5"],["targets/chin/chin-height-decr.target",4603,"acf83b5b7f2d6665f19d0d91205472878c23ab78b3f43d48420f75afe8e82818"],["targets/chin/chin-height-incr.target",9131,"8b13d4a1e0f4b105cb51a346cd8a3618c9349e620d0197cc442905e83de8ae53"],["targets/chin/chin-jaw-drop-decr.target",1561,"0174f6e636e7d5b136b09f5e1ebc6b6d68045adceef3e84fb813965e14660299"],["targets/chin/chin-jaw-drop-incr.target",1415,"e145bddcf7007a8e4fc56f48202d445e6cf0b3a8f4705b082553f6ead314bbb9"],["targets/chin/chin-prognathism-decr.target",7788,"4dd20d7912e9baf38d5b92e4e3a9f03a7bc0b59578db9d9a80288729ded88885"],["targets/chin/chin-prognathism-incr.target",5360,"81d086ad10c3e210d9a6ddb69ca0aaf2b3f91c2bcd5c7b49173f1303d017bf66"],["targets/chin/chin-prominent-decr.target",3522,"071afc623e6feb38afa5dde7abca83710c062bf1281e30a51fa42a6fbacfc00e"],["targets/chin/chin-prominent-incr.target",2338,"d2493ca5f69aabeb8557d77a56c49cfcf2062ff90c0cad03073d87990d11448b"],["targets/chin/chin-triangle.target",7024,"bd4f02068b8ea3a35cbbdd38554246d686e3f0fbb3ba395f5432dbac76ed3df5"],["targets/chin/chin-width-decr.target",2853,"ac081bd1652c203fc8973f20988a868a423a49f1fe6449cb974727fd46c26af1"],["targets/chin/chin-width-incr.target",3706,"deef506bfe1883d9d4c38667332c9970785226566efbae4724fd3d60c02efcf4"],["targets/ears/l-ear-flap-decr.target",5494,"f45356aa2b841811641d12c45f7d89bc1e778cb2f0abd04010100e1826e862e5"],["targets/ears/l-ear-flap-incr.target",5850,"65f3cde97c13b7cdc88114c701a1cfe4a0e7f9b44c36134fd9cddad9fa266513"],["targets/ears/l-ear-lobe-decr.target",1254,"2d4d34aae12fc052b62f2e5aa1d49b0dde62f83d01389419216a89612bce3b9e"],["targets/ears/l-ear-lobe-incr.target",1064,"e4bd014dbcf89fc32c095e7827ad72415e78a985e7a26757a95d78c0e8336298"],["targets/ears/l-ear-rot-backward.target",8440,"6009f9c29551bef24bccba597650759e14bbfcad9f3de413d7525f452a8088b7"],["targets/ears/l-ear-rot-forward.target",8689,"2ba108f5d4a11296b18a12adf28c0a461f7d484a34fb699fb7d2aa38c6dc4bbb"],["targets/ears/l-ear-scale-decr.target",11395,"dbe6da6a32a278887bd851c1ce8a3cc8be36e2c833d033afc043a865f171583c"],["targets/ears/l-ear-scale-depth-decr.target",6750,"838561daa96d138c8dd39cfa2b653ca4fa4c0b254ddf0859a34dd68b7c0ee11c"],["targets/ears/l-ear-scale-depth-incr.target",6732,"c452990c28b6ebba8e255264242da414050de9b18f57ba533ae594392391b8e7"],["targets/ears/l-ear-scale-incr.target",11526,"8112e638fb6ecc46569c527494f5b20acd0c5544d891dbf09c7876402eac384c"],["targets/ears/l-ear-scale-vert-decr.target",6771,"674e7c3c877bbdb4b88af3b51ada33907485383ee1fa2ce0adbc402cf0647580"],["targets/ears/l-ear-scale-vert-incr.target",6761,"8938d2885af1de71e4ba43911c8410e08c4c4488b40ec1950f1c0b2fca213fa0"],["targets/ears/l-ear-shape-pointed.target",2860,"fb69b849f07de8297473f070f1fbddbc0c821f96770634ecb2af54691ac54414"],["targets/ears/l-ear-shape-round.target",7729,"813cb1832d81a454a406a072ffec1ed5db721b373d74cd05ea70d469ff1eef20"],["targets/ears/l-ear-shape-square.target",4104,"9d45081356a88792dd09a08f6df9f008d0e5c67add8d029f86ff883ccc1cceb7"],["targets/ears/l-ear-shape-triangle.target",5615,"2a7b8547c4e2e141e8338e8e386fdd1970bfbde03b02e9bc0a8687e4e7434ca2"],["targets/ears/l-ear-trans-backward.target",7839,"02e302490707dce8ff8248f8cd5e7600978ae0f0c1a1decb3e55ff970b79da85"],["targets/ears/l-ear-trans-down.target",7611,"dd790628ee1b25abd39bec929f083f7a86d87792a43b5b7a11860243abd712e3"],["targets/ears/l-ear-trans-forward.target",8167,"e3bab170b063a39bf69e5a94d5bd54aeced0cf9a9222e223ae067161e3667a3b"],["targets/ears/l-ear-trans-up.target",7126,"08acb404abca9c4ed4104baac9a55accd378a4a7268df07ab62f7b4f8f5865da"],["targets/ears/l-ear-wing-decr.target",7567,"1075c326f7e841e7f1681300f6b1e864d90f40ee94fb2ff7dc612a8b8f1d27c7"],["targets/ears/l-ear-wing-incr.target",6488,"0db8c028668131078eaa2d8e38b3062389626ffda0be4273f8e7c5ae68ef7b70"],["targets/ears/r-ear-flap-decr.target",5021,"38552ada19aa4d0b3b23075db35ffdf621f4eb82a2f5929a0b6e48bfa0d0d60f"],["targets/ears/r-ear-flap-incr.target",5735,"0fc3a78e95c0a8125923fe68873f2ecf3a9a3a80fb14bad11dc0e78bd05944df"],["targets/ears/r-ear-lobe-decr.target",1215,"42191c7331a17a2b5cb1d614bf43893f70fcb9a20ae5e09c0c656f4f8bd2f56d"],["targets/ears/r-ear-lobe-incr.target",1038,"884b026675b3a4f387348f3c74ff7d5cc4d325a697be3bd25cf2bb2d8c2ed58f"],["targets/ears/r-ear-rot-backward.target",8026,"fc43aa242102a08c0079635ec3c090225a43763775d9ec87eddaf272ab80b502"],["targets/ears/r-ear-rot-forward.target",8255,"6fb7314b74ddd652255942c0f848e317d1503bfaddae980605ff0d0cf7e28bf6"],["targets/ears/r-ear-scale-decr.target",11095,"aae4f2455ace56046d1e58fff9a83fea220cd722e24727af352fbaf376a2bb35"],["targets/ears/r-ear-scale-depth-decr.target",6356,"8cfb642f7800351e52f175a170df2dbe263f9490630f475c012e6abb4aa718a6"],["targets/ears/r-ear-scale-depth-incr.target",6339,"f795f5f5693dccbe1ab07f06863cda5c7b7d629bab4c0f95c187e0fd64156ba2"],["targets/ears/r-ear-scale-incr.target",10827,"4fa34a2a4d7254fdb5ac514b85b755b8ed0d73ed21450778b2dcb64275a3619d"],["targets/ears/r-ear-scale-vert-decr.target",6373,"21f9d96508eb0048b16bbec070cc7c2532d3b1109d4341de3358f6a9eac30c72"],["targets/ears/r-ear-scale-vert-incr.target",6363,"3b7ca63a6a16ffc2f044476ceaf352e8d5b1bbd09e6181292a06335293a486c5"],["targets/ears/r-ear-shape-pointed.target",2733,"32598e38492c6b1d34d0e700a61d9710b73d7be4070b4c5597125f53d0fab5e3"],["targets/ears/r-ear-shape-round.target",7348,"eda8ed17cb3c732d3482081ac91723e6bf80d0e1deb654346aa1a13b09ba839c"],["targets/ears/r-ear-shape-square.target",3906,"bcad063a48f041f5a82bc73638ece0a73bd7e0c3f2b0ffb90cbeec892ab3d776"],["targets/ears/r-ear-shape-triangle.target",5345,"250ed8117fe652e12d7cdfcf10f677dc9bbde02f1477a0b763e8ae5ce4055e19"],["targets/ears/r-ear-trans-backward.target",7347,"ae0d12984160beea75cde7e507b3e33223fcf3f53236e2fbcde327798b0a6d9f"],["targets/ears/r-ear-trans-down.target",7134,"2b646a8b7d6738b0f84088562f985c9b8a760d707074c834018ee4582e1b50bc"],["targets/ears/r-ear-trans-forward.target",7664,"e8faae90649156def817b39e854ce9e96a379671992924720de446ac4cc5ec65"],["targets/ears/r-ear-trans-up.target",6649,"9331eaeed4689d1504aa62a07435658060f3920dd24e79a55b66da416db1beab"],["targets/ears/r-ear-wing-decr.target",6898,"796e5cb0448084d4bf03a1584ffed3edfe82241391ba1a63b5855775454171af"],["targets/ears/r-ear-wing-incr.target",6481,"392f18098b531cbf62c15ea68e647b918a9d88f730ac34c2a260bbe1a282ba4d"],["targets/expression/units/african/eye-left-closure.target",3859,"5a9fc811ddff5f5657f7c9566ca07dfe31f68865d001804324fca5ecffd3992f"],["targets/expression/units/african/eye-left-opened-up.target",3967,"c379cbc9106315180fc5646ff8fd063268f47d2f564598606559d82a589c1310"],["targets/expression/units/african/eye-left-slit.target",5136,"f2724e8d865211ded6022ba886ece6a47ca9bbb4d279f302f93329d3fa624d10"],["targets/expression/units/african/eye-right-closure.target",3686,"3bb393418e84b1c3ebc9af075dbeff54f9161cafd9bb7e04caa40d155d4619ff"],["targets/expression/units/african/eye-right-opened-up.target",3801,"1e342b3b0731d5cdbd5e223817303c0364782f0de52887cc3e414fdb451c184f"],["targets/expression/units/african/eye-right-slit.target",5118,"713283452d24f0b68d9026e26fb3b3ee2e479dd33b31021926f94bf4e593d368"],["targets/expression/units/african/eyebrows-left-down.target",1629,"89999e77f486dda420fde6d67ca7e32e885d80e816111e776ff292efe41b209d"],["targets/expression/units/african/eyebrows-left-extern-up.target",2029,"67da4764aa45679e09b11555a59c980c9bcd3c27566b73679c9484963e7375cf"],["targets/expression/units/african/eyebrows-left-inner-up.target",1321,"2fa94d522d54bb33078c72ac111da75005b5b2bf495d647c6e9fd5b41245b287"],["targets/expression/units/african/eyebrows-left-up.target",1381,"4f770b7281ed9502c2e164850e41265310a445d0534bbc9a8faa949c05677775"],["targets/expression/units/african/eyebrows-right-down.target",1579,"86f0d1440944fa4754d24c128f7d105f6a93dbd6ce9204be972bcb2ad5be4cec"],["targets/expression/units/african/eyebrows-right-extern-up.target",1990,"d3ffbcf0646b98710035703af24e8b5c1814654f1fd0b56b6b9bb689c88d32dc"],["targets/expression/units/african/eyebrows-right-inner-up.target",1256,"c97c24303a308d042f353e00038f35bc15b0d253cbdc9213dbe50fb01809893c"],["targets/expression/units/african/eyebrows-right-up.target",1486,"496a446cb77aad463dfd952a8a648e758ee0954c64a96a4e4412f9a042391881"],["targets/expression/units/african/mouth-compression.target",12995,"12b8dc506faa0cde0c30a07b89c725dc728d4770900a7dd6956dceb91566c7ef"],["targets/expression/units/african/mouth-corner-puller.target",14083,"9cec6411ee6e4c1307030d41781c26e3808e3b6f4538d7e4d595c1dfff89bfe6"],["targets/expression/units/african/mouth-depression-retraction.target",10441,"245d1e9f24798a41db188b3337e25108519193d73592d9bef75bf63f61ac61c6"],["targets/expression/units/african/mouth-depression.target",11714,"4d788ffdf4b77f6929212f61972fd36e14d066eb2d9802a7004989a83a3fced8"],["targets/expression/units/african/mouth-elevation.target",11080,"66c592bd5e5d4e87aa4107b18d0e696f634cba990f0a76d91493f941c3850728"],["targets/expression/units/african/mouth-eversion.target",7115,"4f14c4c9549db3ff077396e682c787125dd6137763ec2ad3400a4060cd8eec36"],["targets/expression/units/african/mouth-open.target",26993,"c3e586735bdc8dc17c3690c7a3e18b3c90466071214c4c514624d1f75d3ba344"],["targets/expression/units/african/mouth-parling.target",3915,"e99006847f7de6481284022f8d342cf1e6cdb7b9dc5ae8ee64fdbfae5377ddc2"],["targets/expression/units/african/mouth-part-later.target",18050,"6562d0f80bc99c652d7500645b0e36f89f8a3cd7f1b537ae767ed9097fd9ec90"],["targets/expression/units/african/mouth-protusion.target",13755,"48ed31bbdcfd754f6e00732c2c3eaa305fbfed56ec7c64b0468ba0fb5514f829"],["targets/expression/units/african/mouth-pursing.target",15125,"72c3cb4eef3b2674e2265f77aca813ee7ed0219674b2ca4ce3661f5ad180fba2"],["targets/expression/units/african/mouth-retraction.target",12832,"94f396d7de8c05d64115879205716c97a433801ced8834d64ff551981b2b0dff"],["targets/expression/units/african/mouth-upward-retraction.target",15296,"61896d40f7ab7d0d87e83e2db360a54f32a524d8be8d361cda12a4a0326fd348"],["targets/expression/units/african/neck-platysma.target",16169,"6cd1ae10989ea9516cce983c66a7a833d29b08e2c91870329eea7ce234547fd4"],["targets/expression/units/african/nose-compression.target",1491,"b676ac07df061d30b770889675b08368082bb9b4b97e22057b854b4c49618df2"],["targets/expression/units/african/nose-depression.target",4548,"d2ca3623ef9c1334db40d3ce5d542704935f187f275f91c310fcc274e353cde0"],["targets/expression/units/african/nose-left-dilatation.target",1833,"5bbf49fc18120ebf4c3d0d84f9467725d40489039afd46655a48e7a303862cd8"],["targets/expression/units/african/nose-left-elevation.target",3385,"ae5876145bca40d7dfbf6a0e27531056760e55673da548df9d77fc4b573bd998"],["targets/expression/units/african/nose-right-dilatation.target",1833,"8c914825894dbee7296fa46f63f708486c53a7c8d43682979e856e4c815e1b04"],["targets/expression/units/african/nose-right-elevation.target",3349,"d25a962d3202602cffe0703cf8ab50900c721c9ac769da331706d49571901298"],["targets/expression/units/asian/eye-left-closure.target",3926,"96d43015f95af63d1d5d64c2d234ac29571d7b05a21e900cf5ee15a246337ebf"],["targets/expression/units/asian/eye-left-opened-up.target",3967,"c379cbc9106315180fc5646ff8fd063268f47d2f564598606559d82a589c1310"],["targets/expression/units/asian/eye-left-slit.target",5263,"95fdd2d24f2a1b2a2d3c9fdaed6e64f5653bc829301b17749739771ca48edfc8"],["targets/expression/units/asian/eye-right-closure.target",3756,"772a8a1c62dac36fa2ed6b0808d167bda298ec1ece956af0561e7324a0c91a6b"],["targets/expression/units/asian/eye-right-opened-up.target",3801,"1e342b3b0731d5cdbd5e223817303c0364782f0de52887cc3e414fdb451c184f"],["targets/expression/units/asian/eye-right-slit.target",2939,"2fbcf811893a44cff66ef7139441d48ac0cfc5896c62e562083862be49c8bfc7"],["targets/expression/units/asian/eyebrows-left-down.target",1629,"89999e77f486dda420fde6d67ca7e32e885d80e816111e776ff292efe41b209d"],["targets/expression/units/asian/eyebrows-left-extern-up.target",1977,"ea63558d1e7fce6004cc4f7cd912d7058791134a00b113fb9f2a757a0bb96b2f"],["targets/expression/units/asian/eyebrows-left-inner-up.target",1321,"2fa94d522d54bb33078c72ac111da75005b5b2bf495d647c6e9fd5b41245b287"],["targets/expression/units/asian/eyebrows-left-up.target",1381,"4f770b7281ed9502c2e164850e41265310a445d0534bbc9a8faa949c05677775"],["targets/expression/units/asian/eyebrows-right-down.target",1579,"86f0d1440944fa4754d24c128f7d105f6a93dbd6ce9204be972bcb2ad5be4cec"],["targets/expression/units/asian/eyebrows-right-extern-up.target",2194,"80675b2f74ba16b8d86ab1cf95a5660cf5b02e603bdd6396d85a7d18a84ee3fa"],["targets/expression/units/asian/eyebrows-right-inner-up.target",1256,"c97c24303a308d042f353e00038f35bc15b0d253cbdc9213dbe50fb01809893c"],["targets/expression/units/asian/eyebrows-right-up.target",1486,"496a446cb77aad463dfd952a8a648e758ee0954c64a96a4e4412f9a042391881"],["targets/expression/units/asian/mouth-compression.target",13039,"b7abd0826708d7e4344559583edd0fc80e098b08b91f3e6d67d83b1eed20ccbe"],["targets/expression/units/asian/mouth-corner-puller.target",15163,"75ec1f2356c381aa44065f2b812daafae85c5a918843b978d04cf6d8bc79dbe4"],["targets/expression/units/asian/mouth-depression-retraction.target",10615,"50f27341383bb1237a45d2bd7859912bd934227edd22eb86f2a9a4b6427c6bc3"],["targets/expression/units/asian/mouth-depression.target",12263,"906a614c24a63a126abeb28b2adbc84efb5f08b49d76fe8ce79fbd0ca9732f9f"],["targets/expression/units/asian/mouth-elevation.target",11716,"4af81349fa582b9330acd93c96261899765d9b324d191575faeb000407d76837"],["targets/expression/units/asian/mouth-eversion.target",8071,"80ab01c962f5ed9d70492e2fe5802bd5106867c21969bb71ddb19e66c5d6ae9b"],["targets/expression/units/asian/mouth-open.target",26859,"2222072e34027f7bc05e53548878832b041cb9b749062e369468d6946e68a32b"],["targets/expression/units/asian/mouth-parling.target",4095,"2da1d3143b3fcf4193629fc5c26b015b8c505cc3258dc41ecd3e20d598b65ccb"],["targets/expression/units/asian/mouth-part-later.target",18823,"e376a90552d7112a536a7e0804909747393c9fe0df8d2d24aaeeab02e626abc9"],["targets/expression/units/asian/mouth-protusion.target",13672,"536bd142a0985bf5cea6709561495756fd368a5582adcefc90c99348b1e47378"],["targets/expression/units/asian/mouth-pursing.target",17135,"d984a24e4c692d66d11d971d8cdc6483369688e498abd44a13d129f7bd248046"],["targets/expression/units/asian/mouth-retraction.target",13698,"245fe1fa08e91091a2f236b88f4117e78157a4c17cff0a125e819e2a237e0048"],["targets/expression/units/asian/mouth-upward-retraction.target",15436,"aaaed4ee0c13401352b4b6dc8d0bccb61bfda0996ed2718a456a0c32e5f32d0a"],["targets/expression/units/asian/neck-platysma.target",17628,"3f0fba349a5724eef7a9c9473acdbb43a9e8e77b4864e69d743f0b3676e44769"],["targets/expression/units/asian/nose-compression.target",1491,"b676ac07df061d30b770889675b08368082bb9b4b97e22057b854b4c49618df2"],["targets/expression/units/asian/nose-depression.target",4618,"545f4e4e9f59637f3a80c3d1a0367f7b08a3317fd487c096b0531bac096e1bca"],["targets/expression/units/asian/nose-left-dilatation.target",1841,"a4964a35efe3c7b8a7209702d5533147f93c3b7f093c459c2e460da4991da6c9"],["targets/expression/units/asian/nose-left-elevation.target",3681,"5a63b622bfb21bd0cf530f64a66eb8ebfe01e81e1edbfc706161ca8472b3656e"],["targets/expression/units/asian/nose-right-dilatation.target",1839,"e7b0721836584890f4a4bc9df4c028ef87e72868f336154f66cae6ac42e89734"],["targets/expression/units/asian/nose-right-elevation.target",3639,"4ebad1433573bc5b9577dc5808537752e93c68e59f4422472b2e753b53a260f0"],["targets/expression/units/caucasian/eye-left-closure.target",3946,"e38cb77fd888de3d0d944efe6f3511bf3ca4076b0397fa7c840d8368f08205c2"],["targets/expression/units/caucasian/eye-left-opened-up.target",3967,"c379cbc9106315180fc5646ff8fd063268f47d2f564598606559d82a589c1310"],["targets/expression/units/caucasian/eye-left-slit.target",5136,"f2724e8d865211ded6022ba886ece6a47ca9bbb4d279f302f93329d3fa624d10"],["targets/expression/units/caucasian/eye-right-closure.target",3776,"58faf2c199272bfd87478ea122cdaa4b4b8669505be0d75f777c5471527b2b15"],["targets/expression/units/caucasian/eye-right-opened-up.target",3801,"1e342b3b0731d5cdbd5e223817303c0364782f0de52887cc3e414fdb451c184f"],["targets/expression/units/caucasian/eye-right-slit.target",5118,"713283452d24f0b68d9026e26fb3b3ee2e479dd33b31021926f94bf4e593d368"],["targets/expression/units/caucasian/eyebrows-left-down.target",1629,"89999e77f486dda420fde6d67ca7e32e885d80e816111e776ff292efe41b209d"],["targets/expression/units/caucasian/eyebrows-left-extern-up.target",1977,"ea63558d1e7fce6004cc4f7cd912d7058791134a00b113fb9f2a757a0bb96b2f"],["targets/expression/units/caucasian/eyebrows-left-inner-up.target",1321,"2fa94d522d54bb33078c72ac111da75005b5b2bf495d647c6e9fd5b41245b287"],["targets/expression/units/caucasian/eyebrows-left-up.target",1381,"4f770b7281ed9502c2e164850e41265310a445d0534bbc9a8faa949c05677775"],["targets/expression/units/caucasian/eyebrows-right-down.target",1579,"86f0d1440944fa4754d24c128f7d105f6a93dbd6ce9204be972bcb2ad5be4cec"],["targets/expression/units/caucasian/eyebrows-right-extern-up.target",2194,"80675b2f74ba16b8d86ab1cf95a5660cf5b02e603bdd6396d85a7d18a84ee3fa"],["targets/expression/units/caucasian/eyebrows-right-inner-up.target",1256,"c97c24303a308d042f353e00038f35bc15b0d253cbdc9213dbe50fb01809893c"],["targets/expression/units/caucasian/eyebrows-right-up.target",1486,"496a446cb77aad463dfd952a8a648e758ee0954c64a96a4e4412f9a042391881"],["targets/expression/units/caucasian/mouth-compression.target",13039,"b7abd0826708d7e4344559583edd0fc80e098b08b91f3e6d67d83b1eed20ccbe"],["targets/expression/units/caucasian/mouth-corner-puller.target",15163,"75ec1f2356c381aa44065f2b812daafae85c5a918843b978d04cf6d8bc79dbe4"],["targets/expression/units/caucasian/mouth-depression-retraction.target",10224,"0ebefb40c4374e628c9595a74f5222bff6323474c87d2d93d1249593806bdc23"],["targets/expression/units/caucasian/mouth-depression.target",12263,"906a614c24a63a126abeb28b2adbc84efb5f08b49d76fe8ce79fbd0ca9732f9f"],["targets/expression/units/caucasian/mouth-elevation.target",11104,"0b306cea4b0bb372d408b69a55332b8ddb252b3f2d4bfdd6b9d5c34da0f90e32"],["targets/expression/units/caucasian/mouth-eversion.target",8071,"80ab01c962f5ed9d70492e2fe5802bd5106867c21969bb71ddb19e66c5d6ae9b"],["targets/expression/units/caucasian/mouth-open.target",26815,"07377ba3a3eb1b92b00029908f896ea1f8cc50356789f54268d897f2e89c2843"],["targets/expression/units/caucasian/mouth-parling.target",4095,"2da1d3143b3fcf4193629fc5c26b015b8c505cc3258dc41ecd3e20d598b65ccb"],["targets/expression/units/caucasian/mouth-part-later.target",17879,"5128d051612b61a4cf15b664c3c5439e10718b98cc3411be5cad363cae5b4b02"],["targets/expression/units/caucasian/mouth-protusion.target",14207,"012c571c381c3dee06591132110d7d64fb2abd49d883afc619f6bc6c0000d2f4"],["targets/expression/units/caucasian/mouth-pursing.target",16023,"02b08ad99c2345e83cbd4c77819fadef2af8c7fc3111211fc169459eb7f37d10"],["targets/expression/units/caucasian/mouth-retraction.target",13698,"245fe1fa08e91091a2f236b88f4117e78157a4c17cff0a125e819e2a237e0048"],["targets/expression/units/caucasian/mouth-upward-retraction.target",15436,"aaaed4ee0c13401352b4b6dc8d0bccb61bfda0996ed2718a456a0c32e5f32d0a"],["targets/expression/units/caucasian/neck-platysma.target",17628,"3f0fba349a5724eef7a9c9473acdbb43a9e8e77b4864e69d743f0b3676e44769"],["targets/expression/units/caucasian/nose-compression.target",1491,"b676ac07df061d30b770889675b08368082bb9b4b97e22057b854b4c49618df2"],["targets/expression/units/caucasian/nose-depression.target",4618,"545f4e4e9f59637f3a80c3d1a0367f7b08a3317fd487c096b0531bac096e1bca"],["targets/expression/units/caucasian/nose-left-dilatation.target",1841,"a4964a35efe3c7b8a7209702d5533147f93c3b7f093c459c2e460da4991da6c9"],["targets/expression/units/caucasian/nose-left-elevation.target",3681,"5a63b622bfb21bd0cf530f64a66eb8ebfe01e81e1edbfc706161ca8472b3656e"],["targets/expression/units/caucasian/nose-right-dilatation.target",1839,"e7b0721836584890f4a4bc9df4c028ef87e72868f336154f66cae6ac42e89734"],["targets/expression/units/caucasian/nose-right-elevation.target",3639,"4ebad1433573bc5b9577dc5808537752e93c68e59f4422472b2e753b53a260f0"],["targets/eyebrows/eyebrows-angle-down.target",8604,"ec30979a4b998f4054f0d72c8e7e3b204ca12417f07e02669f4f8c8566f8e4f6"],["targets/eyebrows/eyebrows-angle-up.target",5809,"a4b1ff8c5cd7df8d08bba55ccc5de773c120719c7f6c4791e78ade3651f1c2aa"],["targets/eyebrows/eyebrows-trans-backward.target",3863,"0ad186047e809629f169c72502b12d95ad64597294ba6553aaafe9b880e19f11"],["targets/eyebrows/eyebrows-trans-down.target",6641,"38f7de378d535d51f2e50dc2568121a8769445f9a62423bd0a5e688c47ea3225"],["targets/eyebrows/eyebrows-trans-forward.target",6053,"b02d5416bf663e3b77d3ccb44348f735a3a046f5c7df7dd4160b88485a02e7bd"],["targets/eyebrows/eyebrows-trans-up.target",7877,"b685788eecc7629bda0b68a414b2277afbd8636fd7605b3acbd0dabc5d46abda"],["targets/eyes/l-eye-bag-decr.target",1721,"68a0cd34a6849c6614cbdd2fbb8aa6065ab3fbe7c01078277510e206fb8a6259"],["targets/eyes/l-eye-bag-height-decr.target",2726,"bd902077c3e487c45860b99e3f9da891f4f621b8f6865007b99061cfcf3fd992"],["targets/eyes/l-eye-bag-height-incr.target",2762,"8d22f0818abcd616b63b9976ad6f543c2887bedde62716e4d9e67828b9ec6d1e"],["targets/eyes/l-eye-bag-in.target",1128,"9df218d8f4ee1b6f3a14f52be267b522cab2c52669b3d18ee71bb46699534f98"],["targets/eyes/l-eye-bag-incr.target",1584,"fd3fc50d640d510ffee64862bac239d81495e6f57eae1a5772375f4973ca04cb"],["targets/eyes/l-eye-bag-out.target",1934,"7b6d394a09c02e4557638196f7b9e50b53f854fa12e5146cd02e34bd703c3465"],["targets/eyes/l-eye-corner1-down.target",4141,"7f4faca93cab0e8ed4d09b899e5450a176eb9c49604bef4944f4c11f46deaf26"],["targets/eyes/l-eye-corner1-up.target",3934,"bfb3b7440addb68bbbb825b8de709db58900bf9ea7b3a93e60ab36c774f4cb55"],["targets/eyes/l-eye-corner2-down.target",4100,"16944395e9723983dd2d381a0c92d8a6fc4efafbfa2b027cd3dc50f9451f9fc3"],["targets/eyes/l-eye-corner2-up.target",3884,"e31bbedfb1d451459a6ebf510a055e4af94eb8f146079fe9a5e7722b0e4aa661"],["targets/eyes/l-eye-epicanthus-in.target",1919,"2f4be6e52cae5e48453d5b3d596972f305fbda07fccd652ba7c1459376231abf"],["targets/eyes/l-eye-epicanthus-out.target",2125,"5abba734c59087c7cea91e3a25d12a73b668b77523ac5353f4feeac6f820e650"],["targets/eyes/l-eye-eyefold-angle-down.target",1332,"991e20320924d8d5f9f810734a373b04545cef2859d190e759861a9dccfb6c8f"],["targets/eyes/l-eye-eyefold-angle-up.target",1355,"051dd9590fdab0531b739acbe2e89bca372367df956cd019ee1ffb7b22eb159e"],["targets/eyes/l-eye-eyefold-concave.target",822,"98279454a6951d47a9faf7fe1118de5028d018023b337e537473fe7b48c1f5a6"],["targets/eyes/l-eye-eyefold-convex.target",1108,"2acf824b3b00c728b44eeb94df93538732e159e529e81ef61135c9f19d677bd6"],["targets/eyes/l-eye-eyefold-down.target",1733,"4cbc747fc0be444ccf1546387203370fb9d6a7fffb77ffd84a0ccb75449d7c46"],["targets/eyes/l-eye-eyefold-up.target",1060,"489f12ab9ea1b528c0707dc656c863002a21bff2017880ed78407819ce6a12f3"],["targets/eyes/l-eye-height1-decr.target",3153,"d1d9f77ff6efc9ccdfcc88beafc8a3be8170b3ea386b7a44b414df1f41e84daf"],["targets/eyes/l-eye-height1-incr.target",4053,"75ce5285db2e3721ae5434c8a9d27669eb632da7e588000a112d34264216de20"],["targets/eyes/l-eye-height2-decr.target",8855,"11f97a658461ab341b75165acc280dd5541a0ebf57d84dab24819a3af8ee5d25"],["targets/eyes/l-eye-height2-incr.target",6758,"8521b63c1bf07af06194e96e14eb522dce43615ef1139b8117f104f5132fbc69"],["targets/eyes/l-eye-height3-decr.target",5480,"1e52f3d392fc6493f3544bbb0d9bec1038e3476316d8e425e9e15478e888b7f9"],["targets/eyes/l-eye-height3-incr.target",8511,"61fd32eedef0b3718e529c544b54bd0979d3d92496d881468942d11e7292f458"],["targets/eyes/l-eye-push1-in.target",7006,"8dc07616d8435a382b58fc2d29a5e9a1d6cd4e575cf937d49c57614e8c70f772"],["targets/eyes/l-eye-push1-out.target",7289,"0f0ba53b142015d94ecc1639ff1ac74b7d0d42eb88bedf6a51835300401c3fe3"],["targets/eyes/l-eye-push2-in.target",4878,"f3a2b300de549ea51c6cd73128c54a1c14b13cb48516db3b4513b6599187c1f5"],["targets/eyes/l-eye-push2-out.target",4858,"4adab9a0cb70545fa39ea339a0eb81a9b58524593c3624cc948e5f05369ee5c6"],["targets/eyes/l-eye-scale-decr.target",12544,"a66719f1a42badd955fb0c725ac453969d7fda05cc6e4f4770d388b076703dc7"],["targets/eyes/l-eye-scale-incr.target",13397,"f35550dc3170ca1c0aacae0b598ca139e4f1f913f2ccea146ec6ea5b4e050dbb"],["targets/eyes/l-eye-trans-down.target",11654,"3ebdb3fc54e25cad690b74674db88712f314039660e5b06102763b8edfdb1156"],["targets/eyes/l-eye-trans-in.target",11686,"a92495e3f6cda144b3c37cc07734ee2735934d263e8c20e4b5763b21650ce26b"],["targets/eyes/l-eye-trans-out.target",12444,"ca961a4637517aeb689fa351e9d36abb3c04108a2870b26220f3c8cda027bdee"],["targets/eyes/l-eye-trans-up.target",11077,"2b84f1cdb80c962505809d8be92524221aeb34fdf0a5b51926fdf2f4e37846d3"],["targets/eyes/r-eye-bag-decr.target",1637,"0834b70b669c5287822b4e8bcc626b7d997b944751f95665a6a510a020c415a1"],["targets/eyes/r-eye-bag-height-decr.target",2546,"445db05ea422cd662883dcb078cf719f2ca2cdc98173a2e50a8c4067046bf093"],["targets/eyes/r-eye-bag-height-incr.target",2419,"64bdd6da72b67698dd670dfbcb22e1cb469ec4f30571e160887b07f8feb664dc"],["targets/eyes/r-eye-bag-in.target",1073,"adb10de796d2e238771fbef4f2fef2af8c0ea013656c24d7394195b3186a62da"],["targets/eyes/r-eye-bag-incr.target",1274,"60bdf910850f5cc89bccb2950b5f1a63fa5960e79ec42746cf5f486719e3662f"],["targets/eyes/r-eye-bag-out.target",1909,"46673ac8e5339b58285cb449feaccb10b8333d2294c286144717c32ccff6155f"],["targets/eyes/r-eye-corner1-down.target",3558,"a95e120f64af8a7af4551899b0fadc5da91d015d9fd259e4c4bd1183d5445001"],["targets/eyes/r-eye-corner1-up.target",3444,"f1bedac16f1b9e493fc06fa0ebc3edf73836bde385d3ab03ae8bb91dbbeec56f"],["targets/eyes/r-eye-corner2-down.target",3724,"cf227aed9a80fd4250f699aa37e5e0e4b726f2726d6a8f51ed90f706c8b27e30"],["targets/eyes/r-eye-corner2-up.target",3523,"121342afb92d0916ca1fba59df1c45a61dcf08713fd81f6ff67871cfc6a4f14c"],["targets/eyes/r-eye-epicanthus-in.target",1793,"bc96fd55c5686ddceee24d3a5b6f7a8c9c3edbb66b198070ae2d6c3f5bdbebda"],["targets/eyes/r-eye-epicanthus-out.target",2046,"e39dfb6dc6adfdeb280e27b4a79cfb2c440d414de15d4c8153db8da1e1b86744"],["targets/eyes/r-eye-eyefold-angle-down.target",1273,"9c8fd1c562b22bb11c93e3e9edbd23ce9bb849d2f05fa749c24147e6c541dec1"],["targets/eyes/r-eye-eyefold-angle-up.target",1255,"ff12695b6ef726c47f7689eb3087ee2c7e451c0a51860a9b9bc4a0c1b653f485"],["targets/eyes/r-eye-eyefold-concave.target",794,"adee70d68568b7e6ddeabd70b2947a73b1ff2c3c51356140b4a6ecc119b0eb76"],["targets/eyes/r-eye-eyefold-convex.target",1069,"883bc22d1d4699ffda290bc7fdd18e956c784b2fc504f3a4c49b08278d6382d9"],["targets/eyes/r-eye-eyefold-down.target",1653,"44569bba940133d44e07cb66f2946c419e36ff59b45a0e24497930468b749b8a"],["targets/eyes/r-eye-eyefold-up.target",1015,"bc5fac33b9ab5ee66c34c5a8d9449b9d561f2015155c34b5425c02ca9326ddca"],["targets/eyes/r-eye-height1-decr.target",2818,"0e561d96be0453c209ff7cbffdd86cdd73e790a11fc7c0cc8e2e36a1143c46ef"],["targets/eyes/r-eye-height1-incr.target",3586,"daab8f4115ade91e776f9bb4622926ddd20cff2ddcfe74e1ff3654132b727933"],["targets/eyes/r-eye-height2-decr.target",8469,"8fbe66bf11786f68697b5ba720f6f76e1a99f0db066249d369e4476e016f3f64"],["targets/eyes/r-eye-height2-incr.target",5514,"35e1f070ab8a77dc103aab81c478f04136f6afec378a7003d8834e49ff02d916"],["targets/eyes/r-eye-height3-decr.target",4650,"06f6172aecca99b65c01ce9336a6fd744fc6360b80ccba8679ffac34636b8f89"],["targets/eyes/r-eye-height3-incr.target",8184,"2f715100eeb9a1cec7f57d9bb875d746b5a9472ada16d685098f748c5eebebf7"],["targets/eyes/r-eye-push1-in.target",5934,"19b6d4e8af8fbe6821b234c66f8bbf3e1ca043ec79a94750ed30735a250d4ddf"],["targets/eyes/r-eye-push1-out.target",6955,"317c89fe200d18707bd8a71c5f1900565cdcb38f5427d55dd137a05571fc7f30"],["targets/eyes/r-eye-push2-in.target",4636,"c01a1704516b51909e777966fb79ed9a0b4027f68a63e3f98719750eb1ed170e"],["targets/eyes/r-eye-push2-out.target",4231,"a6271fefddb34fd8da2db94e9af58b8d52b3ea13de15567339d49de74fbb8465"],["targets/eyes/r-eye-scale-decr.target",12118,"f43ba41146723a192c755330aa8baa77b638bc28f3736c448e5ce72e8a588f32"],["targets/eyes/r-eye-scale-incr.target",12192,"e1f4cb48575b60a46589635b99a8b87587ba82d7524a8ac1445ace0ba002e918"],["targets/eyes/r-eye-trans-down.target",10766,"763c2044a7b0e1fe6dbe5373035c10dd4a7090bba6db7f1e747016f1a4a295b8"],["targets/eyes/r-eye-trans-in.target",10176,"4c494f3503b219b07782ebf78132da81f2b5711232825cf261dcd1ca57add3d6"],["targets/eyes/r-eye-trans-out.target",12783,"02143e686611f18d36915ee70082234e37db3d38a791cb8e1a46c0c56c4be43c"],["targets/eyes/r-eye-trans-up.target",10241,"f2b2d139f1ab65aabef8483d53636c825ca320b178b51a09644d6942a0b2cafd"],["targets/forehead/forehead-nubian-decr.target",9083,"7475d8f15103e4319e5af3229e8333721055d0c9e145ab0473059b1a9b6ad07d"],["targets/forehead/forehead-nubian-incr.target",9321,"dd35ac6d837bf4feb5599290ce013494ad316c84bdf7ce6c619ba89d08510f7e"],["targets/forehead/forehead-scale-vert-decr.target",5993,"d7b825f28c93766a0ee8e60002b8a0e9c2d8cd2c9b64e7bbd3a278e7103eae1c"],["targets/forehead/forehead-scale-vert-incr.target",5565,"cfe989de3a629665b7147891a9939da30844437f189e39a7d69476cdf7153fbe"],["targets/forehead/forehead-temple-decr.target",2078,"87e64d4445da6c36d19eb1543be6c1047184d2a830314e48d522a1789b921612"],["targets/forehead/forehead-temple-incr.target",5697,"5befc93f4a58ba09f51fcad625fd659b0dc99a86e1d1581373a4e8aecf2e3965"],["targets/forehead/forehead-trans-backward.target",5330,"f5f16d4c7837cbad69a3bd9dd6cfedd9b2b3232cd922ce37958988f8f952e015"],["targets/forehead/forehead-trans-forward.target",6969,"b58ddd3e8a22c9b933b9b6a560599719b4f567ac49eb90560e4a65740eb938c0"],["targets/genitals/penis-circ-decr.target",2577,"59ad48b62ef9b3564c715295de47a59dcbf2df6d94c2e2adc20c0bfd1a5112f5"],["targets/genitals/penis-circ-incr.target",2610,"723c3d5c49aba730b3373c9b1f41d8542fdde78de74a6da8620e9514b395295f"],["targets/genitals/penis-length-decr.target",1535,"00523159e361b15a1062f070f499742cf55bb9d7c58bb3a0e99d966d4ea8de23"],["targets/genitals/penis-length-incr.target",1566,"4e7ac210d81a59c40b9ea43c7e6469796139d04920a46b081597fc6845b37fd5"],["targets/genitals/penis-testicles-decr.target",2240,"d9604a58f6f7e3d641df15514f60cde2c267c78b40d2b6fc75df509eb5084e3e"],["targets/genitals/penis-testicles-incr.target",2329,"2a7d157a4842a3b26847e87953da9d0f0e9af322b341431965c34527c96a05f1"],["targets/head/head-age-decr.target",75981,"dce4ba0fcd18e7a4e5bc86d98785452ac5ca6d33b993d7c37ffdb339e50ff568"],["targets/head/head-age-incr.target",59255,"ff677345bd81e3f439bdf75496bbee620ca3c3f029955a546837afd283abf73a"],["targets/head/head-angle-in.target",68747,"953fe91e2b7db350c1c932637e48b12d719528bdfdd077b44fc1cf7546a3e0fd"],["targets/head/head-angle-out.target",72434,"c0e5eb1f4919d72784d79eeb54082af46061b050bb1c0df29569a752b0ad5e8b"],["targets/head/head-back-scale-depth-decr.target",8977,"9f61e5de3594409e491f8ddcf47862b6f81ae54406e277534de23e669853914c"],["targets/head/head-back-scale-depth-incr.target",9220,"fccca38488e1f4c431943a8fafc55b0501e820ba1233f7f380507c4d444b8d01"],["targets/head/head-diamond.target",11876,"7072c718c8476ca38d6758fb7531fd945612d51acdca6555da8a8f770284c41d"],["targets/head/head-fat-decr.target",14347,"00473b6069f9cf6c05a2f1fd0c0bae20bb4ec45e9552bb5695f1d1533f3cc119"],["targets/head/head-fat-incr.target",14473,"075d18cdfea9e781ae0152132bfea97ea9b901ffdece8d5e6866cb1744f10056"],["targets/head/head-invertedtriangular.target",32815,"d236302afe23f2f2d6d753e4b73f91c1220d17dca24417931fe477a232f18116"],["targets/head/head-oval.target",36452,"a17cd3a600588a344babe520fbd4d4edcb096db3328051fe692dfb997a1a678d"],["targets/head/head-rectangular.target",10633,"bbfcbd4d6334df18515e73abb707b8a948adb74e0aba88a728c8e146dd5f4e4b"],["targets/head/head-round.target",32961,"bd96b745b19432ac838f15438aa87e9002f597e59353861721e12e6da0f2c625"],["targets/head/head-scale-depth-decr.target",73849,"3989a6a769fd4ee5b69179f3b8f3281deb882d943e071ef4b808e5faa4040663"],["targets/head/head-scale-depth-incr.target",69299,"b31ac0344498d2563d216b568a98eb941f6ebcfd07e034a2b8d1958ccb0b9dec"],["targets/head/head-scale-horiz-decr.target",81690,"cadb55b340cb94e96131860beb68b2e46204fccc7ee8f963f66cc9d22b03af0c"],["targets/head/head-scale-horiz-incr.target",83156,"31830f645c194c9451cb5f59cffb8e1d2a1c8fb215afb0c2ab36028b2c24570d"],["targets/head/head-scale-vert-decr.target",77948,"928f8900b8955ec72659156e3153c00cdd2e55ba23eaaab7f8eeee7a5e64f528"],["targets/head/head-scale-vert-incr.target",78317,"d9560ee80b9125da34cc95ece61192a295ab53c50a314c0084ddb3b0f38cc7d6"],["targets/head/head-square.target",12618,"001d0d135d964daf4ad99ba46a0f77c5bc2378f04e53c2b5a20242ab19cbf265"],["targets/head/head-trans-backward.target",74770,"32bc8a9c7a7c49331cd6516e7503134deb0ff17a0cc3b36b474723a8b2e8dbb4"],["targets/head/head-trans-down.target",76202,"1690236b7705f76ea1ff9555c82066158d05278953efbc98df7290147691de5b"],["targets/head/head-trans-forward.target",69655,"ccf934993718025cc1086ce6981c92bdc9a2ed4f7ea67d6ed74640cd2a8799c3"],["targets/head/head-trans-in.target",75186,"587950df2c45ba0dff23ab14a00b4cebd1883d7e216144558326c1f08e84a4af"],["targets/head/head-trans-out.target",69677,"da3a8333abfd73e5a28510b3ad44537d867a9c4c8185cf8b538327840cc0a778"],["targets/head/head-trans-up.target",69100,"48060973dba8d8ffa87d7ce4748dd62e54671d602c1e1a084367312636fb8b75"],["targets/head/head-triangular.target",12676,"09f898db574e636a35b6d39f455e04bfa0bc0248c89d32ad3c959cdb65b8fd1f"],["targets/hip/hip-scale-depth-decr.target",40069,"b9b78017a5fe1627cd88d1e2dcdbf88f5b7a23425de6f224f9d8e4b1bf020932"],["targets/hip/hip-scale-depth-incr.target",39708,"7f523e39224c27d05c9f15e0eb76f8f65722a0f1a9148504f98a60a06cd6a241"],["targets/hip/hip-scale-horiz-decr.target",32914,"b841b486b0f404249d47e0076c31f95c33e358f1cc45e47b499484c84b901330"],["targets/hip/hip-scale-horiz-incr.target",32914,"2863ee4478f548cd2cdd932037fcd21e6b364b9a2d86911d3b603be18f598da7"],["targets/hip/hip-scale-vert-decr.target",35892,"54436921b93e5e95c893a854b76bd8d8ebec917de4944f3466bfd6978e1f76ab"],["targets/hip/hip-scale-vert-incr.target",35547,"11ab97963e182bf1676cf2fcad3c9a675216c072cd603a03c5eaae4575640db8"],["targets/hip/hip-trans-backward.target",39142,"87eafed28b0e117c5776fda08baa1dfe43994c04a14a6074d0d61c833f9037ad"],["targets/hip/hip-trans-down.target",36556,"28f663d9dd2104c2f8828d2162c727411d3399817f574a80854798d368bd24cb"],["targets/hip/hip-trans-forward.target",40396,"5e6511d5f31e14437cd0a0bc52a7f3b2e8b896b7165527b1221c5b36241d769e"],["targets/hip/hip-trans-in.target",36936,"3874a25562b584ab8db3fe1cf3abbc14f49bcd2f00c73a098242f63fa778b9a6"],["targets/hip/hip-trans-out.target",34511,"1c1751e34d754f1fb8547b8437686ad0ead59783bb3517ca52938baee5fccc26"],["targets/hip/hip-trans-up.target",34139,"9869817d184abeed21b246874b468a52342335993e4300398588a91fc971d9b5"],["targets/hip/hip-waist-down.target",36507,"11cdc47e6d24b1070ec388f093b46c40822d8c3a6be60e0299a21d3b309c3bb7"],["targets/hip/hip-waist-up.target",13450,"65738456c82525aea2b8ab0f86cdf74cacbbba22485893e7a514e12662fbf497"],["targets/macrodetails/african-female-baby.target",463097,"b1d4b5c76c73107b8f433bba6e224addf9da542287612868a02109d0f5a1c235"],["targets/macrodetails/african-female-child.target",442183,"f88b8f252df8a9a3f35f78e1664983e9a30756bca1e454afce39438296eb7b41"],["targets/macrodetails/african-female-old.target",408823,"c165e7caf01aaf45511ebc78a441c8c73ead13231af1a8c6666941345f088b61"],["targets/macrodetails/african-female-young.target",411735,"92d61eeb3c164b421fd5a7c3537ee45e7e1a51de4d49bf312e19c3df2be1d8fc"],["targets/macrodetails/african-male-baby.target",463002,"32ce877fa330805971ca636a78aa736bc486b37118e91d2e4bfb9f1ad2cd48a1"],["targets/macrodetails/african-male-child.target",439005,"5b89c85ed7ba9984b5e57a5844b10eb74ab7fcfa79f77a5a3ec697dd860969ed"],["targets/macrodetails/african-male-old.target",411367,"59ec94956b3525dbb30238d1239b2bce52adc3bfae091f12cd85d2570aa1933c"],["targets/macrodetails/african-male-young.target",406170,"894abc1fbb3d28543a51fef16f89d5d4bdf9aa2e1534413339811a3d47818b7d"],["targets/macrodetails/asian-female-baby.target",463063,"43c2a05ac425c4084f9dc30687a294cc5b61699d7c075985536f7e9c3b23f78d"],["targets/macrodetails/asian-female-child.target",447393,"a4fffea45a475a24a0a7332dac28a07dfd60a9af9eb50b61ed5abd1178197f75"],["targets/macrodetails/asian-female-old.target",426301,"1a90cb281df640df55fbce3acd6588f27b28affeb96a7f693f6f038aefc204d8"],["targets/macrodetails/asian-female-young.target",435553,"095fe79694fa19e1fe98d93009ec116199bd524e081c640351a10eccf2cca1eb"],["targets/macrodetails/asian-male-baby.target",463045,"296f9dd9c9716a0e43afb9dadfb35e11be0ecc1f15d2efae6e903b0e91bc07a5"],["targets/macrodetails/asian-male-child.target",442344,"c1b56e9cc549cd7c463f407557d7adceaa217b528c600d34c19df98bc3d6472e"],["targets/macrodetails/asian-male-old.target",427966,"36dc5a3a135ded33885e814806b0e3668ca5bf44bddcebdee48ae75ae68bc3d3"],["targets/macrodetails/asian-male-young.target",421040,"ed2e8c191cb6b87b4a2d97c80486acb2604fa549316c7aa2a738a5d5a14334dc"],["targets/macrodetails/caucasian-female-baby.target",463014,"2ae0b8f760a3608b8e628b9af80054592d0fd0ac4b7867f81d8fc86b5a75c170"],["targets/macrodetails/caucasian-female-child.target",446405,"17fc408839c0a407bf4efd96d9af7eebcdf20d74698659f3597b0647ed6b147e"],["targets/macrodetails/caucasian-female-old.target",408930,"6560982486c4b1a7a0b1d82b0ad3f09770c16b4f87c8f949537dc9cfc941a0b0"],["targets/macrodetails/caucasian-female-young.target",420559,"118379f6e8ba9266247fdb8788a20e1df40a239f97ced0b9905bcbcc74f6e820"],["targets/macrodetails/caucasian-male-baby.target",463026,"f970a2e354b70f8438508a884cd40a9b2ea5cbd24fa6b89a99071a30720c7417"],["targets/macrodetails/caucasian-male-child.target",441028,"401b9b0349c88dc7aacb81e71f67daf747fecde0f7fd7f3f6e10fb2ce5586d1e"],["targets/macrodetails/caucasian-male-old.target",400125,"b0d2b1d58cba0358af59833740e70229265f7da1c20a11240f4123b7192cfd6d"],["targets/macrodetails/caucasian-male-young.target",396479,"70e228ba7164737dae664454394536fc5935fa48d333c1a97d77e2dc6eacc5f5"],["targets/macrodetails/height/female-baby-averagemuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-averagemuscle-averageweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-averagemuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-averagemuscle-maxweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-averagemuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-averagemuscle-minweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-maxmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-maxmuscle-averageweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-maxmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-maxmuscle-maxweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-maxmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-maxmuscle-minweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-minmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-minmuscle-averageweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-minmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-minmuscle-maxweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/female-baby-minmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-baby-minmuscle-minweight-minheight.target",440914,"d0f1c421db9f494034a70951a73bb2af34dfa030c7a27d811520b2c9878677b3"],["targets/macrodetails/height/female-child-averagemuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-averagemuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-averagemuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-averagemuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-averagemuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-averagemuscle-minweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-maxmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-maxmuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-maxmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-maxmuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-maxmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-maxmuscle-minweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-minmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-minmuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-minmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-minmuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-child-minmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/female-child-minmuscle-minweight-minheight.target",444404,"7529c116954716578e64a1059cc43ccd5329457818433de53a4772ca0f668315"],["targets/macrodetails/height/female-old-averagemuscle-averageweight-maxheight.target",421428,"4e234a5b0237ab258b83aabe5ac3706536ba56543d0281d75db1a938dda0c646"],["targets/macrodetails/height/female-old-averagemuscle-averageweight-minheight.target",444392,"9f2c08a5fd89815d9ae523b4965261064d79e78aad50eb9a8fa731c79ec40540"],["targets/macrodetails/height/female-old-averagemuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-averagemuscle-maxweight-minheight.target",444392,"9f2c08a5fd89815d9ae523b4965261064d79e78aad50eb9a8fa731c79ec40540"],["targets/macrodetails/height/female-old-averagemuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-averagemuscle-minweight-minheight.target",444392,"9f2c08a5fd89815d9ae523b4965261064d79e78aad50eb9a8fa731c79ec40540"],["targets/macrodetails/height/female-old-maxmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-maxmuscle-averageweight-minheight.target",444392,"9f2c08a5fd89815d9ae523b4965261064d79e78aad50eb9a8fa731c79ec40540"],["targets/macrodetails/height/female-old-maxmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-maxmuscle-maxweight-minheight.target",35788,"1f80920f3da770a71fb1b86222dc1d40230d83c4498890cca06f7f28ed0c2fe9"],["targets/macrodetails/height/female-old-maxmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-maxmuscle-minweight-minheight.target",444392,"9f2c08a5fd89815d9ae523b4965261064d79e78aad50eb9a8fa731c79ec40540"],["targets/macrodetails/height/female-old-minmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-minmuscle-averageweight-minheight.target",444392,"9f2c08a5fd89815d9ae523b4965261064d79e78aad50eb9a8fa731c79ec40540"],["targets/macrodetails/height/female-old-minmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-minmuscle-maxweight-minheight.target",444384,"a31a8e984434f3c2191c68e1888ddf6ac723706de974587cc69ec999895286c5"],["targets/macrodetails/height/female-old-minmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-old-minmuscle-minweight-minheight.target",444392,"bae2ab152636467361ffc866bb46b21247ca411dd965599f3001034a9f83516f"],["targets/macrodetails/height/female-young-averagemuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-averagemuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-young-averagemuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-averagemuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-young-averagemuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-averagemuscle-minweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-young-maxmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-maxmuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-young-maxmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-maxmuscle-maxweight-minheight.target",444372,"b7edc54eb9735ab752a79e7be15d0be92c81168fe5b5705ac7857b45a79e11d4"],["targets/macrodetails/height/female-young-maxmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-maxmuscle-minweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-young-minmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-minmuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-young-minmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-minmuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/female-young-minmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/female-young-minmuscle-minweight-minheight.target",444392,"48fe0e14e4db968f42d8e48751895fe1547c0424a531002132bce7691ec8aa74"],["targets/macrodetails/height/male-baby-averagemuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-averagemuscle-averageweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-averagemuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-averagemuscle-maxweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-averagemuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-averagemuscle-minweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-maxmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-maxmuscle-averageweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-maxmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-maxmuscle-maxweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-maxmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-maxmuscle-minweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-minmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-minmuscle-averageweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-minmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-minmuscle-maxweight-minheight.target",440900,"5ec3660bcdecc78b4fc2d1b4b1c2d8a3c3d0c2a2297c6ed443cf9dd8126bc283"],["targets/macrodetails/height/male-baby-minmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-baby-minmuscle-minweight-minheight.target",440914,"d0f1c421db9f494034a70951a73bb2af34dfa030c7a27d811520b2c9878677b3"],["targets/macrodetails/height/male-child-averagemuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-averagemuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-averagemuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-averagemuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-averagemuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-averagemuscle-minweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-maxmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-maxmuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-maxmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-maxmuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-maxmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-maxmuscle-minweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-minmuscle-averageweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-minmuscle-averageweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-minmuscle-maxweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-minmuscle-maxweight-minheight.target",444394,"375857dff927f67da53786fc5ac0545c473f4959e3b326727b6b91f49ebdd2e3"],["targets/macrodetails/height/male-child-minmuscle-minweight-maxheight.target",411926,"0d093cad7d4d968756164a21d719aae4deb9e315ac97291d41f32b035ccf6100"],["targets/macrodetails/height/male-child-minmuscle-minweight-minheight.target",444394,"26fd0d609e56c7733222cd16e8a0cfea6685f5ed3902446a3cf2a5057d53eb47"],["targets/macrodetails/height/male-old-averagemuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-averagemuscle-averageweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-old-averagemuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-averagemuscle-maxweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-old-averagemuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-averagemuscle-minweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-old-maxmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-maxmuscle-averageweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-old-maxmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-maxmuscle-maxweight-minheight.target",10129,"10ec077d2a794791fd00e394ca2e8cbc01cb44e7927c17a7ef394f7c604980aa"],["targets/macrodetails/height/male-old-maxmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-maxmuscle-minweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-old-minmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-minmuscle-averageweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-old-minmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-minmuscle-maxweight-minheight.target",444357,"2f2aa67a2bef2474867f5c101a6822d0cab264decbb5ec05f8577552d595bf78"],["targets/macrodetails/height/male-old-minmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-old-minmuscle-minweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-young-averagemuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-averagemuscle-averageweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-young-averagemuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-averagemuscle-maxweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-young-averagemuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-averagemuscle-minweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-young-maxmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-maxmuscle-averageweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-young-maxmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-maxmuscle-maxweight-minheight.target",444349,"225c493ffc12035d0f64e55d8bf54c395d99240186a8c225e6df53d58b4edb24"],["targets/macrodetails/height/male-young-maxmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-maxmuscle-minweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-young-minmuscle-averageweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-minmuscle-averageweight-minheight.target",444375,"76a79d873dc0820ae336645903591f8e6a8adc69865210a6a66f49908caa810b"],["targets/macrodetails/height/male-young-minmuscle-maxweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-minmuscle-maxweight-minheight.target",444349,"6a09165857ab21cb890c09f67f8d209cdc19564b277155e17e48e18de07be885"],["targets/macrodetails/height/male-young-minmuscle-minweight-maxheight.target",420920,"3baacc70187410ebba2b62c56a53775266ab859b7844d47e658d36ee78493621"],["targets/macrodetails/height/male-young-minmuscle-minweight-minheight.target",444373,"2e663001577ea071808ca95dd771acbb059675ef99ab0ec800a1541be384d8f8"],["targets/macrodetails/proportions/female-child-averagemuscle-averageweight-idealproportions.target",348508,"3f853d21a4746d3177df46ded4b407b658a151ffc82658e38c40864b674623d7"],["targets/macrodetails/proportions/female-child-averagemuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-averagemuscle-maxweight-idealproportions.target",347783,"227cb6e69e992b9318be3db945b0cbfe2856f29ec2c8ed3c84e5481ef21f3762"],["targets/macrodetails/proportions/female-child-averagemuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-averagemuscle-minweight-idealproportions.target",348296,"fbed0a885cb2d0d5268af8a1ab93075b24517265abb60ea8635ea0838b751b9b"],["targets/macrodetails/proportions/female-child-averagemuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-maxmuscle-averageweight-idealproportions.target",349660,"775589d7f6e241b3235ec4ab969752c1d9076fc51339d02ba564d6c4428fe950"],["targets/macrodetails/proportions/female-child-maxmuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-maxmuscle-maxweight-idealproportions.target",348176,"6796279dcf6b9d2658f322238482d4d4153c7558c34f546d8619e72a4d885078"],["targets/macrodetails/proportions/female-child-maxmuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-maxmuscle-minweight-idealproportions.target",348257,"fa955742031fdf3d8b3b7941b8094c35e9cd229498a1ec346fa1d0bed2ffc361"],["targets/macrodetails/proportions/female-child-maxmuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-minmuscle-averageweight-idealproportions.target",349266,"51f9e2c5a13a2ba053a7b76cccbc2ce2984a2ccbf8d9a725d9d95d9642da1498"],["targets/macrodetails/proportions/female-child-minmuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-minmuscle-maxweight-idealproportions.target",348176,"6796279dcf6b9d2658f322238482d4d4153c7558c34f546d8619e72a4d885078"],["targets/macrodetails/proportions/female-child-minmuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-child-minmuscle-minweight-idealproportions.target",347590,"bd58e1431b262c6d238fba4a88542df01b59a3738c5efaee4d323428e6b532d7"],["targets/macrodetails/proportions/female-child-minmuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-averagemuscle-averageweight-idealproportions.target",349566,"d2efe289a062817d79ed8fa94bd52f3b947c7e81395703354e7fc185950ae7fa"],["targets/macrodetails/proportions/female-old-averagemuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-averagemuscle-maxweight-idealproportions.target",350969,"975192dd29084c77e2ee329039efd7d0278d478ba087b994cb2c8dff1d63e48c"],["targets/macrodetails/proportions/female-old-averagemuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-averagemuscle-minweight-idealproportions.target",349796,"c1165a8a9a6942a4594f23633f7fdb50790d8f349a40d84b4b0e4aa16f94cd3d"],["targets/macrodetails/proportions/female-old-averagemuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-maxmuscle-averageweight-idealproportions.target",349815,"7e0bfe56022b7cc0f204ef46fe4ff59be67b426e151770686bfc0d75f1f36bf7"],["targets/macrodetails/proportions/female-old-maxmuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-maxmuscle-maxweight-idealproportions.target",347420,"932bfaebb21ba9921a77cae57893c18e9b9a8abcb22b2b3959e3a7ca9478e418"],["targets/macrodetails/proportions/female-old-maxmuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-maxmuscle-minweight-idealproportions.target",349727,"df05798024cce081bd399af9c7bbc2c9ae5df4fccb5f338ec61149dc021eb670"],["targets/macrodetails/proportions/female-old-maxmuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-minmuscle-averageweight-idealproportions.target",349606,"beef507103a654b5246d8f76e4f90e4d8d5edc6c69643ce8550c817fd5a042cc"],["targets/macrodetails/proportions/female-old-minmuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-minmuscle-maxweight-idealproportions.target",349767,"8f50a46ccc4b7fa6b0ee0289b870440daa50dab04de55bf4f84e7f61dfb21b57"],["targets/macrodetails/proportions/female-old-minmuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-old-minmuscle-minweight-idealproportions.target",349547,"10234586fa89511eaf68a7084536c1b56c88567eb61e10df054532fb9c7198ee"],["targets/macrodetails/proportions/female-old-minmuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-averagemuscle-averageweight-idealproportions.target",349563,"0a3bd099b7a88150d56d68b69c07d3d3538cb57279e0e775d13f19d3dc3e339d"],["targets/macrodetails/proportions/female-young-averagemuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-averagemuscle-maxweight-idealproportions.target",349535,"96f81f6e03caae79a75c404c9328aeea0d73e80bfe4b82b5ee247b3d4ce0ea78"],["targets/macrodetails/proportions/female-young-averagemuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-averagemuscle-minweight-idealproportions.target",351599,"8be529e595d7a5fb12352c476faf99af8dd3ae3f50972d452f650d1f2f810213"],["targets/macrodetails/proportions/female-young-averagemuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-maxmuscle-averageweight-idealproportions.target",351047,"12654c6dd22d81a9595f41f149f1988c141ca22a350d4c2b91fccd8f9b2ce23b"],["targets/macrodetails/proportions/female-young-maxmuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-maxmuscle-maxweight-idealproportions.target",349729,"071fb6747e3d1dd00303fc605ad75ce05239c610a3a0c1757ab9210d7f02a020"],["targets/macrodetails/proportions/female-young-maxmuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-maxmuscle-minweight-idealproportions.target",349835,"30330cfaf3d4850c3561567dca3c9dbe08b5c7ddab6163b2565a2964c168fc60"],["targets/macrodetails/proportions/female-young-maxmuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-minmuscle-averageweight-idealproportions.target",349582,"10275c2f0d390ac4180b34ac5fa98e907f50cc3661f3a5f45d2cb4aa9f9cf11a"],["targets/macrodetails/proportions/female-young-minmuscle-averageweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-minmuscle-maxweight-idealproportions.target",349484,"329bad60b852bbc17eb8a6343e95dfc8942c590a21014f85e10afac21ede1ed0"],["targets/macrodetails/proportions/female-young-minmuscle-maxweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/female-young-minmuscle-minweight-idealproportions.target",350141,"d70464833b00c5f36d8516d440cf1aa3835b9f45d51bcccedd48cf7b7c30781d"],["targets/macrodetails/proportions/female-young-minmuscle-minweight-uncommonproportions.target",359317,"e882dfd6d2f2945c4b7b47cc22172ac0ea7837cad1c81f0e43169f7cc3d34a54"],["targets/macrodetails/proportions/male-child-averagemuscle-averageweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-averagemuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-averagemuscle-maxweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-averagemuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-averagemuscle-minweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-averagemuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-maxmuscle-averageweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-maxmuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-maxmuscle-maxweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-maxmuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-maxmuscle-minweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-maxmuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-minmuscle-averageweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-minmuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-minmuscle-maxweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-minmuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-child-minmuscle-minweight-idealproportions.target",163723,"4b36a92868d8ea6f4000777aca494e3ace843baa574271ff2356da89af3b2b7c"],["targets/macrodetails/proportions/male-child-minmuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-averagemuscle-averageweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-averagemuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-averagemuscle-maxweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-averagemuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-averagemuscle-minweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-averagemuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-maxmuscle-averageweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-maxmuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-maxmuscle-maxweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-maxmuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-maxmuscle-minweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-maxmuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-minmuscle-averageweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-minmuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-minmuscle-maxweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-minmuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-old-minmuscle-minweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-old-minmuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-young-averagemuscle-averageweight-idealproportions.target",164124,"7bbd790604c908417ff8ca11e566e3577508d92a4f397a2ace0f89f4cc3aa373"],["targets/macrodetails/proportions/male-young-averagemuscle-averageweight-uncommonproportions.target",190170,"758c0b12e6ba8f1a2b67a884578bae4ad75069a272823adae372e08041bd02c6"],["targets/macrodetails/proportions/male-young-averagemuscle-maxweight-idealproportions.target",162992,"b1d386377040a51f9d2e1c173af028c3485a7c6091ca7e312a50dc28d1bd57f6"],["targets/macrodetails/proportions/male-young-averagemuscle-maxweight-uncommonproportions.target",189409,"aee0e911e17dead7ac8c1f62dc5f63744d77d099583ad83f1f27aa55960c73a7"],["targets/macrodetails/proportions/male-young-averagemuscle-minweight-idealproportions.target",167077,"278060f8fb9c1843df0ae0894d015c8459ccb8cef74cf4f65032bae9152cfd6a"],["targets/macrodetails/proportions/male-young-averagemuscle-minweight-uncommonproportions.target",188717,"8f70af09f5c90205a8143d29f1e716d1e5c50dd792f996ac5e107f010a07af39"],["targets/macrodetails/proportions/male-young-maxmuscle-averageweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-young-maxmuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-young-maxmuscle-maxweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-young-maxmuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-young-maxmuscle-minweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-young-maxmuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-young-minmuscle-averageweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-young-minmuscle-averageweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-young-minmuscle-maxweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-young-minmuscle-maxweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/proportions/male-young-minmuscle-minweight-idealproportions.target",164317,"d9452857903d18a2100ca26105d5a61083e7064fbe16f035863446728755ec20"],["targets/macrodetails/proportions/male-young-minmuscle-minweight-uncommonproportions.target",193841,"197ce307060cedf9f9a26a6d67749ec108582c94d661937128e9578713cae0d9"],["targets/macrodetails/universal-female-baby-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-female-baby-averagemuscle-maxweight.target",78732,"891e93b4674797a1c6cc1b871d86206fe8348fe8c35299b4893c26e0c596a1fd"],["targets/macrodetails/universal-female-baby-averagemuscle-minweight.target",99593,"9bfb8e4f6813c36e6dbffa426f97245dcaf68802e95cbb540b3b75b5a20c5174"],["targets/macrodetails/universal-female-baby-maxmuscle-averageweight.target",106456,"09afe0e0d15212d4d98d533c145793bc9b0fe8755dbaf593fd0fafabb0064fa6"],["targets/macrodetails/universal-female-baby-maxmuscle-maxweight.target",108136,"ab874f2286e7f9e78717d9ee8e6056b5f4bddf2b903e0f8f1e148b6b8e1373e7"],["targets/macrodetails/universal-female-baby-maxmuscle-minweight.target",108257,"5d0953c33a5ce44b46d0962d8b923683f345ab919088c208cf967f7f0cda61a9"],["targets/macrodetails/universal-female-baby-minmuscle-averageweight.target",45166,"eabee9dc7a10d497d773c695d644bdef1c12eff83f4ef75ad22a43deb8164aef"],["targets/macrodetails/universal-female-baby-minmuscle-maxweight.target",131238,"b423d9e90fb7dd46c5b13d589c1870fa77e99ae26a5142d0766343cce8dcd8b8"],["targets/macrodetails/universal-female-baby-minmuscle-minweight.target",224648,"a22bb4435518fbf4d519149eb1979c8445d9cdaf70582cf2ea4a36f65d279d14"],["targets/macrodetails/universal-female-child-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-female-child-averagemuscle-maxweight.target",129308,"311017f8768f42de2f4fa9142381de527a3a3e8bef09190f97e5cd17f5ec4c2a"],["targets/macrodetails/universal-female-child-averagemuscle-minweight.target",140164,"a48d2f7589706e61f5776f115bfe30ce2e12dd1d4cdd5680f288b0e5d6ee69b6"],["targets/macrodetails/universal-female-child-maxmuscle-averageweight.target",142401,"1888abdf3939a332921db2dfb2af29b29cf56fb1ed89245ffb8575ef78aa9f7c"],["targets/macrodetails/universal-female-child-maxmuscle-maxweight.target",135259,"c16f0b9dfc13103a5735b07e11683204aeb3c3414561740003c9824e8cc0c5b7"],["targets/macrodetails/universal-female-child-maxmuscle-minweight.target",136725,"c3a23a9a3060f09be7e498ba9b77f089aa2364e94371ae2dabe606b308ab9913"],["targets/macrodetails/universal-female-child-minmuscle-averageweight.target",255132,"5d2f9ef31873c6f8bd7b639206b4d78ce24919dda341b97ff62adce5ea65a197"],["targets/macrodetails/universal-female-child-minmuscle-maxweight.target",279002,"adbe50e6a09db6087ad7e936f0990ef3d22c2a8ea8c30f2409299f27d4fcb592"],["targets/macrodetails/universal-female-child-minmuscle-minweight.target",236366,"7e4b2d9b4569e477b235e3123eb8e7f5f1a0a5fbf15f050dbba78d991b43a627"],["targets/macrodetails/universal-female-old-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-female-old-averagemuscle-maxweight.target",157586,"c7ff884ece15a4ea161bf9843c9668261e486135aa4c408ecc88dd7e5bc366b2"],["targets/macrodetails/universal-female-old-averagemuscle-minweight.target",150212,"ebb291456482aab827ca0d0bb3928553b422ee0fc6900ae9c9d5fa75195dc23a"],["targets/macrodetails/universal-female-old-maxmuscle-averageweight.target",141235,"c8ab63d583bd1bcf75a3bbbd6b5e43ee30782a704584ea01a3aecbfec510dc42"],["targets/macrodetails/universal-female-old-maxmuscle-maxweight.target",163497,"11549de05d8ab39daee36ca692a56a737f3778006a89684c56f70208c2e7c452"],["targets/macrodetails/universal-female-old-maxmuscle-minweight.target",148741,"453f066a5972f59f40b238bc7d9e6ea68e96d0f1e49cf28f486c3c8c674c192b"],["targets/macrodetails/universal-female-old-minmuscle-averageweight.target",103383,"89c2756e3abacf3d2fb9fae1cc05e68c3e0a244ba2ff244a1f3831da5897a26b"],["targets/macrodetails/universal-female-old-minmuscle-maxweight.target",197647,"788850da7e8e75f74f37003a91473270d84a6e599b5851ed7a6fecafff8fdbd8"],["targets/macrodetails/universal-female-old-minmuscle-minweight.target",245778,"806f995cb9356c70645da92a6b64dddbd8de9ac5480420f64b6d1a651cff254d"],["targets/macrodetails/universal-female-young-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-female-young-averagemuscle-maxweight.target",124481,"3648e7f9b34d947726161b563b90ba92b29860bac4c4f82aea3cec37bad2bb4e"],["targets/macrodetails/universal-female-young-averagemuscle-minweight.target",147131,"e53a4afc87ac2703460a59e8290b1111478aeee5c02ece6735328c1f8c62eb63"],["targets/macrodetails/universal-female-young-maxmuscle-averageweight.target",138225,"2e56b09b44a8497b927585447fdaac5ea7293521d1f3a3df1059495873c53f4e"],["targets/macrodetails/universal-female-young-maxmuscle-maxweight.target",164037,"1b4600abf475b517db2379338a4d36a5f77fb1ad94fd0b210451bfeaa9e7e9b6"],["targets/macrodetails/universal-female-young-maxmuscle-minweight.target",147219,"05351f0063429f4e1e484501b73997a6fb129b93939db355d108f98d5479fb10"],["targets/macrodetails/universal-female-young-minmuscle-averageweight.target",100650,"ab588aadac1ce474969f38b3dbc08c2dc081e861a223f70250e5cae135d054a3"],["targets/macrodetails/universal-female-young-minmuscle-maxweight.target",202635,"66600ccaea3d4c54b1427c81f49160a7cbb2794fbcb7a695ec6e6a4743d72364"],["targets/macrodetails/universal-female-young-minmuscle-minweight.target",380075,"856167f0a03efedd69f91e1cbad065957c8e8fef6acaaaf5b85a32b0f018fa67"],["targets/macrodetails/universal-male-baby-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-male-baby-averagemuscle-maxweight.target",79455,"c8ddbea5e0336bb00df2154b8533cf71a6cc7ca7583c77f7cfb259934d0770b4"],["targets/macrodetails/universal-male-baby-averagemuscle-minweight.target",99829,"19f83504f9272c18c0c14694b29b2cebdf348033495299bf99f68881e8dd4b6f"],["targets/macrodetails/universal-male-baby-maxmuscle-averageweight.target",106590,"ac4e6a31b06b0864dfd5cf8c2498ef0574e2403772c7d5b3562b38d49bfec114"],["targets/macrodetails/universal-male-baby-maxmuscle-maxweight.target",107972,"7f6b7f7a0a76b36244d71828fa4de5b171509230a6a84dd26863f5c157754e9d"],["targets/macrodetails/universal-male-baby-maxmuscle-minweight.target",107906,"93ce9d2295989a5603078f119ed6fc8a1f2f86f32cc5ff55a181e7d97695ba85"],["targets/macrodetails/universal-male-baby-minmuscle-averageweight.target",45240,"9ad53b6a261466d772b6ff8b713b3fb8738b4c7a3c92ba21c9d9a0007adcebb5"],["targets/macrodetails/universal-male-baby-minmuscle-maxweight.target",131641,"2541dc8dcde94f61fd536ccfb94add0e554d599bf232c8a86d197d2224ff719a"],["targets/macrodetails/universal-male-baby-minmuscle-minweight.target",224823,"4a404ef92cf37904db80615928e6bf50b0fa7fd0c651e8b9d78b8a99cac55d8d"],["targets/macrodetails/universal-male-child-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-male-child-averagemuscle-maxweight.target",148084,"7efd862be258e5a00b4cbeb896302bd33a58ad2c33209a4ff5f432cc0453dc2c"],["targets/macrodetails/universal-male-child-averagemuscle-minweight.target",145955,"03a9c12855ea7bea9b07191f1d02b6f1e887f118864854e61b8c14bcc110db3c"],["targets/macrodetails/universal-male-child-maxmuscle-averageweight.target",162191,"ed10d8c628f73a4f494aaf2238601d0ced89866de6250188232e897c0f4b1e83"],["targets/macrodetails/universal-male-child-maxmuscle-maxweight.target",169701,"8cb2622050a49ce44e0554cc2f979e71b8f0535d5a3e80bd4550f05a2840b6c5"],["targets/macrodetails/universal-male-child-maxmuscle-minweight.target",151983,"b982963eae02ca43ff2a108878b95d2b284c2f1756d08a94e9835cbcfd432110"],["targets/macrodetails/universal-male-child-minmuscle-averageweight.target",151083,"9ae65451e36ad2f282b6298acae1af45ec395cf6acdeca70814e0e607bdfd5d5"],["targets/macrodetails/universal-male-child-minmuscle-maxweight.target",228630,"d98963b18b164de3e34c01301c343ac351eb8aa9a62ad6d4147dac44870ffaf7"],["targets/macrodetails/universal-male-child-minmuscle-minweight.target",208583,"2526baed3cd8001f4eb8593dfcc8aa7790ada8c2e23ac3a13188f0e8b93abbe7"],["targets/macrodetails/universal-male-old-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-male-old-averagemuscle-maxweight.target",154294,"ac49086cf6a33f38fa3e0208c3036d335a70529e22f15f0836244b7c7448c10b"],["targets/macrodetails/universal-male-old-averagemuscle-minweight.target",148768,"dd7cae80610fc806b424f0b26d43994060053c9dd15f141001ca4e60479ddd5e"],["targets/macrodetails/universal-male-old-maxmuscle-averageweight.target",149874,"6385a3125af0dbc445b8f2a10100166ba93a7c62ac2d49a13557feb3791f2c74"],["targets/macrodetails/universal-male-old-maxmuscle-maxweight.target",175314,"cf232cbd26aff7177ec6e264e0a1024a4bb7696168c8040270f1990711cb1d49"],["targets/macrodetails/universal-male-old-maxmuscle-minweight.target",150982,"bfe62f32e70f1e178af19437c0e86af21a68afaaaffd0f255b5679d72545420b"],["targets/macrodetails/universal-male-old-minmuscle-averageweight.target",156099,"761fbb7b920b2ebf0d00c94b5743709bc90a5a2a0410fe3d57dea34c99715751"],["targets/macrodetails/universal-male-old-minmuscle-maxweight.target",235736,"57ba4273844dfbf03b5548059b577901502354845f30389d9f4b083689b636a2"],["targets/macrodetails/universal-male-old-minmuscle-minweight.target",182402,"2d2f1bc78b1ac1f87adcf4e632a58bfb1237ab1f4b8b5527f2e6907d38b2364d"],["targets/macrodetails/universal-male-young-averagemuscle-averageweight.target",604,"4ba5396ddabda448ece15650a566fbebfbb10239256ccb201e8f883429e12249"],["targets/macrodetails/universal-male-young-averagemuscle-maxweight.target",155861,"3e77ff5a07a9b870db5226507e1cf8a295f0e09c109fb72142770f5f50427b5e"],["targets/macrodetails/universal-male-young-averagemuscle-minweight.target",147071,"fac0d53b7051f4d1f06230d0b419e916eb5bae5ce67c031a9998fdde05229755"],["targets/macrodetails/universal-male-young-maxmuscle-averageweight.target",147110,"c171ff9cc95e96273beb3e3b1969a01988c2d4982ebc6fe04bf81cf72ee3b295"],["targets/macrodetails/universal-male-young-maxmuscle-maxweight.target",175015,"95392741389537889a37dc67a7d8453c93b30f27131e3e622bee3f30d1d8738c"],["targets/macrodetails/universal-male-young-maxmuscle-minweight.target",150179,"5873f11edc96fde72a79ec35fa1d292a6a1a594b5eadfd82d59faf48834561de"],["targets/macrodetails/universal-male-young-minmuscle-averageweight.target",155256,"aa2bd57c3d82cbcbaee3f35e75c7d03952bbb9624003d7ee6f1aa50e04bfa5ba"],["targets/macrodetails/universal-male-young-minmuscle-maxweight.target",235752,"14580444f1480b1c6b396973f8c040cc36e5ca8914addf17d11c5a023a958de2"],["targets/macrodetails/universal-male-young-minmuscle-minweight.target",182223,"3af713db636eb41f32af5010981bad30efe743a3ab1d4a61c619c664b610a51a"],["targets/measure/measure-ankle-circ-decr.target",16524,"0abb3c55b334b8508addf583a626f775ac45fa95eff773131dbd7ff48bf6d95d"],["targets/measure/measure-ankle-circ-incr.target",16414,"01bbc7823b71199826e987227e22fc97ac88247467368414fd11309062d0fdcf"],["targets/measure/measure-bust-circ-decr.target",34643,"3d4c9f8c7d084e4d6c35ffc3a798bc35bdbe80fd56929d03e0c6f1b31ec5c736"],["targets/measure/measure-bust-circ-incr.target",40556,"46394c7f9cdfac31654f14950b57bbfb874c9a2fa68e48c9cc3e7bba619b75f4"],["targets/measure/measure-calf-circ-decr.target",14968,"2914fc47781e23987607c6546f4535ae5d8b04e2e2bec908ab588ee94e74aa15"],["targets/measure/measure-calf-circ-incr.target",14846,"c6106ec484a875a8763a7e9b12a4891da8efcd5152efbc1c7061f40bdc4353a6"],["targets/measure/measure-frontchest-dist-decr.target",12726,"f4e04366bf4cced20e5df530175395489a8ed77a4cdf801cfe23c3d802721913"],["targets/measure/measure-frontchest-dist-incr.target",14412,"1df008ccc1237b74284d58d22bae5445cee3858c1f541ce9b85766ebaaf82a96"],["targets/measure/measure-hips-circ-decr.target",25872,"8a98e80047ab89148d60067aad3b452ce715eadcaf7a1e28402140dd1ac8fb11"],["targets/measure/measure-hips-circ-incr.target",26447,"e4294db231dd3283680e6be4b9d3d8d81aa7c575a32f937f8d0751b1ec3d6512"],["targets/measure/measure-knee-circ-decr.target",17711,"fc8d4ff31694018587f32979183f2342ac2e4882b99ff9eac71050eac2bcca27"],["targets/measure/measure-knee-circ-incr.target",18436,"a3f57ce71ae6955ebca4b3927fa9adcf7d4718df7e0c8641adea37cb1e781ecb"],["targets/measure/measure-lowerarm-length-decr.target",92768,"87287a1546234e55b7081192659a335af0ac0ff88bdebb732577352a088d87fa"],["targets/measure/measure-lowerarm-length-incr.target",89495,"6a5c5d34fbc5051f75d6c3511911f7542da96b8ae9cdbcbccf346411a9bf1afb"],["targets/measure/measure-lowerleg-height-decr.target",59660,"267a461a42209dc1547fba016179646d38f9148fa177867e234b6018a404e98a"],["targets/measure/measure-lowerleg-height-incr.target",75540,"b76887923140e6fbf91d3488f10faff33f9ad0269e614061592ba324e9384d7b"],["targets/measure/measure-napetowaist-dist-decr.target",202923,"967ae5d9d3a1ea82c699aeca00d1edbf6ec1393285e12af37b5016b171a1dde4"],["targets/measure/measure-napetowaist-dist-incr.target",179290,"3e26eb2b0a52f8ce874cfa2f307f47606f6909f8a68c7f49b50123bf1d94ecb0"],["targets/measure/measure-neck-circ-decr.target",9421,"897528bbe50e0c7193d3032eae062ae1878ec5965cbd93fc2f4091d5d69c2d47"],["targets/measure/measure-neck-circ-incr.target",14966,"caa38a399ef4dcdd713e5cb3e496afa8c6c938dea41fd848703d4549a48a74c0"],["targets/measure/measure-neck-height-decr.target",74160,"dd7e5fc0cb52cc4b43521b6386bb2503bf46f19d469269a5b0dd0c6d217d1ed6"],["targets/measure/measure-neck-height-incr.target",68854,"5759b2b17604301ccd2844e66b2f814064c13b8da2559de6a0ee7109f1f20373"],["targets/measure/measure-shoulder-dist-decr.target",88046,"15034d390da69ce7a3e46dfee0e248d0649bf6fc0bfec575b4cacf48b7a1ba5a"],["targets/measure/measure-shoulder-dist-incr.target",82836,"af7394300c91d64fb0b032377aae72e546c778d1d5c00daed88858c04ee9150b"],["targets/measure/measure-thigh-circ-decr.target",18564,"fe5303874b0ffe26a69cefd3e213b6478eec4648f60b0b110a1e176ccf24eaa9"],["targets/measure/measure-thigh-circ-incr.target",23303,"5dca89b139df6f9b7c7641485dee18e9f0da10087359b9df5ca6a1e752ea0bcc"],["targets/measure/measure-underbust-circ-decr.target",39087,"94c7a07cf0b71a2a5f6e369ba9bf10e1e30ac2ef93596567f16178623867c186"],["targets/measure/measure-underbust-circ-incr.target",40408,"aa6a8fa8385b127ac000b227e64c80dd97e09640bec69728636a23aa21d6cfdf"],["targets/measure/measure-upperarm-circ-decr.target",16653,"42e5780765402bfedf65c59cf8f846ffe6fe06b120e11762376a4ab9ec57f383"],["targets/measure/measure-upperarm-circ-incr.target",16797,"37f960203ae6c006399d3d26ab81e6d1de81523e86f845549aa94ca345c5d980"],["targets/measure/measure-upperarm-length-decr.target",88564,"abe56f2b05ed531af994f50549730183bbc00b868ddc96aceb296ab997fbea44"],["targets/measure/measure-upperarm-length-incr.target",93539,"274fef021ec84e4f646e82aa1df39fe9cc781fc872f0159ee815a04f970248a9"],["targets/measure/measure-upperleg-height-decr.target",93265,"fb17a93a653d16b59c20c2e48eac01338e6025f5097484c5c55038213130aee5"],["targets/measure/measure-upperleg-height-incr.target",107639,"e532edd028160842297d4acf77ea961cb5a3016e29d6077bc35464ed6a4bd567"],["targets/measure/measure-waist-circ-decr.target",27663,"6a976bd7819fa037a290b381bb3e04dfd04220dddeac194c476472295d2baba8"],["targets/measure/measure-waist-circ-incr.target",27682,"4949212ec9a5e227b177a029ee42b0be3fd3b273a211bc91c6f4d4dbf0334856"],["targets/measure/measure-waisttohip-dist-decr.target",195549,"db2e9e593ce2b75889b456c45e44962be8d54a4ca7304fedfd8f90444ad12cb4"],["targets/measure/measure-waisttohip-dist-incr.target",188430,"bdea75b49dfb5ffdf4ecdddd212ba1d98e145fbf354c0e8463487f0db3f9e9ff"],["targets/measure/measure-wrist-circ-decr.target",11983,"6bc9862a042361c8afdf0ca427f304b8a40c872c53eb7b324a00302ef48ab9b1"],["targets/measure/measure-wrist-circ-incr.target",12282,"31fab1eac883e06be0146c2c1f2819638db6e983a125b9f4dcb071420720d9e1"],["targets/mouth/mouth-angles-down.target",7962,"39181b6688e6f5ada15b47a82977c75379152434c61dafe8822afb3f551d4fa6"],["targets/mouth/mouth-angles-up.target",6450,"8ddc2f53f4264742f4e10ddafd128e059e09c6a4268a2722e9495bad0f274898"],["targets/mouth/mouth-cupidsbow-decr.target",1291,"debb5dc739434f127604157a9cf361658d1a9814d099a82e43076f612dd3cc20"],["targets/mouth/mouth-cupidsbow-incr.target",2045,"341055fc0d804cec57f0d2aaccc7a090e7d649a5f1b60dbb7d44e4ff2ce40869"],["targets/mouth/mouth-cupidsbow-width-decr.target",2174,"96075322d5f5a8a7129eefc4fd74d8d9f8b92eaf0719329a45b2d1cf4679f0d7"],["targets/mouth/mouth-cupidsbow-width-incr.target",2202,"f66e986b25c1998a2217d917b41075b61f245bdf35769c6a9b21a58588242321"],["targets/mouth/mouth-dimples-in.target",1112,"bc74f0fdc6f5779f4a69b801ba9201d625948af6e21acbb404b8cb6c4fce8c4e"],["targets/mouth/mouth-dimples-out.target",1560,"0cb3576858cabcf2915132673833a94944943a31a82e3c55ec5a3798aa654269"],["targets/mouth/mouth-laugh-lines-in.target",1663,"73ffbdf95dfbb2c6b6381d6a78621c9b97a8823c2129f99244bb7535edd055db"],["targets/mouth/mouth-laugh-lines-out.target",1755,"d42c833442e2c97a93b8293d78a9ef3494ac6e3fb615d13c2ad8e97d720dffa4"],["targets/mouth/mouth-lowerlip-ext-down.target",1460,"e549b246a81f901363b82534be07b2ca4be38914d6d3968692c50160d3f344cb"],["targets/mouth/mouth-lowerlip-ext-up.target",1893,"9c56c0078efef520ab755c9d74d81f3c9ef7581b946ae24e70848624e25a15fc"],["targets/mouth/mouth-lowerlip-height-decr.target",2272,"26503f3ae2e468d90e10a4c0cb73a17414051108c240b6a5c8079ad2e27f8d92"],["targets/mouth/mouth-lowerlip-height-incr.target",1682,"42181c0b02e0ed30d2d453ae15dbd87600da561d6e4df6fdbd7cc272bdbf5a98"],["targets/mouth/mouth-lowerlip-middle-down.target",1299,"97fbac0d2d0295f0d7ccd0f23356df95077de410ff36ea7e8bd7a02a28ad1759"],["targets/mouth/mouth-lowerlip-middle-up.target",1388,"b52334380917a0b648a35cfd89dd48fbb7fa95745fff28753d30ea73d169de7c"],["targets/mouth/mouth-lowerlip-volume-decr.target",1828,"45f1fe355546cdaa86581512810ee1cd2c6971ac67ffb46d3391ac438e539d15"],["targets/mouth/mouth-lowerlip-volume-incr.target",3585,"dbdaf045b00c67bf8672d53bc8cf94eb3e3dea316de6fe18a278f7080564c65d"],["targets/mouth/mouth-lowerlip-width-decr.target",2150,"f125ab08820f8762d5c623eb72182f5d86dcead188bfbd863d9f117554bd2b7a"],["targets/mouth/mouth-lowerlip-width-incr.target",2772,"6be43c8f0333323dd9affc9141066502d136d15d767596257c08b64cca82a847"],["targets/mouth/mouth-philtrum-volume-decr.target",1073,"e7400e4042f6f2a7fc3ec330ebc8f7f8269173eae52e29785ff00b0f831b0a6b"],["targets/mouth/mouth-philtrum-volume-incr.target",890,"5b3020ed98d17882e43d47c10886ccf72a0976bb772ec8599553bab5ecefcf91"],["targets/mouth/mouth-scale-depth-decr.target",7437,"15e5da9894901446e21ff4feda6aa757b67e889745995a1d1544002e615c8a30"],["targets/mouth/mouth-scale-depth-incr.target",7513,"ef1411bcef771a73718fd7b4dfb380290a19a06321babb69b19a26247dc0745d"],["targets/mouth/mouth-scale-horiz-decr.target",12644,"07a9ef160755467a470bd0a1df035143d83ebddbc12e4612e69e93a64644405c"],["targets/mouth/mouth-scale-horiz-incr.target",15657,"ccfc39cca249883ebc46af6f2c96c4130df13a67ebce30a2550af17a48637770"],["targets/mouth/mouth-scale-vert-decr.target",7495,"6087f1f8acd837aa1ad098965e907767b80238927c6b5c95f248d45a8aecd48b"],["targets/mouth/mouth-scale-vert-incr.target",13436,"acdbd062c3709211daf947c437b4962a944148c4255501fdd449625160e3d50a"],["targets/mouth/mouth-trans-backward.target",17919,"5d9479ef28a61228104891237f82c871dae1cee433067b3cdb8e4d265e3fe7bc"],["targets/mouth/mouth-trans-down.target",17308,"635eb596ad9ce51a7874fee601ec9abf6ef3d9a95816a06caf1b6d410797f055"],["targets/mouth/mouth-trans-forward.target",16083,"e2174201e312702cb1196c268813660f25df9ed32f0f3706bc1135e74ab14d85"],["targets/mouth/mouth-trans-in.target",17509,"7d67a82fd61afa85638e41c2af5d27bfad4b9efb615fb4a994aa91b9186e43ef"],["targets/mouth/mouth-trans-out.target",17645,"e92343987725a1b4efe962279dd85c1b46d512ee19b0d1c678ff9fbb60aeb097"],["targets/mouth/mouth-trans-up.target",16864,"fdbec49a44e9467464a241fef0c4df0f67bbab0c2133a45e45c35f33d1d4c1aa"],["targets/mouth/mouth-upperlip-ext-down.target",2993,"86093379323ca71d4568cdf90c78b1b6fdf773432ccd76b0e3f9202bb07a96b9"],["targets/mouth/mouth-upperlip-ext-up.target",1817,"e00274071ac520d7ecb0e55f51b7b9895f9adb19094a48d0b8c6ec4ec4f715fb"],["targets/mouth/mouth-upperlip-height-decr.target",3695,"9ec5e25eedc30442f06d0df75275438ba8778d48910b8fd6478efecf78621349"],["targets/mouth/mouth-upperlip-height-incr.target",4290,"4eed688bb333c53b579e06bc1c555a5d01a61dbe3f9702aa4e1340384c597c49"],["targets/mouth/mouth-upperlip-middle-down.target",2436,"bc35d43e1e631c84df30730cb3578ba35bc645fbf55d0b586ebebb2f424a56ab"],["targets/mouth/mouth-upperlip-middle-up.target",2311,"5c36d059a282170ce74e86b03a65523539bd474dd1ecf6f6f95046c6a32b177b"],["targets/mouth/mouth-upperlip-volume-decr.target",2649,"20b285d94ecb62cf605907d65659ab11ff760dbb938ba9ae7fc13429b1e3ba16"],["targets/mouth/mouth-upperlip-volume-incr.target",3600,"b124cbd9b9be318264f61a143da603b42e0357ed92b4b6afd1b31a83daaf8568"],["targets/mouth/mouth-upperlip-width-decr.target",2954,"03c14256205de15266956e741a6d4aa4df46070ad539187b6b3168d0cb16ac0e"],["targets/mouth/mouth-upperlip-width-incr.target",10647,"fde8bbe4e9d856ff2acb66820955816630c0bc8b5ce9484f34d5284aeb1481f9"],["targets/neck/neck-back-scale-depth-decr.target",4980,"a2466cce4331a6ff3d7ea84be9a07cb06d41ff1ee4aec109badef17868337af3"],["targets/neck/neck-back-scale-depth-incr.target",3915,"2857b4e1d49a36d6ca65cd6ae915df9048ce82f141a4b15e2f388153938cf0d0"],["targets/neck/neck-double-decr.target",3618,"21757d56fd147be67c962fdad9c3fee07e06bf069f17f1bb8f29fdae53b17b5a"],["targets/neck/neck-double-incr.target",4236,"095d6a532e3cb4da3cef1f41b940b5fec830a90e61b0ddf8b56d84f9021a2217"],["targets/neck/neck-scale-depth-decr.target",12881,"0859baedc84b94cb4cc93eda0df44fa9c1156c75f013a34fd017695acd72ba2b"],["targets/neck/neck-scale-depth-incr.target",12758,"05d69f134d945677193d37c49796516c183e4b2dd3da20e528ff09a6b0a6e93d"],["targets/neck/neck-scale-horiz-decr.target",8453,"9f63b4b73461064d2f5173eefe7f3929870025b040c2fe70a5508be493067c99"],["targets/neck/neck-scale-horiz-incr.target",10711,"60be8afb75b4c6e41f0157a157cdeba09b6efb5597e417ccd155e14cb06a216d"],["targets/neck/neck-scale-vert-decr.target",93735,"971bae2a8ab215aa45d6073979a9ed85d0c35327434e3fc9c6e6171a90056229"],["targets/neck/neck-scale-vert-incr.target",82561,"2618b7c18c1460fdba8d980da6fa2963210ae903a1a4464dfe55adabdd4eaa5a"],["targets/neck/neck-trans-backward.target",16373,"2299aad92bfffe0a512ffe1591b58d0e8cb96279a873b67161e07b892eca04bd"],["targets/neck/neck-trans-down.target",10436,"18f5ba07bb4f894f52fe00c8d2f87445b5528726a29d1ecb91f900f3110f2204"],["targets/neck/neck-trans-forward.target",11452,"7c76b98672b65899a341c3e9bb6ae88568f3404a2bdbfd13c21373d87d2a7515"],["targets/neck/neck-trans-in.target",10148,"654e62406dca3c60b2995512bbac3d07e71e2a7e984e8fb87fadc6fadec175d3"],["targets/neck/neck-trans-out.target",8454,"47162fc5a19bc8ecaa497eabe0946eb51450ee9000bbe92f537d2f33f4cea647"],["targets/neck/neck-trans-up.target",4715,"b018648e9303f253313020dcf20bb8802caa8420d60246444f64f880fa01ce0c"],["targets/nose/nose-base-down.target",5246,"f0c22a439540d31e389857a42a415be3bb2262bedb1821b9ce66578068bfebb1"],["targets/nose/nose-base-up.target",4783,"b3f8625bfbbbe455fba4dadcd668a49e48dd8a746597b4c34f4ac46d1ac4ea1d"],["targets/nose/nose-compression-compress.target",2149,"8ffbd7a874eec1661bb3b1311ad046e77145425f1332c86c2f251a444fff83da"],["targets/nose/nose-compression-uncompress.target",1137,"293440df01fc8afaf20a8c8891e7b98de00a00512146c1947f324c73b9d08200"],["targets/nose/nose-curve-concave.target",1906,"30dd70cfdf1ce1c77eabff12b49d238b05a3b36f95f2ba6f64d4b5b059292e58"],["targets/nose/nose-curve-convex.target",1459,"3426e9a53c65962bc75b25aae04759a03e818d708bc5445ffc4dfb812497a7ca"],["targets/nose/nose-flaring-decr.target",3350,"394229c051ec21a8d233341d7ff1b2dc94da7929ace1d0bb2de2bcbdd08d6c0f"],["targets/nose/nose-flaring-incr.target",3072,"697eccedc27b77abbbdc8de87af193e2a5818b9a535e7f0ec8016ce848892fad"],["targets/nose/nose-greek-decr.target",1041,"6dedab05ceb00cbf4965d8ec0b4c4c9c3408fac6781bd73ffd7a0c36a84fbcf7"],["targets/nose/nose-greek-incr.target",1331,"26377458cdc453ff93a9b025c3a6043b4c5f3000173fb125e5b2a7cc66981855"],["targets/nose/nose-hump-decr.target",1114,"036f94479be3cd896d01eb30916af67eaf37b9e1442b97bbffb524fcbe83a04b"],["targets/nose/nose-hump-incr.target",6836,"87f167e76cc908e8f28fed8623cf55e737f59499e8338cfe78f5d635382a5191"],["targets/nose/nose-nostrils-angle-down.target",3393,"151478df5f37878b1ef5458990504c042f76dba5ea2b98d7b98def2ff0037f6c"],["targets/nose/nose-nostrils-angle-up.target",4046,"d403a05ea2d3178d95060649cf273cce475b6428118032473535cd47e51402ba"],["targets/nose/nose-nostrils-width-decr.target",4128,"381335aed6091e8b394092dabea983b89bc2e35f548ced6b5ab2eca6dabc8bd2"],["targets/nose/nose-nostrils-width-incr.target",4538,"15dfd7b35cac462e8ceca6b3787bd863982b765c1b8a39375e2271b55434a29f"],["targets/nose/nose-point-down.target",2313,"decda7e7827d53f0906663d10ff6ee0173d501b8f3bf30dda3540e4465fa6021"],["targets/nose/nose-point-up.target",1672,"c8d556af4cc6fe5fbf340b1950156fffad3835524a191b47074466f244a92047"],["targets/nose/nose-point-width-decr.target",1796,"b9abb0a0fa7acf3208acee76ab9e329c89b4e7b6c83fcf8429ffd004aae1a4cc"],["targets/nose/nose-point-width-incr.target",1483,"c6dca10cdc77721b2e90dad9eef5e56f6c69359687de2e9aa2a965cfe598c56f"],["targets/nose/nose-scale-depth-decr.target",5811,"b46c35046c9c451b7ffe77acc0573bd945d7c6acaefe43d8c21912d4ce1a6e4c"],["targets/nose/nose-scale-depth-incr.target",5762,"6bb03c3065e048d6e9abbcfa58961bfbe1753a307be0d3de477cac6aeaf5f750"],["targets/nose/nose-scale-horiz-decr.target",5074,"1227e6f513d202585e40045fe4234778597bb591ac492e7f9313347cd9a9f2ec"],["targets/nose/nose-scale-horiz-incr.target",7568,"cc319e3ddb0523fa2b563dcfc840cf2f915a890abe5612009a0becebecd3c5ae"],["targets/nose/nose-scale-vert-decr.target",5431,"a154747135740f63f60df812024fcde24df2a6713effa3c6f27797aeee7d3311"],["targets/nose/nose-scale-vert-incr.target",6648,"b87163e4272d77bcdb7b51328504167f71a7a47b630dc9b13da9c68e0f06c20f"],["targets/nose/nose-septumangle-decr.target",6329,"8d31807fcba66c0089e9bbd4916bf1cd11bc16728f826504df910af554804a23"],["targets/nose/nose-septumangle-incr.target",5590,"814b5bcb7fbb2dc0e5ba402d61f49dd77afe33884c0baf658ecd14b17dbcdd04"],["targets/nose/nose-trans-backward.target",9950,"026897f67c2b668f6d3200efe264449037bd0efe10a6cda80807198e5dd50544"],["targets/nose/nose-trans-down.target",6689,"6a4d970a97a1e1b3db113ca88cd1e75a6f950f296c7f456a4931f6b460c58dae"],["targets/nose/nose-trans-forward.target",6808,"a7b232e6ca56d7027388f5a9028fe45e513fbc71cedb34f299912e8a457394e8"],["targets/nose/nose-trans-in.target",9151,"98ac3bc94aaab67e486f448d7fb1cd68cd4504c2b2326d450e2880bf95ad410c"],["targets/nose/nose-trans-out.target",8580,"13e18cfc36f16cd432bfcff1c509d65da4aeef41986835cb15c84849908daba1"],["targets/nose/nose-trans-up.target",8106,"4c1ee5897c22dfb66aee081f65fd9fb77173e8af5bc5c9e8676073dd9eda1d4a"],["targets/nose/nose-volume-decr.target",1274,"97251aecca039f94ab6ea6f996eaf0b232aa4c44b39671a13ba0bc6c8f4bf6bb"],["targets/nose/nose-volume-incr.target",3076,"510730156376c91322f7391154a211c7222184c24c48f3345b7212dfbc583738"],["targets/nose/nose-width1-decr.target",1526,"91a63986af9115fe944f2a3f1177e1eed2ebe8cdd9037a4734d95bd36231d9f4"],["targets/nose/nose-width1-incr.target",1507,"d340bc76601f9061826849d2fc9146ba6fbf7ee0604799849a417c934f53bea0"],["targets/nose/nose-width2-decr.target",1272,"d3301686c7dfd94b0a39fd0693ff26ea66d24b08037488f814e7a8bb340109d9"],["targets/nose/nose-width2-incr.target",2000,"13a9ab9ab6429a5875b47fe90cb33a4d754258af63819ee8913a93d61f312d76"],["targets/nose/nose-width3-decr.target",4617,"eb3e782e1b335f10c68be43ccc75bea98193f330b4d0c7f98f9773f580ce12c3"],["targets/nose/nose-width3-incr.target",6595,"32a88f1b999ea83f57889dda7fbda05347b57b41e0118e7c4cd4466e6b0ba6ec"],["targets/pelvis/bulge-decr.target",852,"a4c13aee1da6179ffe61f2a64af464e4254b9a75128929837fc694a39359ec80"],["targets/pelvis/bulge-incr.target",6922,"70553b24d0adb5a4aac0340fd61a1eeb80020d653f5307d8bb742afc97dcd022"],["targets/pelvis/pelvis-tone-decr.target",6978,"6ff89c892eecbe297616b3c728a5965007c3f2fc3272d8208791cf13ead3bf8e"],["targets/pelvis/pelvis-tone-incr.target",18926,"cdf7cb0e84292141e8c2862f467310529fb6e8a015761bb02ee3f7e9195ea1d1"],["targets/stomach/stomach-navel-down.target",5607,"ef7ec2bd881fb9b177ff564b0acf2b29e9301901f6019c397507814b6471a8dd"],["targets/stomach/stomach-navel-in.target",930,"ed81ff7be117fbb1049152a465f22ee04dd1137bf5d23d75b78591e7c989a6dd"],["targets/stomach/stomach-navel-out.target",898,"9e1f35ae6923fe8aee739854af698e9694cae5d30c8ce719c397bdf9fad31227"],["targets/stomach/stomach-navel-up.target",5257,"248621ffd3d693f3626edc6ababd01446de97375c2dee173192bd9d7a8c832a2"],["targets/stomach/stomach-pregnant-decr.target",4957,"c312c72444527d7db00e84a144d15ea7a9ebe43dfdd6673936ddac3c46a75e1b"],["targets/stomach/stomach-pregnant-incr.target",12939,"559c384d27b42097432f847d5cf61488f029fd8aa68b6e69d442c00cd0589057"],["targets/stomach/stomach-tone-decr.target",9440,"74806fe39dad66fd525662833026d0de327a4b8eee1d7bbbd65f3ff3958a8439"],["targets/stomach/stomach-tone-incr.target",3949,"0fc4629f4f38b7c83dadc3a1a650f0db6e8c50f974ff57eb920d4881cadcf0d9"],["targets/torso/torso-muscle-dorsi-decr.target",17154,"1878bddce66cdce86358c9056d1a5c8403f410fe7363fa8cacda3edce16fc43c"],["targets/torso/torso-muscle-dorsi-incr.target",18435,"a9eb27874c600716c4ac058caf922671c6556427f00373d0d31c7615d31ded56"],["targets/torso/torso-muscle-pectoral-decr.target",10694,"0fe1690e93ccb92d8a8487e54fddb353610ca4e38911509f9611fb5e75f73682"],["targets/torso/torso-muscle-pectoral-incr.target",17400,"0299c687b73a5e217d00273da99acb8a983c8a83640177062fdc27d20bdce77b"],["targets/torso/torso-scale-depth-decr.target",42626,"1f14e272b398ea5845957dc92a8ccbcde103b2a2fd6fca4acd14a824a9f76b2d"],["targets/torso/torso-scale-depth-incr.target",40255,"095c3fd83173dc91c20d7ed06655ff67fe823795fb7f2df2c5560845f661a0dc"],["targets/torso/torso-scale-horiz-decr.target",116893,"8377c248eec6838292f55287b6a399398f7cb88e6d7d0af6781d8e30298e0d6f"],["targets/torso/torso-scale-horiz-incr.target",107221,"73f278c2be9c6eebead7ac4cd206879810a9e0202519493af0ed8b2e3842fbb5"],["targets/torso/torso-scale-vert-decr.target",201961,"36b6004016de6b9aedf7dd37367e1c394aa4f4446294e31d9a467ba90d0f67d2"],["targets/torso/torso-scale-vert-incr.target",195680,"8b12834f17df560c5c178de7fe98d09abb72f34431dd51144887ccba3687b02e"],["targets/torso/torso-trans-backward.target",174720,"b657d44360bfcfed93c2b8f8657b91d33cb04d0981ae9ce71732a9d2156fc7d4"],["targets/torso/torso-trans-down.target",199451,"64a286cb457cd3cbc7cab7e122912245a1c32809d130777ddf4176f404d67c76"],["targets/torso/torso-trans-forward.target",161802,"0545a33c1ba39f3885c5ba9503c1e133f4ee295166106ef0faf8c41b606fbe8c"],["targets/torso/torso-trans-in.target",174981,"ca19202a6116afd33064f3d72d294773255b88b60fbe05523d31256486ba108a"],["targets/torso/torso-trans-out.target",161953,"255ccb15ad0c7b743902772c4dd15cab9a4b45feb4de1393d57dffdd701be44c"],["targets/torso/torso-trans-up.target",143731,"bb612861befc94ce2cfcf07d1d2ec6a2a40df966b72b7af3855385d31ebedf9f"],["targets/torso/torso-vshape-decr.target",96183,"f9da55d42731ef5fcfeaa9a473d84044cd7d19076c67dab5139cf001e85b09b2"],["targets/torso/torso-vshape-incr.target",95207,"9d0ac9eec39a14d51d7db50e48292b3db67aed9b91e654b379f4dbe348644684"]] };
diff --git a/packages/forge/src/human/makehuman.ts b/packages/forge/src/human/makehuman.ts
deleted file mode 100644
index e49949d8..00000000
--- a/packages/forge/src/human/makehuman.ts
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
- * MakeHuman's file formats: the base mesh (OBJ with named groups; the body
- * plus helper geometry and the little "joint-…" cubes whose centers place
- * the skeleton), shape targets (sparse `index dx dy dz` lines), the
- * skeleton (`.mhskel` JSON: bones whose head and tail are vertex groups)
- * and its painted skin weights (`.mhw` JSON: bone → [[vertex, weight]]).
- */
-
-export interface BaseMesh {
- /** Every vertex of the file, 3 per vertex (decimeters, +y up, facing +z). */
- positions: Float32Array;
- uvs: Float32Array;
- /** Faces of the "body" group: per corner, vertex and UV index. */
- faces: { v: number[]; vt: number[] }[];
- /** Faces of the helper groups the body uses (teeth, tongue), by group name. */
- helpers: Map<string, { v: number[]; vt: number[] }[]>;
-}
-
-/** Helper geometry that renders: the teeth and tongue inside the mouth. */
-export const MOUTH_GROUPS = new Set([
- "helper-upper-teeth",
- "helper-lower-teeth",
- "helper-tongue",
-]);
-
-export function parseBaseObj(text: string): BaseMesh {
- const positions: number[] = [];
- const uvs: number[] = [];
- const faces: { v: number[]; vt: number[] }[] = [];
- const helpers = new Map<string, { v: number[]; vt: number[] }[]>();
- let group = "";
- for (const line of text.split("\n")) {
- if (line.startsWith("v ")) {
- const [, x, y, z] = line.trim().split(/\s+/);
- positions.push(Number(x), Number(y), Number(z));
- } else if (line.startsWith("vt ")) {
- const [, u, v] = line.trim().split(/\s+/);
- uvs.push(Number(u), Number(v));
- } else if (line.startsWith("g ")) group = line.slice(2).trim();
- else if (
- line.startsWith("f ") &&
- (group === "body" || MOUTH_GROUPS.has(group))
- ) {
- const corners = line.trim().split(/\s+/).slice(1);
- const face = {
- v: corners.map((c) => Number(c.split("/")[0]) - 1),
- vt: corners.map((c) => Number(c.split("/")[1]) - 1),
- };
- if (group === "body") faces.push(face);
- else {
- const list = helpers.get(group) ?? [];
- list.push(face);
- helpers.set(group, list);
- }
- }
- }
- return {
- positions: Float32Array.from(positions),
- uvs: Float32Array.from(uvs),
- faces,
- helpers,
- };
-}
-
-export interface Target {
- indices: Uint32Array;
- /** 3 per index. */
- deltas: Float32Array;
-}
-
-export function parseTarget(text: string): Target {
- const indices: number[] = [];
- const deltas: number[] = [];
- for (const line of text.split("\n")) {
- if (!line || line.startsWith("#")) continue;
- const [i, x, y, z] = line.trim().split(/\s+/);
- if (i === undefined) continue;
- indices.push(Number(i));
- deltas.push(Number(x), Number(y), Number(z));
- }
- return {
- indices: Uint32Array.from(indices),
- deltas: Float32Array.from(deltas),
- };
-}
-
-export interface MhBone {
- name: string;
- parent: string | null;
- head: string;
- tail: string;
-}
-
-export interface MhSkeleton {
- bones: MhBone[];
- /** Joint name → the vertices whose mean places it. */
- joints: Map<string, number[]>;
-}
-
-interface MhskelJson {
- bones: Record<string, { head: string; tail: string; parent: string | null }>;
- joints: Record<string, number[]>;
-}
-
-export function parseSkeleton(text: string): MhSkeleton {
- const json = JSON.parse(text) as MhskelJson;
- const bones = Object.entries(json.bones).map(([name, b]) => ({
- name,
- parent: b.parent,
- head: b.head,
- tail: b.tail,
- }));
- // Parents first.
- const placed = new Set<string>();
- const ordered: MhBone[] = [];
- while (ordered.length < bones.length) {
- const before = ordered.length;
- for (const b of bones)
- if (!placed.has(b.name) && (b.parent === null || placed.has(b.parent))) {
- ordered.push(b);
- placed.add(b.name);
- }
- if (ordered.length === before)
- throw new Error("mhskel: a bone's parent is missing");
- }
- return { bones: ordered, joints: new Map(Object.entries(json.joints)) };
-}
-
-/** Bone → [[vertex, weight], …]. */
-export function parseWeights(text: string): Map<string, [number, number][]> {
- const json = JSON.parse(text) as {
- weights: Record<string, [number, number][]>;
- };
- return new Map(Object.entries(json.weights));
-}
-
-/** A proxy (clothes, eyes) bound to the base mesh: each vertex is a barycentric point on three base vertices plus a scaled offset. */
-export interface MhProxy {
- /** Per proxy vertex: three base vertex indices. */
- refs: Uint32Array;
- /** Per proxy vertex: three weights. */
- weights: Float32Array;
- /** Per proxy vertex: offset (decimeters at the reference scale). */
- offsets: Float32Array;
- /** Per axis: two base vertices whose distance along it, over `ref`, scales the offsets. */
- scales: { a: number; b: number; ref: number }[];
-}
-
-export function parseProxy(text: string): MhProxy {
- const refs: number[] = [];
- const weights: number[] = [];
- const offsets: number[] = [];
- const scales: { a: number; b: number; ref: number }[] = [
- { a: 0, b: 0, ref: 0 },
- { a: 0, b: 0, ref: 0 },
- { a: 0, b: 0, ref: 0 },
- ];
- let inVerts = false;
- for (const raw of text.split("\n")) {
- const line = raw.trim();
- if (!line || line.startsWith("#")) continue;
- const parts = line.split(/\s+/);
- const head = parts[0] as string;
- const scale = { x_scale: 0, y_scale: 1, z_scale: 2 }[head];
- if (scale !== undefined) {
- scales[scale] = {
- a: Number(parts[1]),
- b: Number(parts[2]),
- ref: Number(parts[3]),
- };
- continue;
- }
- if (head === "verts") {
- inVerts = true;
- continue;
- }
- if (!inVerts) continue;
- if (parts.length < 9 || Number.isNaN(Number(head))) {
- inVerts = false;
- continue;
- }
- refs.push(Number(parts[0]), Number(parts[1]), Number(parts[2]));
- weights.push(Number(parts[3]), Number(parts[4]), Number(parts[5]));
- offsets.push(Number(parts[6]), Number(parts[7]), Number(parts[8]));
- }
- return {
- refs: Uint32Array.from(refs),
- weights: Float32Array.from(weights),
- offsets: Float32Array.from(offsets),
- scales,
- };
-}
-
-/** The proxy's vertices placed on a (shaped) base mesh, in its units. */
-export function fitProxy(proxy: MhProxy, base: Float32Array): Float32Array {
- const s = proxy.scales.map(({ a, b, ref }, axis) =>
- ref
- ? Math.abs(
- (base[a * 3 + axis] as number) - (base[b * 3 + axis] as number),
- ) / ref
- : 1,
- );
- const n = proxy.refs.length / 3;
- const out = new Float32Array(n * 3);
- for (let v = 0; v < n; v++)
- for (let axis = 0; axis < 3; axis++) {
- let p = 0;
- for (let k = 0; k < 3; k++)
- p +=
- (proxy.weights[v * 3 + k] as number) *
- (base[(proxy.refs[v * 3 + k] as number) * 3 + axis] as number);
- out[v * 3 + axis] =
- p + (proxy.offsets[v * 3 + axis] as number) * (s[axis] as number);
- }
- return out;
-}
-
-/** A plain OBJ: positions, UVs and faces (corner vertex and UV indices). */
-export function parseObj(text: string): {
- positions: Float32Array;
- uvs: Float32Array;
- faces: { v: number[]; vt: number[] }[];
-} {
- const positions: number[] = [];
- const uvs: number[] = [];
- const faces: { v: number[]; vt: number[] }[] = [];
- for (const line of text.split("\n")) {
- if (line.startsWith("v ")) {
- const [, x, y, z] = line.trim().split(/\s+/);
- positions.push(Number(x), Number(y), Number(z));
- } else if (line.startsWith("vt ")) {
- const [, u, v] = line.trim().split(/\s+/);
- uvs.push(Number(u), Number(v));
- } else if (line.startsWith("f ")) {
- const corners = line.trim().split(/\s+/).slice(1);
- faces.push({
- v: corners.map((c) => Number(c.split("/")[0]) - 1),
- vt: corners.map((c) => Number(c.split("/")[1]) - 1),
- });
- }
- }
- return {
- positions: Float32Array.from(positions),
- uvs: Float32Array.from(uvs),
- faces,
- };
-}
diff --git a/packages/forge/src/human/skin.ts b/packages/forge/src/human/skin.ts
deleted file mode 100644
index 8b2af5a7..00000000
--- a/packages/forge/src/human/skin.ts
+++ /dev/null
@@ -1,489 +0,0 @@
-/**
- * Skin textures for a `human()`, made in code: a base color and a roughness
- * map baked into the body's own UV layout, and a tiling detail normal map
- * of pores and fine creases.
- *
- * Color varies where real skin does. Blood shows through as redness on
- * the cheeks, nose and eyelids, the lips are darker and redder, and
- * melanin and blood mottle the whole body at two scales. Roughness drops
- * on the wet lips and the oily nose. The facial regions come from the
- * face's own blend shapes (the lips are what `mouthPucker` moves, the
- * cheeks what `mouthSmile` lifts), so they follow any shaped face without
- * a hand-painted mask.
- */
-import { type ColorInput, linearRgb } from "../color.js";
-import { encodePng } from "../png.js";
-import { Noise3 } from "../sculpt/noise.js";
-import type { HumanModel } from "./human.js";
-
-export interface SkinOptions {
- /** Base skin color (display sRGB). Default "#d9b29a". */
- color?: ColorInput;
- /** Lip color. Default: the skin, darker and redder. */
- lips?: ColorInput;
- /** Redness of the cheeks, nose and lids, 0 … 1. Default 0.5. */
- blush?: number;
- /** Mottling of the base color, 0 … 1. Default 0.5. */
- mottle?: number;
- /** Base roughness. Default 0.5. */
- roughness?: number;
- /** Color and roughness map size, pixels. Default 2048. */
- size?: number;
- /** Pore spacing, cm. Default 0.14. */
- poreSpacing?: number;
- seed?: number;
-}
-
-export interface SkinTextures {
- /** Base color, PNG (sRGB), on the body's UVs. */
- color: Uint8Array;
- /** glTF metallic-roughness PNG (roughness in green, metal 0), on the body's UVs. */
- roughness: Uint8Array;
- /** Tiling tangent-space normal map of pores and creases, PNG. */
- detail: Uint8Array;
- /** How many times `detail` repeats across the UV square for the pores to come out at `poreSpacing`. */
- detailRepeat: number;
-}
-
-const clamp01 = (x: number) => Math.min(1, Math.max(0, x));
-const smooth = (a: number, b: number, x: number) => {
- const t = clamp01((x - a) / (b - a));
- return t * t * (3 - 2 * t);
-};
-
-/** Per vertex, how far a named blend shape moves it, over the shape's largest move (0 when the body has no such shape). */
-function reach(body: HumanModel["body"], names: string[]): Float32Array {
- const n = body.positions.length / 3;
- const out = new Float32Array(n);
- for (const name of names) {
- const d = body.targets.find((t) => t.name === name)?.positions;
- if (!d) continue;
- let max = 0;
- const m = new Float32Array(n);
- for (let v = 0; v < n; v++) {
- m[v] = Math.hypot(
- d[v * 3] as number,
- d[v * 3 + 1] as number,
- d[v * 3 + 2] as number,
- );
- max = Math.max(max, m[v] as number);
- }
- if (max > 0)
- for (let v = 0; v < n; v++)
- out[v] = Math.max(out[v] as number, (m[v] as number) / max);
- }
- return out;
-}
-
-/**
- * The lips per vertex, 0 … 1. Pursing moves the mouth corners furthest,
- * which places them; the lips are the lens between them, the upper about
- * a sixth of the mouth's width tall and the lower a fifth, with soft edges.
- * Vertices inside the mouth fall in the lens too, which colors the inner
- * lips and gums alike.
- */
-function lipMask(body: HumanModel["body"], pucker: Float32Array): Float32Array {
- const p = body.positions;
- const n = pucker.length;
- const corner = (side: 1 | -1) => {
- let best = -1;
- for (let v = 0; v < n; v++)
- if (
- side * (p[v * 3] as number) > 0 &&
- (best < 0 || (pucker[v] as number) > (pucker[best] as number))
- )
- best = v;
- return best;
- };
- const l = corner(1);
- const r = corner(-1);
- const out = new Float32Array(n);
- if (l < 0 || r < 0) return out;
- const cx = ((p[l * 3] as number) - (p[r * 3] as number)) / 2;
- const mx = ((p[l * 3] as number) + (p[r * 3] as number)) / 2;
- const my = ((p[l * 3 + 1] as number) + (p[r * 3 + 1] as number)) / 2;
- const mz = Math.min(p[l * 3 + 2] as number, p[r * 3 + 2] as number);
- const width = 2 * cx;
- const soft = width * 0.04;
- for (let v = 0; v < n; v++) {
- const x = ((p[v * 3] as number) - mx) / cx;
- const y = (p[v * 3 + 1] as number) - my;
- // Only the front of the face, not the back of the head.
- if (Math.abs(x) >= 1 || (p[v * 3 + 2] as number) < mz - width * 0.3)
- continue;
- const lens = Math.sqrt(1 - x * x);
- const extent = (y >= 0 ? 0.17 : 0.2) * width * lens;
- out[v] =
- (1 - smooth(extent - soft, extent + soft, Math.abs(y))) *
- (1 - smooth(0.88, 1, Math.abs(x)));
- }
- return out;
-}
-
-/** Facial regions per vertex, 0 … 1. */
-function regions(body: HumanModel["body"]) {
- const pucker = reach(body, ["mouthPucker"]);
- const smile = reach(body, ["mouthSmileLeft", "mouthSmileRight"]);
- const nose = reach(body, ["noseWrinkle", "noseSneerLeft", "noseSneerRight"]);
- const lids = reach(body, ["eyeBlinkLeft", "eyeBlinkRight"]);
- const lips = lipMask(body, pucker);
- const n = pucker.length;
- const blush = new Float32Array(n);
- const lid = new Float32Array(n);
- for (let v = 0; v < n; v++) {
- blush[v] = Math.max(
- smooth(0.03, 0.35, smile[v] as number) * (1 - (lips[v] as number)),
- smooth(0.1, 0.6, nose[v] as number) * 0.8,
- );
- lid[v] = smooth(0.2, 0.7, lids[v] as number);
- }
- return { lips, blush, lid };
-}
-
-/** Model units (cm) per UV unit over the head, where the pores matter. */
-function headTexelScale(body: HumanModel["body"], height: number): number {
- const p = body.positions;
- const uv = body.uvs;
- const idx = body.indices;
- const ratios: number[] = [];
- for (let f = 0; f < idx.length; f += 3) {
- const [a, b, c] = [idx[f], idx[f + 1], idx[f + 2]] as [
- number,
- number,
- number,
- ];
- if ((p[a * 3 + 1] as number) < height * 0.88) continue;
- const e = (i: number, j: number, k: number) =>
- (p[j * 3 + k] as number) - (p[i * 3 + k] as number);
- const ex = [e(a, b, 0), e(a, b, 1), e(a, b, 2)];
- const fx = [e(a, c, 0), e(a, c, 1), e(a, c, 2)];
- const area3 =
- Math.hypot(
- (ex[1] as number) * (fx[2] as number) -
- (ex[2] as number) * (fx[1] as number),
- (ex[2] as number) * (fx[0] as number) -
- (ex[0] as number) * (fx[2] as number),
- (ex[0] as number) * (fx[1] as number) -
- (ex[1] as number) * (fx[0] as number),
- ) / 2;
- const du1 = (uv[b * 2] as number) - (uv[a * 2] as number);
- const dv1 = (uv[b * 2 + 1] as number) - (uv[a * 2 + 1] as number);
- const du2 = (uv[c * 2] as number) - (uv[a * 2] as number);
- const dv2 = (uv[c * 2 + 1] as number) - (uv[a * 2 + 1] as number);
- const areaUv = Math.abs(du1 * dv2 - du2 * dv1) / 2;
- if (areaUv > 1e-12 && area3 > 0) ratios.push(Math.sqrt(area3 / areaUv));
- }
- ratios.sort((x, y) => x - y);
- return ratios[Math.floor(ratios.length / 2)] ?? 100;
-}
-
-/** Periodic 2D value lattice for tileable noise: `period` cells per tile. */
-class TileNoise {
- private readonly values: Float32Array;
- constructor(
- private readonly period: number,
- seed: number,
- ) {
- let s = seed >>> 0;
- this.values = Float32Array.from({ length: period * period * 2 }, () => {
- s = (Math.imul(s ^ (s >>> 15), 0x2c1b3c6d) + 0x9e3779b9) >>> 0;
- return (s / 4294967296) * 2 - 1;
- });
- }
-
- /** Gradient noise at tile coordinates `u, v` in 0 … 1, about -1 … 1. */
- at(u: number, v: number): number {
- const P = this.period;
- const x = u * P;
- const y = v * P;
- const xi = Math.floor(x);
- const yi = Math.floor(y);
- const fx = x - xi;
- const fy = y - yi;
- const g = (i: number, j: number, dx: number, dy: number) => {
- const k = ((((i % P) + P) % P) + (((j % P) + P) % P) * P) * 2;
- const a = (this.values[k] as number) * Math.PI;
- return Math.cos(a) * dx + Math.sin(a) * dy;
- };
- const fade = (t: number) => t * t * t * (t * (t * 6 - 15) + 10);
- const sx = fade(fx);
- const sy = fade(fy);
- const n00 = g(xi, yi, fx, fy);
- const n10 = g(xi + 1, yi, fx - 1, fy);
- const n01 = g(xi, yi + 1, fx, fy - 1);
- const n11 = g(xi + 1, yi + 1, fx - 1, fy - 1);
- return (
- (n00 +
- sx * (n10 - n00) +
- sy * (n01 + sx * (n11 - n01) - n00 - sx * (n10 - n00))) *
- 1.4
- );
- }
-}
-
-/** Pore cells across one tile of the detail map. */
-const PORE_CELLS = 24;
-
-/**
- * A tiling tangent-space normal map of skin microrelief: pits on a
- * jittered grid (one per cell, varied in size and depth), two families of
- * fine creases crossing at an angle, and a soft unevenness.
- */
-export function poreNormalMap(size = 512, seed = 7): Uint8Array {
- const N = size;
- const height = new Float32Array(N * N);
- let s = seed >>> 0;
- const rand = () => {
- s = (s + 0x6d2b79f5) >>> 0;
- let t = s;
- t = Math.imul(t ^ (t >>> 15), t | 1);
- t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
- return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
- };
- const G = PORE_CELLS;
- const pores = Array.from({ length: G * G }, () => ({
- x: rand(),
- y: rand(),
- r: 0.18 + 0.2 * rand(),
- depth: 0.5 + 0.5 * rand(),
- }));
- // Crease networks at about the pore spacing: pores sit where they cross.
- const creaseA = new TileNoise(G, seed + 1);
- const creaseB = new TileNoise(Math.round(G * 1.5), seed + 2);
- const soft = new TileNoise(4, seed + 3);
- for (let py = 0; py < N; py++)
- for (let px = 0; px < N; px++) {
- const u = (px + 0.5) / N;
- const v = (py + 0.5) / N;
- let h = 0;
- const cx = Math.floor(u * G);
- const cy = Math.floor(v * G);
- for (let oy = -1; oy <= 1; oy++)
- for (let ox = -1; ox <= 1; ox++) {
- const gx = cx + ox;
- const gy = cy + oy;
- const pore = pores[(((gx % G) + G) % G) + (((gy % G) + G) % G) * G];
- if (!pore) continue;
- const dx = u * G - (gx + pore.x);
- const dy = v * G - (gy + pore.y);
- const d = Math.hypot(dx, dy) / pore.r;
- if (d < 1) h -= pore.depth * (1 - d * d) ** 2;
- }
- // Creases: the zero lines of two noises, sharpened into grooves.
- const a = creaseA.at(u + 0.05 * soft.at(v, u), v);
- const b = creaseB.at(u, v + 0.05 * soft.at(u, v));
- h -= 0.2 * (1 - smooth(0, 0.15, Math.abs(a)));
- h -= 0.12 * (1 - smooth(0, 0.12, Math.abs(b)));
- h += 0.3 * soft.at(u, v);
- height[py * N + px] = h;
- }
- const rgba = new Uint8Array(N * N * 4);
- const k = N / 64; // slope scale: a unit of height over 1/64 of the tile
- const hAt = (x: number, y: number) =>
- height[(((y % N) + N) % N) * N + (((x % N) + N) % N)] as number;
- for (let y = 0; y < N; y++)
- for (let x = 0; x < N; x++) {
- const dx = (hAt(x + 1, y) - hAt(x - 1, y)) * 0.5 * (k / 8);
- // +Y in a glTF normal map points up the image (toward row 0).
- const dy = (hAt(x, y - 1) - hAt(x, y + 1)) * 0.5 * (k / 8);
- const l = Math.hypot(dx, dy, 1);
- const i = (y * N + x) * 4;
- rgba[i] = Math.round((-dx / l) * 127.5 + 127.5);
- rgba[i + 1] = Math.round((-dy / l) * 127.5 + 127.5);
- rgba[i + 2] = Math.round((1 / l) * 127.5 + 127.5);
- rgba[i + 3] = 255;
- }
- return encodePng(rgba, N, N);
-}
-
-const toSrgb8 = (c: number) => {
- const x = clamp01(c);
- return Math.round(
- (x <= 0.0031308 ? x * 12.92 : 1.055 * x ** (1 / 2.4) - 0.055) * 255,
- );
-};
-
-/** Bakes the body's skin textures (see `SkinTextures`). */
-export function skinTextures(
- h: Pick<HumanModel, "body" | "height">,
- options: SkinOptions = {},
-): SkinTextures {
- const S = options.size ?? 2048;
- const base = linearRgb(options.color ?? "#d9b29a");
- const lipColor = options.lips
- ? linearRgb(options.lips)
- : ([base[0] * 0.78, base[1] * 0.42, base[2] * 0.45] as [
- number,
- number,
- number,
- ]);
- const blushAmount = options.blush ?? 0.5;
- const mottle = options.mottle ?? 0.5;
- const rough = options.roughness ?? 0.5;
- const seed = options.seed ?? 1;
- const { body } = h;
- const { lips, blush, lid } = regions(body);
- const melanin = new Noise3(seed);
- const blood = new Noise3(seed + 1);
- const p = body.positions;
- const uv = body.uvs;
- const idx = body.indices;
-
- // Per vertex: the skin's linear color and roughness. Broad variation
- // lives on the vertices (a few mm apart on the face); the texels add
- // the fine freckling.
- const n = p.length / 3;
- const vColor = new Float32Array(n * 3);
- const vRough = new Float32Array(n);
- for (let v = 0; v < n; v++) {
- const [x, y, z] = [
- p[v * 3] as number,
- p[v * 3 + 1] as number,
- p[v * 3 + 2] as number,
- ];
- const lip = lips[v] as number;
- const red =
- ((blush[v] as number) + (lid[v] as number) * 0.35) * blushAmount;
- const m = melanin.fbm(x / 8, y / 8, z / 8, 2);
- const b = blood.fbm(x / 3, y / 3, z / 3, 2);
- const dark = 1 - 0.08 * mottle * m;
- const flush = clamp01(red + 0.25 * mottle * b);
- for (let k = 0; k < 3; k++) {
- // Blood absorbs green and blue: redness scales them down.
- const skin =
- (base[k] as number) * dark * (k === 0 ? 1 : 1 - 0.28 * flush);
- vColor[v * 3 + k] = skin + ((lipColor[k] as number) - skin) * lip;
- }
- vRough[v] = clamp01(
- rough - 0.16 * lip - 0.04 * (blush[v] as number) + 0.04 * b,
- );
- }
-
- const color = new Float32Array(S * S * 3);
- const roughness = new Float32Array(S * S);
- const filled = new Uint8Array(S * S);
- const shade = (
- texel: number,
- w0: number,
- w1: number,
- w2: number,
- a: number,
- b: number,
- c: number,
- ) => {
- const x =
- w0 * (p[a * 3] as number) +
- w1 * (p[b * 3] as number) +
- w2 * (p[c * 3] as number);
- const y =
- w0 * (p[a * 3 + 1] as number) +
- w1 * (p[b * 3 + 1] as number) +
- w2 * (p[c * 3 + 1] as number);
- const z =
- w0 * (p[a * 3 + 2] as number) +
- w1 * (p[b * 3 + 2] as number) +
- w2 * (p[c * 3 + 2] as number);
- // Freckling at about 1 cm.
- const fine = 1 - 0.05 * mottle * melanin.at(x, y, z);
- for (let k = 0; k < 3; k++)
- color[texel * 3 + k] =
- (w0 * (vColor[a * 3 + k] as number) +
- w1 * (vColor[b * 3 + k] as number) +
- w2 * (vColor[c * 3 + k] as number)) *
- fine;
- roughness[texel] =
- w0 * (vRough[a] as number) +
- w1 * (vRough[b] as number) +
- w2 * (vRough[c] as number);
- filled[texel] = 1;
- };
- for (let f = 0; f < idx.length; f += 3) {
- const vs = [idx[f], idx[f + 1], idx[f + 2]] as [number, number, number];
- const X = vs.map((v) => (uv[v * 2] as number) * S - 0.5);
- const Y = vs.map((v) => (uv[v * 2 + 1] as number) * S - 0.5);
- const [x0, x1, x2] = X as [number, number, number];
- const [y0, y1, y2] = Y as [number, number, number];
- const area = (x1 - x0) * (y2 - y0) - (x2 - x0) * (y1 - y0);
- if (Math.abs(area) < 1e-12) continue;
- const minX = Math.max(0, Math.floor(Math.min(x0, x1, x2)));
- const maxX = Math.min(S - 1, Math.ceil(Math.max(x0, x1, x2)));
- const minY = Math.max(0, Math.floor(Math.min(y0, y1, y2)));
- const maxY = Math.min(S - 1, Math.ceil(Math.max(y0, y1, y2)));
- for (let ty = minY; ty <= maxY; ty++)
- for (let tx = minX; tx <= maxX; tx++) {
- const w0 = ((x1 - tx) * (y2 - ty) - (x2 - tx) * (y1 - ty)) / area;
- const w1 = ((x2 - tx) * (y0 - ty) - (x0 - tx) * (y2 - ty)) / area;
- const w2 = 1 - w0 - w1;
- if (w0 < -1e-6 || w1 < -1e-6 || w2 < -1e-6) continue;
- shade(ty * S + tx, w0, w1, w2, vs[0], vs[1], vs[2]);
- }
- }
- dilate(S, filled, [color, 3], [roughness, 1]);
-
- const colorRgba = new Uint8Array(S * S * 4);
- const roughRgba = new Uint8Array(S * S * 4);
- for (let t = 0; t < S * S; t++) {
- for (let k = 0; k < 3; k++)
- colorRgba[t * 4 + k] = toSrgb8(color[t * 3 + k] as number);
- colorRgba[t * 4 + 3] = 255;
- roughRgba[t * 4] = 255;
- roughRgba[t * 4 + 1] = Math.round((roughness[t] as number) * 255);
- roughRgba[t * 4 + 2] = 0;
- roughRgba[t * 4 + 3] = 255;
- }
- const tileCm = (options.poreSpacing ?? 0.14) * PORE_CELLS;
- return {
- color: encodePng(colorRgba, S, S),
- roughness: encodePng(roughRgba, S, S),
- detail: poreNormalMap(512, seed + 7),
- detailRepeat: Math.max(
- 1,
- Math.round(headTexelScale(body, h.height) / tileCm),
- ),
- };
-}
-
-/**
- * Grows the painted texels outward into the empty ones, so filtering and
- * mipmaps at UV seams average skin with skin instead of with black.
- */
-function dilate(
- S: number,
- filled: Uint8Array,
- ...channels: [Float32Array, number][]
-) {
- let front = filled;
- for (let pass = 0; pass < 8; pass++) {
- const next = front.slice();
- for (let y = 0; y < S; y++)
- for (let x = 0; x < S; x++) {
- const t = y * S + x;
- if (front[t]) continue;
- let n = 0;
- for (const [dx, dy] of [
- [1, 0],
- [-1, 0],
- [0, 1],
- [0, -1],
- ] as const) {
- const xx = x + dx;
- const yy = y + dy;
- if (xx < 0 || yy < 0 || xx >= S || yy >= S || !front[yy * S + xx])
- continue;
- const s = yy * S + xx;
- for (const [data, size] of channels)
- for (let k = 0; k < size; k++)
- data[t * size + k] =
- (n ? (data[t * size + k] as number) : 0) +
- (data[s * size + k] as number);
- n++;
- }
- if (!n) continue;
- for (const [data, size] of channels)
- for (let k = 0; k < size; k++)
- data[t * size + k] = (data[t * size + k] as number) / n;
- next[t] = 1;
- }
- front = next;
- }
-}
diff --git a/packages/forge/src/human/source.ts b/packages/forge/src/human/source.ts
deleted file mode 100644
index b91cf5de..00000000
--- a/packages/forge/src/human/source.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Where the human base comes from: MakeHuman's bundled assets (base mesh,
- * shape targets, rig, eyes), released under CC0 1.0 (the program code is
- * AGPL and is not used). Pinned to one commit; every file's size and
- * SHA-256 are in `makehuman-pins.ts`, generated by `scripts/pin-makehuman.ts`.
- */
-export const MAKEHUMAN_SOURCE = {
- repo: "makehumancommunity/makehuman",
- commit: "a8bc2d54ff0ac92e78ff71431b1023eda42bf482",
- license: "CC0-1.0",
- /** Raw file URL for a path under `makehuman/data/`. */
- url(path: string): string {
- return `https://raw.githubusercontent.com/${this.repo}/${this.commit}/makehuman/data/${path}`;
- },
-} as const;
diff --git a/packages/forge/src/human/store.ts b/packages/forge/src/human/store.ts
deleted file mode 100644
index d304ee7a..00000000
--- a/packages/forge/src/human/store.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Lazy, verified human assets. Constructing the store does no I/O; a file
- * is fetched the first time `ensure` asks for it, checked against its pinned
- * size and SHA-256 (`@framefields/storage`'s verified download: temp file,
- * then rename), cached on disk across processes and in memory for the
- * process. Concurrent requests for one file share one download.
- *
- * Cache: `$FRAMEFIELDS_CACHE_DIR/makehuman/<commit>` (default
- * `~/.cache/framefields`). Mirror: `baseUrl` or `$FRAMEFIELDS_HUMAN_BASE_URL`
- * serves `<baseUrl>/<path>` in place of GitHub.
- */
-import { readFile, stat } from "node:fs/promises";
-import { homedir } from "node:os";
-import { join, resolve } from "node:path";
-import { downloadVerified, type FileDigest } from "@framefields/storage";
-import { MAKEHUMAN_SOURCE } from "./source.js";
-
-export function humanCacheDir(): string {
- const root = process.env.FRAMEFIELDS_CACHE_DIR
- ? resolve(process.env.FRAMEFIELDS_CACHE_DIR)
- : resolve(homedir(), ".cache/framefields");
- return join(root, "makehuman", MAKEHUMAN_SOURCE.commit.slice(0, 12));
-}
-
-let pinsPromise: Promise<Map<string, FileDigest>> | undefined;
-
-/** The pin table, loaded on first use (it lists every file, so it stays out of startup). */
-async function pins(): Promise<Map<string, FileDigest>> {
- // A separate chunk: the table lists every file, so it stays out of startup.
- pinsPromise ??= import("./makehuman-pins.js").then(({ MAKEHUMAN_PINS }) => {
- if (MAKEHUMAN_PINS.commit !== MAKEHUMAN_SOURCE.commit)
- throw new Error(
- "makehuman-pins.ts is for another commit: rerun pin:makehuman",
- );
- return new Map(
- MAKEHUMAN_PINS.files.map(([path, size, sha256]) => [
- path,
- { size, sha256 },
- ]),
- );
- });
- return pinsPromise;
-}
-
-export interface HumanAssetStoreOptions {
- /** Cache directory. Default `humanCacheDir()`. */
- dir?: string;
- /** Mirror serving `<baseUrl>/<path>`. Default `$FRAMEFIELDS_HUMAN_BASE_URL`, else GitHub at the pinned commit. */
- baseUrl?: string;
- fetch?: typeof fetch;
- /** The pin table (path → size and SHA-256). Default: the pinned MakeHuman commit's. */
- pins?: ReadonlyMap<string, FileDigest>;
-}
-
-export class HumanAssetStore {
- readonly dir: string;
- private readonly baseUrl: string | undefined;
- private readonly fetchImpl: typeof fetch | undefined;
- private readonly table: ReadonlyMap<string, FileDigest> | undefined;
- private readonly memory = new Map<string, Promise<Uint8Array>>();
-
- constructor(options: HumanAssetStoreOptions = {}) {
- this.dir = options.dir ?? humanCacheDir();
- this.baseUrl = options.baseUrl ?? process.env.FRAMEFIELDS_HUMAN_BASE_URL;
- this.fetchImpl = options.fetch;
- this.table = options.pins;
- }
-
- private pinTable(): Promise<ReadonlyMap<string, FileDigest>> {
- return this.table ? Promise.resolve(this.table) : pins();
- }
-
- /** Every pinned path under a folder (e.g. "targets/nose/"). */
- async list(prefix: string): Promise<string[]> {
- return [...(await this.pinTable()).keys()].filter((p) =>
- p.startsWith(prefix),
- );
- }
-
- /** The file's bytes: from memory, the disk cache, or a verified download. */
- ensure(path: string): Promise<Uint8Array> {
- let p = this.memory.get(path);
- if (!p) {
- p = this.load(path);
- this.memory.set(path, p);
- p.catch(() => this.memory.delete(path));
- }
- return p;
- }
-
- async text(path: string): Promise<string> {
- return new TextDecoder().decode(await this.ensure(path));
- }
-
- private async load(path: string): Promise<Uint8Array> {
- const pin = (await this.pinTable()).get(path);
- if (!pin)
- throw new Error(`human assets: "${path}" is not a pinned MakeHuman file`);
- const dest = join(this.dir, path);
- const cached = await stat(dest).catch(() => null);
- // A file of the pinned size was verified when it was written (rename after the hash check).
- if (cached?.size !== pin.size) {
- const url = this.baseUrl
- ? `${this.baseUrl.replace(/\/+$/, "")}/${path}`
- : MAKEHUMAN_SOURCE.url(path);
- await downloadVerified(
- url,
- dest,
- pin,
- this.fetchImpl ? { fetch: this.fetchImpl } : {},
- );
- }
- return new Uint8Array(await readFile(dest));
- }
-}
diff --git a/packages/forge/src/index.ts b/packages/forge/src/index.ts
index fd78febd..45063a47 100644
--- a/packages/forge/src/index.ts
+++ b/packages/forge/src/index.ts
@@ -32,30 +32,6 @@ export {
type AccessorType,
GlbBuilder,
} from "./glb-builder.js";
-export {
- type AddedHuman,
- type AddHumanOptions,
- addHuman,
-} from "./human/add-human.js";
-export { FACE_SHAPES } from "./human/expressions.js";
-export {
- type HumanModel,
- type HumanOptions,
- type HumanPart,
- human,
-} from "./human/human.js";
-export {
- poreNormalMap,
- type SkinOptions,
- type SkinTextures,
- skinTextures,
-} from "./human/skin.js";
-export { MAKEHUMAN_SOURCE } from "./human/source.js";
-export {
- HumanAssetStore,
- type HumanAssetStoreOptions,
- humanCacheDir,
-} from "./human/store.js";
export { type HumanoidOptions, humanoidSkeleton } from "./humanoid.js";
export {
type MaterialSpec,
@@ -95,6 +71,10 @@ export {
type Joint,
type JointSpec,
type MirrorOptions,
+ type Quat,
+ quatConjugate,
+ quatMultiply,
+ quatRotate,
Skeleton,
type Vec3,
} from "./skeleton.js";
diff --git a/packages/forge/src/skeleton.ts b/packages/forge/src/skeleton.ts
index 69b0dc70..dc421585 100644
--- a/packages/forge/src/skeleton.ts
+++ b/packages/forge/src/skeleton.ts
@@ -2,18 +2,49 @@
* Skeletons for rigged characters: joints placed at their rest positions in
* model space (glTF: +y up, the character faces +z, its left side at +x),
* built bone by bone or from a proportioned preset, with left/right
- * mirroring. Joints rest unrotated, so a joint's local axes are the model's:
- * `pose: { LeftArm: { rotateZ: … } }` turns about the same axis on every
- * joint, and `aim` / retargeting find a bone's direction from its child.
+ * mirroring. Joints rest unrotated unless given an `orient`, so a joint's
+ * local axes are the model's: `pose: { LeftArm: { rotateZ: … } }` turns
+ * about the same axis on every joint, and `aim` / retargeting find a bone's
+ * direction from its child. Rigs authored elsewhere (DNA files) bring rest
+ * orientations, which the writer keeps.
*/
export type Vec3 = [number, number, number];
+/** A rotation as a unit quaternion x, y, z, w. */
+export type Quat = [number, number, number, number];
+
+const IDENTITY: Quat = [0, 0, 0, 1];
+
+/** Hamilton product a · b (b applied first). */
+export function quatMultiply(a: Quat, b: Quat): Quat {
+ return [
+ a[3] * b[0] + a[0] * b[3] + a[1] * b[2] - a[2] * b[1],
+ a[3] * b[1] - a[0] * b[2] + a[1] * b[3] + a[2] * b[0],
+ a[3] * b[2] + a[0] * b[1] - a[1] * b[0] + a[2] * b[3],
+ a[3] * b[3] - a[0] * b[0] - a[1] * b[1] - a[2] * b[2],
+ ];
+}
+
+export function quatConjugate(q: Quat): Quat {
+ return [-q[0], -q[1], -q[2], q[3]];
+}
+
+/** `v` turned by `q`. */
+export function quatRotate(q: Quat, v: Vec3): Vec3 {
+ const r = quatMultiply(
+ quatMultiply(q, [v[0], v[1], v[2], 0]),
+ quatConjugate(q),
+ );
+ return [r[0], r[1], r[2]];
+}
export interface JointSpec {
name: string;
/** Rest position in model space. */
at: Vec3;
parent?: string;
+ /** Rest orientation in model space. Default: unrotated. */
+ orient?: Quat;
/** Free data written to the joint's glTF node `extras`. */
extras?: Record<string, unknown>;
}
@@ -47,10 +78,13 @@ export class Skeleton {
);
if (!spec.at.every(Number.isFinite))
throw new Error(`skeleton: joint "${name}" has a non-finite position`);
+ if (spec.orient && !spec.orient.every(Number.isFinite))
+ throw new Error(`skeleton: joint "${name}" has a non-finite orientation`);
const joint: Joint = {
name,
at: [spec.at[0], spec.at[1], spec.at[2]],
...(spec.parent === undefined ? {} : { parent: spec.parent }),
+ ...(spec.orient ? { orient: normalized(spec.orient) } : {}),
...(spec.extras ? { extras: spec.extras } : {}),
index: this.list.length,
};
@@ -101,9 +135,14 @@ export class Skeleton {
: j.parent.includes(from)
? rename(j.parent)
: j.parent;
+ // Reflected across the axis: keep that component, negate the others.
+ const orient = j.orient?.map((c, k) =>
+ k === axis || k === 3 ? c : -c,
+ ) as Quat | undefined;
this.add(rename(j.name), {
at,
...(parent === undefined ? {} : { parent }),
+ ...(orient ? { orient } : {}),
...(j.extras ? { extras: j.extras } : {}),
});
}
@@ -129,12 +168,31 @@ export class Skeleton {
return this.list.filter((j) => j.parent === name);
}
- /** The rest position relative to the parent (the glTF node translation). */
+ /** The rest position in the parent's frame (the glTF node translation). */
local(name: string): Vec3 {
const j = this.joint(name);
if (j.parent === undefined) return [...j.at];
- const p = this.joint(j.parent).at;
- return [j.at[0] - p[0], j.at[1] - p[1], j.at[2] - p[2]];
+ const p = this.joint(j.parent);
+ const d: Vec3 = [j.at[0] - p.at[0], j.at[1] - p.at[1], j.at[2] - p.at[2]];
+ return p.orient ? quatRotate(quatConjugate(p.orient), d) : d;
+ }
+
+ /** The rest orientation in model space. */
+ orientation(name: string): Quat {
+ return this.joint(name).orient ?? IDENTITY;
+ }
+
+ /** The rest orientation in the parent's frame (the glTF node rotation). */
+ localRotation(name: string): Quat {
+ const j = this.joint(name);
+ const own = j.orient ?? IDENTITY;
+ if (j.parent === undefined) return own;
+ return quatMultiply(quatConjugate(this.orientation(j.parent)), own);
+ }
+
+ /** Whether any joint rests rotated. */
+ get oriented(): boolean {
+ return this.list.some((j) => j.orient !== undefined);
}
/** Distance from a joint to its parent. */
@@ -153,3 +211,9 @@ export class Skeleton {
return this;
}
}
+
+function normalized(q: Quat): Quat {
+ const l = Math.hypot(q[0], q[1], q[2], q[3]);
+ if (!(l > 0)) throw new Error("skeleton: zero quaternion");
+ return [q[0] / l, q[1] / l, q[2] / l, q[3] / l];
+}
diff --git a/packages/framefields/NOTICE.md b/packages/framefields/NOTICE.md
index bfaa9be3..ac249ee7 100644
--- a/packages/framefields/NOTICE.md
+++ b/packages/framefields/NOTICE.md
@@ -17,6 +17,30 @@ Before SAM 3 weights are downloaded or run, you must accept Meta's SAM License (
`comp.vision(clip, { depth: true })` and `withVision({ mode: "depth" })` estimate depth with Depth Anything V2 **Small** (onnx-community export of `depth-anything/Depth-Anything-V2-Small`), whose weights are Apache-2.0. The larger Depth Anything V2 checkpoints are licensed CC-BY-NC-4.0 and are not used.
-## Human base (`framefields/forge`)
+## DNA characters (`framefields/dna`)
-`human()` shapes bodies from MakeHuman's base mesh, shape targets, skeleton and skin weights (https://github.com/makehumancommunity/makehuman, pinned to commit `a8bc2d54ff0ac92e78ff71431b1023eda42bf482`). MakeHuman's bundled assets are released under CC0 1.0 Universal; its program code is AGPL-3.0 and is not used or distributed. The files download on first use into `~/.cache/framefields/makehuman` and are verified by size and SHA-256 (`packages/forge/src/human/makehuman-pins.ts`). Bodies made from them carry no license restriction.
+The DNA file reader and the conversion of DNA rigs (`packages/dna`) are a TypeScript port based on OpenRigLogic's DNA library (https://github.com/EpicGames/openriglogic, branch `5.8`), used under the MIT License below. "Epic Games", "MetaHuman", "RigLogic" and "OpenRigLogic" are trademarks of Epic Games, Inc.; framefields is not affiliated with or endorsed by Epic Games. No DNA files or characters ship with framefields: you load your own, under the terms they came with.
+
+```
+MIT License
+
+Copyright (c) 2026 Epic Games, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+```
diff --git a/packages/framefields/package.json b/packages/framefields/package.json
index b61d3a5d..9099f8ff 100644
--- a/packages/framefields/package.json
+++ b/packages/framefields/package.json
@@ -99,6 +99,12 @@
"import": "./dist/forge/index.mjs",
"default": "./dist/forge/index.mjs"
},
+ "./dna": {
+ "types": "./dist/dna/index.d.mts",
+ "development": "./src/dna/index.ts",
+ "import": "./dist/dna/index.mjs",
+ "default": "./dist/dna/index.mjs"
+ },
"./sam": {
"types": "./dist/sam/index.d.mts",
"development": "./src/sam/index.ts",
@@ -204,6 +210,7 @@
"@framefields/node-vision": "workspace:*",
"@framefields/renderer": "workspace:*",
"@framefields/renderers": "workspace:*",
+ "@framefields/dna": "workspace:*",
"@framefields/forge": "workspace:*",
"@framefields/storage": "workspace:*",
"@framefields/tensor-webgpu": "workspace:*",
diff --git a/packages/framefields/src/dna/index.ts b/packages/framefields/src/dna/index.ts
new file mode 100644
index 00000000..292ec48d
--- /dev/null
+++ b/packages/framefields/src/dna/index.ts
@@ -0,0 +1,6 @@
+/**
+ * `framefields/dna`: characters from DNA files (the rig format MetaHuman
+ * characters export to), read and written as GLB files for `Layer.glb`.
+ * Based on OpenRigLogic's DNA library (MIT, Epic Games); see NOTICE.md.
+ */
+export * from "@framefields/dna";
diff --git a/packages/framefields/src/skin-eight-render.test.ts b/packages/framefields/src/skin-eight-render.test.ts
new file mode 100644
index 00000000..23017894
--- /dev/null
+++ b/packages/framefields/src/skin-eight-render.test.ts
@@ -0,0 +1,104 @@
+/**
+ * Skins with eight influences per vertex (glTF JOINTS_1 / WEIGHTS_1): a
+ * quad whose vertices give 60% of their weight to a joint that appears only
+ * in the second set follows that joint. Before the second set was read, the
+ * quad ignored it.
+ */
+import fs from "node:fs/promises";
+import os from "node:os";
+import path from "node:path";
+import { afterAll, beforeAll, describe, expect, it } from "vitest";
+import { GltfDocument, Skeleton } from "./forge/index.js";
+import { Composition, Layer, type LayoutNode } from "./index.js";
+import { decodePngPixels } from "./test-utils/pixels.js";
+
+const SIZE = 320;
+const C = SIZE / 2;
+
+let dir = "";
+let file = "";
+
+beforeAll(async () => {
+ dir = await fs.mkdtemp(path.join(os.tmpdir(), "framefields-skin8-"));
+ file = path.join(dir, "quad.glb");
+ const skeleton = new Skeleton().add("Root", { at: [0, 0, 0] });
+ for (const n of ["A", "B", "C", "D", "Mover"])
+ skeleton.add(n, { at: [0, 0, 0], parent: "Root" });
+ const doc = new GltfDocument();
+ const rig = doc.addSkeleton(skeleton);
+ const white = doc.addMaterial({ color: "#ffffff", unlit: true });
+ const h = 40;
+ // Per vertex: 10% each on Root, A, B, C (set 0), 60% on Mover (set 1).
+ const joints = new Array(4).fill([0, 1, 2, 3, 5, 0, 0, 0]).flat();
+ const weights = new Array(4).fill([0.1, 0.1, 0.1, 0.1, 0.6, 0, 0, 0]).flat();
+ doc.addNode({
+ mesh: doc.addMesh({
+ primitives: [
+ {
+ positions: [-h, -h, 0, h, -h, 0, h, h, 0, -h, h, 0],
+ normals: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1],
+ indices: [0, 1, 2, 0, 2, 3],
+ joints,
+ weights,
+ material: white,
+ },
+ ],
+ }),
+ skin: rig.skin,
+ });
+ await fs.writeFile(file, doc.toGlb());
+});
+afterAll(async () => {
+ await fs.rm(dir, { recursive: true, force: true });
+});
+
+/** The x center of the lit pixels. */
+async function centerX(options: Record<string, unknown>) {
+ const comp = new Composition({
+ width: SIZE,
+ height: SIZE,
+ fps: 30,
+ durationFrames: 1,
+ backgroundColor: "#000000",
+ });
+ comp.add([
+ Layer.camera({
+ x: C,
+ y: C,
+ z: -C / Math.tan((25 * Math.PI) / 180),
+ targetX: C,
+ targetY: C,
+ targetZ: 0,
+ }),
+ Layer.glb(file, {
+ x: C,
+ y: C,
+ z: 0,
+ rotateX: 180,
+ ...options,
+ }) as LayoutNode,
+ ]);
+ const { pixels } = await decodePngPixels(
+ await comp.renderFrame({ frame: 0 }),
+ );
+ let sum = 0;
+ let n = 0;
+ for (let y = 0; y < SIZE; y++)
+ for (let x = 0; x < SIZE; x++)
+ if ((pixels[(y * SIZE + x) * 4] ?? 0) > 128) {
+ sum += x;
+ n++;
+ }
+ return sum / n;
+}
+
+describe("eight skin influences", () => {
+ it("moves a vertex by its second influence set", async () => {
+ const still = await centerX({});
+ const moved = await centerX({ pose: { Mover: { x: 50 } } });
+ expect(Math.abs(still - C)).toBeLessThan(2);
+ // 60% of a 50-unit move.
+ expect(moved - still).toBeGreaterThan(24);
+ expect(moved - still).toBeLessThan(36);
+ });
+});
diff --git a/packages/framefields/tsdown.config.ts b/packages/framefields/tsdown.config.ts
index 80c81daf..738a3902 100644
--- a/packages/framefields/tsdown.config.ts
+++ b/packages/framefields/tsdown.config.ts
@@ -18,6 +18,7 @@ export default defineConfig({
"src/cloud/index.ts",
"src/storage/index.ts",
"src/forge/index.ts",
+ "src/dna/index.ts",
"src/cli.ts",
"src/cli/check-worker.ts",
"src/cli/local-worker.ts",
diff --git a/packages/webgpu-renderers/src/loaders/gltf-loader.ts b/packages/webgpu-renderers/src/loaders/gltf-loader.ts
index efd23a25..9048ecb9 100644
--- a/packages/webgpu-renderers/src/loaders/gltf-loader.ts
+++ b/packages/webgpu-renderers/src/loaders/gltf-loader.ts
@@ -13,6 +13,7 @@ import type {
MaterialSurface,
Model3DData,
ModelNode3D,
+ MorphTarget3D,
NodeAnimationTrack3D,
TextureSampling,
} from "./types.js";
@@ -122,6 +123,8 @@ interface GltfPrimitive {
COLOR_0?: number;
JOINTS_0?: number;
WEIGHTS_0?: number;
+ JOINTS_1?: number;
+ WEIGHTS_1?: number;
};
indices?: number;
material?: number;
@@ -757,49 +760,137 @@ export class GltfLoader {
}
}
if (accessor.sparse) {
- const sparse = accessor.sparse;
- const indexView = doc.bufferViews?.[sparse.indices.bufferView];
- const valueView = doc.bufferViews?.[sparse.values.bufferView];
- if (!indexView || !valueView)
+ const sparse = GltfLoader.readSparse(doc, binaryBuffers, accessorIndex);
+ for (let i = 0; i < sparse.indices.length; i++)
+ for (let c = 0; c < itemSize; c++)
+ out[(sparse.indices[i] as number) * itemSize + c] = sparse.values[
+ i * itemSize + c
+ ] as number;
+ }
+ return { data: out, itemSize, count: accessor.count };
+ }
+
+ /** A sparse accessor's indices and their values (`itemSize` per index). */
+ private static readSparse(
+ doc: GltfDocument,
+ binaryBuffers: Uint8Array[],
+ accessorIndex: number,
+ ): { indices: Uint32Array; values: Float32Array } {
+ const accessor = doc.accessors?.[accessorIndex];
+ const sparse = accessor?.sparse;
+ if (!accessor || !sparse)
+ throw new Error(`Accessor ${accessorIndex} is not sparse`);
+ const itemSize = COMPONENTS[accessor.type] ?? 1;
+ const indexView = doc.bufferViews?.[sparse.indices.bufferView];
+ const valueView = doc.bufferViews?.[sparse.values.bufferView];
+ if (!indexView || !valueView)
+ throw new Error(
+ `Sparse accessor ${accessorIndex} references a missing buffer view`,
+ );
+ const indexData = binaryBuffers[indexView.buffer];
+ const valueData = binaryBuffers[valueView.buffer];
+ if (!indexData || !valueData)
+ throw new Error(
+ `Sparse accessor ${accessorIndex} references a missing buffer`,
+ );
+ const indexReader = componentReader(sparse.indices.componentType);
+ const indexBytes = COMPONENT_BYTES[sparse.indices.componentType] ?? 4;
+ const read = componentReader(accessor.componentType, accessor.normalized);
+ const bytes = COMPONENT_BYTES[accessor.componentType] ?? 4;
+ const indexDv = new DataView(
+ indexData.buffer,
+ indexData.byteOffset,
+ indexData.byteLength,
+ );
+ const valueDv = new DataView(
+ valueData.buffer,
+ valueData.byteOffset,
+ valueData.byteLength,
+ );
+ const indexBase =
+ (indexView.byteOffset ?? 0) + (sparse.indices.byteOffset ?? 0);
+ const valueBase =
+ (valueView.byteOffset ?? 0) + (sparse.values.byteOffset ?? 0);
+ const indices = new Uint32Array(sparse.count);
+ const values = new Float32Array(sparse.count * itemSize);
+ for (let i = 0; i < sparse.count; i++) {
+ const index = indexReader(indexDv, indexBase + i * indexBytes);
+ if (index >= accessor.count)
throw new Error(
- `Sparse accessor ${accessorIndex} references a missing buffer view`,
+ `Sparse accessor ${accessorIndex} index ${index} is out of range`,
);
- const indexData = binaryBuffers[indexView.buffer];
- const valueData = binaryBuffers[valueView.buffer];
- if (!indexData || !valueData)
- throw new Error(
- `Sparse accessor ${accessorIndex} references a missing buffer`,
+ indices[i] = index;
+ for (let c = 0; c < itemSize; c++)
+ values[i * itemSize + c] = read(
+ valueDv,
+ valueBase + (i * itemSize + c) * bytes,
);
- const indexReader = componentReader(sparse.indices.componentType);
- const indexBytes = COMPONENT_BYTES[sparse.indices.componentType];
- const indexDv = new DataView(
- indexData.buffer,
- indexData.byteOffset,
- indexData.byteLength,
- );
- const valueDv = new DataView(
- valueData.buffer,
- valueData.byteOffset,
- valueData.byteLength,
- );
- const indexBase =
- (indexView.byteOffset ?? 0) + (sparse.indices.byteOffset ?? 0);
- const valueBase =
- (valueView.byteOffset ?? 0) + (sparse.values.byteOffset ?? 0);
- for (let i = 0; i < sparse.count; i++) {
- const index = indexReader(indexDv, indexBase + i * indexBytes);
- if (index >= accessor.count)
- throw new Error(
- `Sparse accessor ${accessorIndex} index ${index} is out of range`,
- );
- for (let c = 0; c < itemSize; c++)
- out[index * itemSize + c] = read(
- valueDv,
- valueBase + (i * itemSize + c) * bytes,
- );
- }
}
- return { data: out, itemSize, count: accessor.count };
+ return { indices, values };
+ }
+
+ /**
+ * A morph target, kept sparse when its accessors are sparse over zeros
+ * (only the moved vertices, `indices`): a face with hundreds of
+ * corrective shapes stays small. Otherwise dense.
+ */
+ private static readMorphTarget(
+ doc: GltfDocument,
+ binaryBuffers: Uint8Array[],
+ target: Record<string, number | undefined>,
+ numVerts: number,
+ label: string,
+ ): MorphTarget3D {
+ const sparseOnly = (acc: number | undefined) => {
+ const a = acc === undefined ? undefined : doc.accessors?.[acc];
+ return !a || (a.sparse !== undefined && a.bufferView === undefined);
+ };
+ const check = (acc: number | undefined) => {
+ const a = acc === undefined ? undefined : doc.accessors?.[acc];
+ if (a && (a.count !== numVerts || (COMPONENTS[a.type] ?? 1) !== 3))
+ throw new Error(`Invalid morph target on ${label}`);
+ };
+ check(target.POSITION);
+ check(target.NORMAL);
+ if (!sparseOnly(target.POSITION) || !sparseOnly(target.NORMAL)) {
+ const read = (acc: number | undefined) =>
+ acc === undefined
+ ? undefined
+ : GltfLoader.readFloats(doc, binaryBuffers, acc).data;
+ return {
+ positions: read(target.POSITION),
+ normals: read(target.NORMAL),
+ };
+ }
+ const parts = [target.POSITION, target.NORMAL].map((acc) =>
+ acc === undefined
+ ? undefined
+ : GltfLoader.readSparse(doc, binaryBuffers, acc),
+ );
+ // One index list for both: the union, in order.
+ const union = new Set<number>();
+ for (const p of parts) if (p) for (const i of p.indices) union.add(i);
+ const indices = Uint32Array.from([...union].sort((x, y) => x - y));
+ const slot = new Map<number, number>();
+ indices.forEach((v, i) => {
+ slot.set(v, i);
+ });
+ const gather = (p: (typeof parts)[number]) => {
+ if (!p) return undefined;
+ const out = new Float32Array(indices.length * 3);
+ p.indices.forEach((v, i) => {
+ out.set(
+ p.values.subarray(i * 3, i * 3 + 3),
+ (slot.get(v) as number) * 3,
+ );
+ });
+ return out;
+ };
+ return {
+ indices,
+ positions: gather(parts[0]),
+ normals: gather(parts[1]),
+ };
}
private static readIndices(
@@ -1270,20 +1361,15 @@ export class GltfLoader {
} else grow(x, y, z);
}
- const morphTargets = prim.targets?.map((target) => {
- const positions = read(target.POSITION);
- const normals = read(target.NORMAL);
- if (
- (positions &&
- (positions.count !== numVerts || positions.itemSize !== 3)) ||
- (normals && (normals.count !== numVerts || normals.itemSize !== 3))
- ) {
- throw new Error(
- `Invalid morph target on glTF mesh ${inst.mesh} primitive ${primIdx}`,
- );
- }
- return { positions: positions?.data, normals: normals?.data };
- });
+ const morphTargets = prim.targets?.map((target) =>
+ GltfLoader.readMorphTarget(
+ doc,
+ binaryBuffers,
+ target,
+ numVerts,
+ `glTF mesh ${inst.mesh} primitive ${primIdx}`,
+ ),
+ );
const defaultWeights =
(inst.node === undefined
? undefined
@@ -1313,6 +1399,12 @@ export class GltfLoader {
jointWeights: skinned
? read(prim.attributes.WEIGHTS_0)?.data
: undefined,
+ ...(skinned &&
+ prim.attributes.JOINTS_1 !== undefined &&
+ prim.attributes.WEIGHTS_1 !== undefined && {
+ jointIndices1: read(prim.attributes.JOINTS_1)?.data,
+ jointWeights1: read(prim.attributes.WEIGHTS_1)?.data,
+ }),
indices,
topology: primitive.topology,
materialName:
diff --git a/packages/webgpu-renderers/src/loaders/types.ts b/packages/webgpu-renderers/src/loaders/types.ts
index 01da45db..0dd0ed36 100644
--- a/packages/webgpu-renderers/src/loaders/types.ts
+++ b/packages/webgpu-renderers/src/loaders/types.ts
@@ -1,5 +1,32 @@
import type { Mat4, Vec3 } from "../math3d/index.js";
+/**
+ * One morph target's deltas. Dense: 3 floats per vertex. Sparse (with
+ * `indices`): 3 floats per listed vertex, every other vertex unmoved.
+ */
+export interface MorphTarget3D {
+ positions?: Float32Array;
+ normals?: Float32Array;
+ /** The moved vertices, ascending; absent for dense deltas. */
+ indices?: Uint32Array;
+}
+
+/** A morph target's position (or normal) deltas as a dense array. */
+export function denseMorphDeltas(
+ target: MorphTarget3D,
+ vertexCount: number,
+ kind: "positions" | "normals" = "positions",
+): Float32Array {
+ const data = target[kind];
+ if (!target.indices) return data ?? new Float32Array(vertexCount * 3);
+ const out = new Float32Array(vertexCount * 3);
+ if (data)
+ target.indices.forEach((v, i) => {
+ out.set(data.subarray(i * 3, i * 3 + 3), v * 3);
+ });
+ return out;
+}
+
export interface Mesh3DData {
id?: string;
name?: string;
@@ -7,7 +34,7 @@ export interface Mesh3DData {
normals: Float32Array; // 3 floats per vertex (nx, ny, nz)
uvs: Float32Array; // 2 floats per vertex (u, v), for the base color map
/** Object-space morph deltas, applied before skinning. */
- morphTargets?: { positions?: Float32Array; normals?: Float32Array }[];
+ morphTargets?: MorphTarget3D[];
/** Default morph weights for this mesh instance. */
morphWeights?: number[];
/** Morph target names (glTF mesh `extras.targetNames`), one per target. */
@@ -27,6 +54,9 @@ export interface Mesh3DData {
// Skinned Mesh / Skeletal Animation attributes
jointIndices?: Float32Array; // 4 bone indices per vertex
jointWeights?: Float32Array; // 4 normalized weights per vertex (sum = 1.0)
+ /** A second set of 4 influences per vertex (glTF JOINTS_1 / WEIGHTS_1): up to 8 in all, the weights of both sets summing to 1. */
+ jointIndices1?: Float32Array;
+ jointWeights1?: Float32Array;
materialName?: string;
/** Scene node that places this mesh (Model3DData.nodes); its world matrix applies unless the mesh is skinned. */
node?: number;
diff --git a/packages/webgpu-renderers/src/renderer3d/mesh3d-pipeline.ts b/packages/webgpu-renderers/src/renderer3d/mesh3d-pipeline.ts
index 718ba7ae..da1c7c1a 100644
--- a/packages/webgpu-renderers/src/renderer3d/mesh3d-pipeline.ts
+++ b/packages/webgpu-renderers/src/renderer3d/mesh3d-pipeline.ts
@@ -94,6 +94,8 @@ export interface MeshUniformData extends SurfaceParams {
transparent?: boolean;
/** Extra per-map UV vertex attributes are present. */
hasMapUvs?: boolean;
+ /** The mesh binds a second set of four skin influences. */
+ hasSkin1?: boolean;
isSkinned?: boolean;
skinningMatrices?: Float32Array; // 16 floats per joint
/** Hardware-instanced draw path. */
@@ -158,6 +160,8 @@ export interface GPUMeshBuffers {
/** Per-vertex RGBA (display / sRGB), 4 floats each; absent = white. */
colorBuffer?: GPUBuffer;
mapUvBuffer?: GPUBuffer;
+ /** Second skin influence set: 4 joints then 4 weights per vertex. */
+ skin1Buffer?: GPUBuffer;
wireIndexBuffer?: GPUBuffer;
wireIndexCount?: number;
}
@@ -361,6 +365,14 @@ export class Mesh3DPipeline {
{ shaderLocation: 9, offset: 24, format: "float32x2" },
],
},
+ {
+ // Second skin influence set (read only when flagged).
+ arrayStride: 32,
+ attributes: [
+ { shaderLocation: 10, offset: 0, format: "float32x4" },
+ { shaderLocation: 11, offset: 16, format: "float32x4" },
+ ],
+ },
],
};
@@ -562,12 +574,13 @@ export class Mesh3DPipeline {
this.modelData[36] = data.opacity ?? 1.0;
this.modelData[37] = data.twoSided ? 1.0 : 0.0;
this.modelData[38] = data.isSkinned || data.crowd ? 1.0 : 0.0;
- // Bit 0 selects instance data; bit 1 selects the extra map UVs.
+ // Bit 0 selects instance data; bit 1 the extra map UVs; bit 4 the second skin set.
this.modelData[39] =
(data.isInstanced || data.instanceBuffer ? 1 : 0) +
(data.hasMapUvs ? 2 : 0) +
(data.matrixInstances ? 4 : 0) +
- (data.crowd ? 8 : 0);
+ (data.crowd ? 8 : 0) +
+ (data.hasSkin1 ? 16 : 0);
const shininess =
data.roughness !== undefined
@@ -674,6 +687,7 @@ export class Mesh3DPipeline {
const modelBindGroup = this.packModel({
...data,
hasMapUvs: Boolean(meshBuffers.mapUvBuffer),
+ hasSkin1: Boolean(meshBuffers.skin1Buffer),
});
const textureBindGroup = this.textureGroup(texture, sampler, data.maps);
@@ -743,8 +757,9 @@ export class Mesh3DPipeline {
firstInstance = 0,
): void {
const hasMapUvs = Boolean(meshBuffers.mapUvBuffer);
- const now = this.packModel({ ...data, hasMapUvs });
- const before = this.packModel({ ...data, ...prev, hasMapUvs });
+ const hasSkin1 = Boolean(meshBuffers.skin1Buffer);
+ const now = this.packModel({ ...data, hasMapUvs, hasSkin1 });
+ const before = this.packModel({ ...data, ...prev, hasMapUvs, hasSkin1 });
const wireframe =
data.wireframe === true &&
(!meshBuffers.topology || meshBuffers.topology === "triangle-list");
@@ -854,6 +869,11 @@ export class Mesh3DPipeline {
2,
meshBuffers.mapUvBuffer ?? meshBuffers.vertexBuffer,
);
+ // Without a second skin set the slot reads the vertex buffer, unflagged.
+ pass.setVertexBuffer(
+ 3,
+ meshBuffers.skin1Buffer ?? meshBuffers.vertexBuffer,
+ );
const wire = wireframe && meshBuffers.wireIndexBuffer;
pass.setIndexBuffer(
wire || meshBuffers.indexBuffer,
diff --git a/packages/webgpu-renderers/src/renderer3d/morph-entries.test.ts b/packages/webgpu-renderers/src/renderer3d/morph-entries.test.ts
new file mode 100644
index 00000000..37e08b50
--- /dev/null
+++ b/packages/webgpu-renderers/src/renderer3d/morph-entries.test.ts
@@ -0,0 +1,48 @@
+/**
+ * Morph targets regroup by vertex the same way whether they arrive dense or
+ * sparse: only moved vertices get entries, in target order.
+ */
+import { describe, expect, it } from "vitest";
+import { denseMorphDeltas, type Mesh3DData } from "../loaders/types.js";
+import { morphEntries } from "./morph-pipeline.js";
+
+const mesh = (morphTargets: Mesh3DData["morphTargets"]): Mesh3DData => ({
+ positions: new Float32Array(4 * 3),
+ normals: new Float32Array(4 * 3),
+ uvs: new Float32Array(4 * 2),
+ indices: new Uint16Array([0, 1, 2]),
+ morphTargets,
+});
+
+describe("morphEntries", () => {
+ const lift = new Float32Array([0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0]);
+ const push = new Float32Array([0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ const sparseLift = {
+ indices: Uint32Array.from([1, 3]),
+ positions: Float32Array.from([0, 1, 0, 0, 2, 0]),
+ };
+
+ it("gives each moved vertex its entries, and none to the rest", () => {
+ const { rows, entries } = morphEntries(
+ mesh([{ positions: lift }, { positions: push }]),
+ );
+ expect(Array.from(rows)).toEqual([0, 1, 2, 2, 3]);
+ const bits = new Uint32Array(entries.buffer);
+ // Vertex 0: target 1 pushes it 3 along z.
+ expect([bits[0], entries[3]]).toEqual([1, 3]);
+ // Vertex 3: target 0 lifts it 2.
+ expect([bits[16], entries[18]]).toEqual([0, 2]);
+ });
+
+ it("reads sparse targets to the same entries as dense ones", () => {
+ const dense = morphEntries(
+ mesh([{ positions: lift }, { positions: push }]),
+ );
+ const sparse = morphEntries(mesh([sparseLift, { positions: push }]));
+ expect(Array.from(sparse.rows)).toEqual(Array.from(dense.rows));
+ expect(Array.from(sparse.entries)).toEqual(Array.from(dense.entries));
+ expect(Array.from(denseMorphDeltas(sparseLift, 4))).toEqual(
+ Array.from(lift),
+ );
+ });
+});
diff --git a/packages/webgpu-renderers/src/renderer3d/morph-pipeline.ts b/packages/webgpu-renderers/src/renderer3d/morph-pipeline.ts
index 7a41a34d..aad5b352 100644
--- a/packages/webgpu-renderers/src/renderer3d/morph-pipeline.ts
+++ b/packages/webgpu-renderers/src/renderer3d/morph-pipeline.ts
@@ -1,13 +1,21 @@
import type { Mesh3DData } from "../loaders/types.js";
import { BufferPool } from "../renderer2d/buffer-pool.js";
+/**
+ * Morph deltas are stored per vertex: `rows[v] … rows[v + 1]` are the
+ * entries that move vertex v, each eight floats (target index as bits,
+ * position delta, normal delta, padding). A vertex adds the weighted
+ * deltas of its own entries: memory follows the deltas that exist (a face
+ * with hundreds of sparse correctives stays small) and no atomics are needed.
+ */
const morphWgsl = `
struct Counts { vertices: u32, targets: u32, pad0: u32, pad1: u32 };
@group(0) @binding(0) var<storage, read> source: array<f32>;
-@group(0) @binding(1) var<storage, read> deltas: array<f32>;
+@group(0) @binding(1) var<storage, read> entries: array<f32>;
@group(0) @binding(2) var<storage, read> weights: array<f32>;
@group(0) @binding(3) var<uniform> counts: Counts;
@group(0) @binding(4) var<storage, read_write> dest: array<f32>;
+@group(0) @binding(5) var<storage, read> rows: array<u32>;
@compute @workgroup_size(128)
fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
let vertex = gid.x;
@@ -16,11 +24,12 @@ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
for (var c = 0u; c < 16u; c++) { dest[v + c] = source[v + c]; }
var position = vec3<f32>(source[v], source[v + 1u], source[v + 2u]);
var normal = vec3<f32>(source[v + 5u], source[v + 6u], source[v + 7u]);
- for (var t = 0u; t < counts.targets; t++) {
- let d = (t * counts.vertices + vertex) * 6u;
- let w = weights[t];
- position += vec3<f32>(deltas[d], deltas[d + 1u], deltas[d + 2u]) * w;
- normal += vec3<f32>(deltas[d + 3u], deltas[d + 4u], deltas[d + 5u]) * w;
+ for (var e = rows[vertex]; e < rows[vertex + 1u]; e++) {
+ let o = e * 8u;
+ let w = weights[bitcast<u32>(entries[o])];
+ if (w == 0.0) { continue; }
+ position += vec3<f32>(entries[o + 1u], entries[o + 2u], entries[o + 3u]) * w;
+ normal += vec3<f32>(entries[o + 4u], entries[o + 5u], entries[o + 6u]) * w;
}
dest[v] = position.x; dest[v + 1u] = position.y; dest[v + 2u] = position.z;
dest[v + 5u] = normal.x; dest[v + 6u] = normal.y; dest[v + 7u] = normal.z;
@@ -38,7 +47,7 @@ export class MorphPipeline {
16,
GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
);
- private targets = new WeakMap<Mesh3DData, GPUBuffer>();
+ private targets = new WeakMap<Mesh3DData, MorphBuffers>();
private outputs: GPUBuffer[] = [];
private outputIndex = 0;
@@ -70,6 +79,11 @@ export class MorphPipeline {
visibility: GPUShaderStage.COMPUTE,
buffer: { type: "storage" },
},
+ {
+ binding: 5,
+ visibility: GPUShaderStage.COMPUTE,
+ buffer: { type: "read-only-storage" },
+ },
],
});
this.pipeline = device.createComputePipeline({
@@ -82,31 +96,30 @@ export class MorphPipeline {
});
}
- private targetBuffer(mesh: Mesh3DData): GPUBuffer {
+ /** The mesh's morph entries per vertex, uploaded once. */
+ private targetBuffers(mesh: Mesh3DData): MorphBuffers {
const existing = this.targets.get(mesh);
if (existing) return existing;
- const targets = mesh.morphTargets ?? [];
- const count = mesh.positions.length / 3;
- const data = new Float32Array(count * targets.length * 6);
- for (let t = 0; t < targets.length; t++) {
- const target = targets[t];
- for (let v = 0; v < count; v++) {
- for (let k = 0; k < 3; k++) {
- data[(t * count + v) * 6 + k] = target.positions?.[v * 3 + k] ?? 0;
- data[(t * count + v) * 6 + 3 + k] = target.normals?.[v * 3 + k] ?? 0;
- }
- }
- }
- const buffer = this.device.createBuffer({
- label: "MeshMorphTargets",
- size: Math.max(4, data.byteLength),
- usage: GPUBufferUsage.STORAGE,
- mappedAtCreation: true,
- });
- new Float32Array(buffer.getMappedRange()).set(data);
- buffer.unmap();
- this.targets.set(mesh, buffer);
- return buffer;
+ const { rows, entries } = morphEntries(mesh);
+ const upload = (label: string, data: Uint32Array | Float32Array) => {
+ const buffer = this.device.createBuffer({
+ label,
+ size: Math.max(32, data.byteLength),
+ usage: GPUBufferUsage.STORAGE,
+ mappedAtCreation: true,
+ });
+ const range = buffer.getMappedRange();
+ if (data instanceof Uint32Array) new Uint32Array(range).set(data);
+ else new Float32Array(range).set(data);
+ buffer.unmap();
+ return buffer;
+ };
+ const buffers = {
+ rows: upload("MeshMorphRows", rows),
+ entries: upload("MeshMorphEntries", entries),
+ };
+ this.targets.set(mesh, buffers);
+ return buffers;
}
execute(
@@ -134,11 +147,12 @@ export class MorphPipeline {
this.outputIndex++;
const weightData = new Float32Array(Math.max(4, targetCount));
for (let i = 0; i < targetCount; i++) weightData[i] = weights[i] ?? 0;
+ const buffers = this.targetBuffers(mesh);
const bind = this.device.createBindGroup({
layout: this.layout,
entries: [
{ binding: 0, resource: { buffer: source } },
- { binding: 1, resource: { buffer: this.targetBuffer(mesh) } },
+ { binding: 1, resource: { buffer: buffers.entries } },
{
binding: 2,
resource: { buffer: this.weights.getBuffer(this.device, weightData) },
@@ -153,6 +167,7 @@ export class MorphPipeline {
},
},
{ binding: 4, resource: { buffer: output } },
+ { binding: 5, resource: { buffer: buffers.rows } },
],
});
const pass = encoder.beginComputePass({ label: "MeshMorphPass" });
@@ -174,3 +189,55 @@ export class MorphPipeline {
for (const output of this.outputs) output.destroy();
}
}
+
+interface MorphBuffers {
+ rows: GPUBuffer;
+ entries: GPUBuffer;
+}
+
+/**
+ * The mesh's morph targets regrouped by vertex: `rows` (vertex count + 1
+ * offsets) and `entries` (eight floats each: target index as bits,
+ * position delta, normal delta, padding). Unmoved vertices have none.
+ */
+export function morphEntries(mesh: Mesh3DData): {
+ rows: Uint32Array;
+ entries: Float32Array;
+} {
+ const targets = mesh.morphTargets ?? [];
+ const n = mesh.positions.length / 3;
+ // Each target's moved vertices and where their deltas sit.
+ const each = (fn: (t: number, v: number, at: number) => void) => {
+ targets.forEach((target, t) => {
+ const moved = (at: number) =>
+ [target.positions, target.normals].some(
+ (d) => d && (d[at * 3] || d[at * 3 + 1] || d[at * 3 + 2]),
+ );
+ if (target.indices)
+ target.indices.forEach((v, i) => {
+ if (v < n && moved(i)) fn(t, v, i);
+ });
+ else for (let v = 0; v < n; v++) if (moved(v)) fn(t, v, v);
+ });
+ };
+ const rows = new Uint32Array(n + 1);
+ each((_, v) => {
+ rows[v + 1] = (rows[v + 1] as number) + 1;
+ });
+ for (let v = 0; v < n; v++)
+ rows[v + 1] = (rows[v + 1] as number) + (rows[v] as number);
+ const entries = new Float32Array((rows[n] as number) * 8);
+ const bits = new Uint32Array(entries.buffer);
+ const fill = rows.slice(0, n);
+ each((t, v, at) => {
+ const e = (fill[v] as number) * 8;
+ fill[v] = (fill[v] as number) + 1;
+ bits[e] = t;
+ const target = targets[t];
+ for (let k = 0; k < 3; k++) {
+ entries[e + 1 + k] = target?.positions?.[at * 3 + k] ?? 0;
+ entries[e + 4 + k] = target?.normals?.[at * 3 + k] ?? 0;
+ }
+ });
+ return { rows, entries };
+}
diff --git a/packages/webgpu-renderers/src/renderer3d/renderer3d.ts b/packages/webgpu-renderers/src/renderer3d/renderer3d.ts
index 74f581fe..dab76950 100644
--- a/packages/webgpu-renderers/src/renderer3d/renderer3d.ts
+++ b/packages/webgpu-renderers/src/renderer3d/renderer3d.ts
@@ -1956,6 +1956,25 @@ export class Renderer3D {
mapUvBuffer.unmap();
}
+ // The second set of four influences, where a mesh has one.
+ let skin1Buffer: GPUBuffer | undefined;
+ if (mesh.jointIndices1 && mesh.jointWeights1) {
+ const data = new Float32Array(numVerts * 8);
+ for (let i = 0; i < numVerts; i++)
+ for (let k = 0; k < 4; k++) {
+ data[i * 8 + k] = mesh.jointIndices1[i * 4 + k] ?? 0;
+ data[i * 8 + 4 + k] = mesh.jointWeights1[i * 4 + k] ?? 0;
+ }
+ skin1Buffer = this.device.createBuffer({
+ label: "Mesh3DSkin1",
+ size: Math.max(32, data.byteLength),
+ usage: GPUBufferUsage.VERTEX,
+ mappedAtCreation: true,
+ });
+ new Float32Array(skin1Buffer.getMappedRange()).set(data);
+ skin1Buffer.unmap();
+ }
+
cached = {
vertexBuffer,
indexBuffer,
@@ -1964,6 +1983,7 @@ export class Renderer3D {
topology: mesh.topology,
colorBuffer,
mapUvBuffer,
+ skin1Buffer,
};
this.meshBuffersCache.set(mesh, cached);
if (wireframe && (!mesh.topology || mesh.topology === "triangle-list"))
@@ -2062,6 +2082,7 @@ export class Renderer3D {
topology: meshBuffers.topology,
colorBuffer: meshBuffers.colorBuffer,
mapUvBuffer: meshBuffers.mapUvBuffer,
+ skin1Buffer: meshBuffers.skin1Buffer,
wireIndexBuffer: meshBuffers.wireIndexBuffer,
wireIndexCount: meshBuffers.wireIndexCount,
};
diff --git a/packages/webgpu-renderers/src/shaders/mesh3d.ts b/packages/webgpu-renderers/src/shaders/mesh3d.ts
index d33438e1..0d197dbc 100644
--- a/packages/webgpu-renderers/src/shaders/mesh3d.ts
+++ b/packages/webgpu-renderers/src/shaders/mesh3d.ts
@@ -57,6 +57,8 @@ struct VertexInput {
@location(7) mrUv : vec2<f32>,
@location(8) aoUv : vec2<f32>,
@location(9) emissiveUv : vec2<f32>,
+ @location(10) joints1 : vec4<f32>,
+ @location(11) weights1 : vec4<f32>,
};
`;
@@ -146,7 +148,12 @@ fn deform${n}(in: VertexInput, instanceIndex: u32) -> MeshDeform {
let w2 = in.weights.z;
let w3 = in.weights.w;
- let totalWeight = w0 + w1 + w2 + w3;
+ // A second set of four influences (glTF JOINTS_1 / WEIGHTS_1), when flagged.
+ let eight = (u32(${model}.params.w) & 16u) != 0u;
+ let wb = select(vec4<f32>(0.0), in.weights1, eight);
+ let jb = vec4<u32>(select(vec4<f32>(0.0), in.joints1, eight));
+
+ let totalWeight = w0 + w1 + w2 + w3 + wb.x + wb.y + wb.z + wb.w;
var skinMat = mat4x4<f32>();
if (crowd) {
// A node-attached (rigid) mesh bakes its node as joint 0.
@@ -157,12 +164,24 @@ fn deform${n}(in: VertexInput, instanceIndex: u32) -> MeshDeform {
crowdJoint${n}(palette0, palette1, paletteT, j1) * w1 +
crowdJoint${n}(palette0, palette1, paletteT, j2) * w2 +
crowdJoint${n}(palette0, palette1, paletteT, j3) * w3;
+ if (eight) {
+ skinMat += crowdJoint${n}(palette0, palette1, paletteT, jb.x) * wb.x +
+ crowdJoint${n}(palette0, palette1, paletteT, jb.y) * wb.y +
+ crowdJoint${n}(palette0, palette1, paletteT, jb.z) * wb.z +
+ crowdJoint${n}(palette0, palette1, paletteT, jb.w) * wb.w;
+ }
}
} else if (totalWeight > 0.001) {
skinMat = ${skin}.jointMatrices[j0] * w0 +
${skin}.jointMatrices[j1] * w1 +
${skin}.jointMatrices[j2] * w2 +
${skin}.jointMatrices[j3] * w3;
+ if (eight) {
+ skinMat += ${skin}.jointMatrices[jb.x] * wb.x +
+ ${skin}.jointMatrices[jb.y] * wb.y +
+ ${skin}.jointMatrices[jb.z] * wb.z +
+ ${skin}.jointMatrices[jb.w] * wb.w;
+ }
}
if (crowd || totalWeight > 0.001) {
let pos4 = skinMat * vec4<f32>(in.position, 1.0);
diff --git a/plugins/framefields/skills/framefields-compose/SKILL.md b/plugins/framefields/skills/framefields-compose/SKILL.md
index 428fc444..ae68a582 100644
--- a/plugins/framefields/skills/framefields-compose/SKILL.md
+++ b/plugins/framefields/skills/framefields-compose/SKILL.md
@@ -474,27 +474,24 @@ fs.writeFileSync("rig.glb", doc.toGlb());
Layer.glb("rig.glb", { rotateX: 180, pose: { LeftArm: { rotateZ: 90 } } });
```
-**Realistic humans (`human`)**: `await human({ sex, age, muscle, weight, proportions, ethnicity, height, targets })` builds a rigged, skinned body from MakeHuman's CC0 base mesh: `sex` 0 female … 1 male, `age` 0 baby / 0.1875 child / 0.5 adult / 1 old, `muscle` and `weight` 0 … 1 (0.5 average), `height` in cm (exact), and any MakeHuman target by path with a weight (`targets: { "nose/nose-base-up": 0.6, "ears/l-ear-shape-pointed": 1 }`). Its skeleton is placed from the shaped body with Mixamo names on the main bones (twist, extra spine and face bones keep MakeHuman names), so `pose`, `aim` and `retarget({ rig: "mixamo" })` work; weights are MakeHuman's painted weights; UVs come with the mesh. Assets download on first use (about 2 MB base plus only the targets a body needs; 131 MB if every target is used) into `~/.cache/framefields/makehuman`, verified by SHA-256 (`FRAMEFIELDS_CACHE_DIR`, `FRAMEFIELDS_HUMAN_BASE_URL` for a mirror). Use `sculpt` for costume, armor and non-human characters.
-
-**Skin**: `addHuman` bakes the skin's textures by default (`skinTextures`, about 3 s): a base color on the body's UVs with blush on the cheeks, nose and lids, darker red lips and two scales of mottling; a roughness map (wet lips, oily nose); and a tiling normal map of pores and fine creases, repeated (via `KHR_texture_transform`) so pores come out about 1.4 mm apart. The regions come from the face's own blend shapes, so they follow any shaped face. Tune it with `addHuman(doc, h, { skin: { color, roughness, subsurface }, skinTextures: { lips, blush, mottle, size, poreSpacing, seed } })`; `skinTextures: false` keeps a flat color. `skinTextures(h)` returns the PNGs for your own materials, and `poreNormalMap()` the detail map alone. The writer adds tangents to normal-mapped primitives that bring none, and texture slots take `transform: { scale, offset, rotation }`. Each map samples with its own glTF sampler (wrap per axis, filter), so a tiling detail map works under a clamped base color.
-
-**Faces**: the body carries facial blend shapes under ARKit names (`eyeBlinkLeft`, `eyeWideRight`, `eyeSquintLeft`, `browDownLeft`, `browInnerUp`, `browOuterUpRight`, `noseSneerLeft`, `jawOpen`, `mouthSmileLeft`, `mouthFrownRight`, `mouthPucker`, `mouthFunnel`, `mouthPressLeft`, `mouthStretchRight`, `mouthUpperUpLeft`, `mouthLowerDownRight`, `mouthDimpleLeft`, `mouthRollLower`, plus `noseFlareLeft/Right`, `noseWrinkle`, `mouthPart`, `neckTense`; the list is `FACE_SHAPES`), built from MakeHuman's expression units for the body's ethnicity; symmetric mouth units are split into sides. `human().mouth` (teeth and tongue) moves with `jawOpen` and the lips. Drive them per layer with `morphs`: names match the file's target names case-insensitively, each a number, keys or a signal; unnamed targets keep the clip's weights. `expressions: false` leaves them out; `subdivide: 1` (Loop, blend shapes and weights carried exactly) smooths faceting in close-ups. Morph targets that move few vertices are written sparse (a face-rigged body is about 2 MB, 6 MB subdivided).
+**Morph targets by name** (`morphs` on `Layer.glb`): set any of the file's morph targets by name, matched case-insensitively, each a number, keys or a signal; unnamed targets keep the clip's weights. The writer stores targets that move few vertices sparse, and so does the engine. `subdivide(primitive, { levels, weld })` (Loop) smooths a primitive and carries blend shapes and skin weights exactly. Texture slots take `transform: { scale, offset, rotation }` (KHR_texture_transform), the writer adds tangents to normal-mapped primitives that bring none, and each map samples with its own glTF sampler. `encodePng(rgba, width, height)` writes textures made in code.
```ts
-Layer.glb("elf.glb", { morphs: { jawOpen: [[0, 0], [12, 0.6]], mouthSmileLeft: 0.8, mouthSmileRight: 0.8, eyeBlinkLeft: blink, eyeBlinkRight: blink } });
+Layer.glb("head.glb", { morphs: { jawOpen: [[0, 0], [12, 0.6]], mouthSmileLeft: 0.8, eyeBlinkLeft: blink } });
```
+**DNA characters (`framefields/dna`)**: `readDna(bytes, { geometry?, behavior? })` reads a DNA file, the rig format MetaHuman characters export to (Export > DCC Export writes one for the head and one for the body). It returns the descriptor (units, axes, LOD count), the definition (controls, joints and their neutral pose, blend shape channels, meshes per LOD), the rig behavior, and the meshes. File versions 2.1 to 2.8 are read. `dnaToGlb(dna, { lod, units, blendShapes, materials })` writes it as a GLB:
+- joints at their neutral pose, with rest orientations;
+- the LOD's meshes, skinned, with blend shapes as named morph targets;
+- axes and units converted to glTF and centimeters.
+
+Skins keep up to eight influences per vertex (glTF's `JOINTS_1` / `WEIGHTS_1`, written only where a vertex has more than four; `influences: 4` caps them). Each mesh gets the material of its role, found from its name (skin, teeth, saliva, eye, the clear eye shell, eye edge, lashes, cartilage). `await dnaMaterials(doc, folder)` adds the export's textures by the role and map words in their file names (`head_color…`, `…normal…`, `…roughness…`, `…cavity…`) and returns `{ found, unused, materials }`; pass `materials` to `addDna`. The export's real file names are unconfirmed, so check `found`. `addDna(doc, dna, options)` writes into your own `GltfDocument`. Load the result with `Layer.glb`; `pose`, `aim`, `lookAt`, IK and `morphs` by channel name work on it. `new RigEvaluator(dna, { lod })` evaluates the rig: set `setGuiControls({ CTRL_expressions_jawOpen: 0.6 })` then `mapGuiToRaw()`, or `setRawControls(…)`; `calculate()` fills `jointOutputs` (per joint: translation, Euler rotation and scale deltas from the neutral pose, `JOINT_ATTRIBUTES` = 9 each), `blendShapeOutputs` (per channel) and `animatedMapOutputs` (wrinkle masks, 0 … 1). Body correctives run too: put each driving joint's rotation (a unit quaternion, in the file's axes) into its four raw controls after any GUI mapping, and RBF solvers turn them into pose controls (`rbfControlNames`, at the end of `inputs`) while twist/swing writes helper joints' rotations. It matches Epic's RigLogic (to float32 rounding) and keeps no state between frames. Quaternion joint groups and machine-learned behavior are not evaluated yet (a file that needs quaternion groups is refused). Layers do not run the evaluator yet. No DNA files ship with framefields; the reader is based on OpenRigLogic (MIT, Epic Games). Joints with rest orientations also work in forge: `skeleton.add(name, { at, parent, orient })`.
+
```ts
-import { GltfDocument, human } from "framefields/forge";
-const elf = await human({ sex: 0, age: 0.6, muscle: 0.55, weight: 0.35, height: 184 });
-const doc = new GltfDocument();
-const rig = doc.addSkeleton(elf.skeleton);
-const skin = doc.addMaterial({ color: "#d9b29a", roughness: 0.5, subsurface: { factor: 0.8, color: "#ff5a3c" } });
-doc.addNode({ mesh: doc.addMesh({ name: "Body", primitives: [{ ...elf.body, material: skin }] }), skin: rig.skin });
-// Or the whole character in one call: skeleton, body, textured eyes, glass corneas, lid drivers.
-addHuman(doc, elf, { skin: { color: "#e9d2b4", roughness: 0.5, subsurface: { factor: 0.7, color: "#ff6a4a" } } });
-// In the scene: aim the gaze (keep maxAngleDeg near 35 for eyes); the lids follow on their own.
-Layer.glb("elf.glb", { lookAt: [{ joint: "LeftEye", target, maxAngleDeg: 35 }, { joint: "RightEye", target, maxAngleDeg: 35 }] });
+import { readFile, writeFile } from "node:fs/promises";
+import { dnaToGlb, readDna } from "framefields/dna";
+const head = readDna(await readFile("head.dna"));
+await writeFile("head.glb", dnaToGlb(head, { lod: 0, materials: { head_lod0_mesh: { color: "#c99a82", roughness: 0.5, subsurface: 0.7 } } }));
```
**Sculpting skinned bodies (`sculpt`)**: a character's body is an ordered list of parts, each an SDF shape (`sphere`, `ellipsoid`, `box`, `cylinder`, `capsule`, `roundCone`, `tube` through points, `torus`, `lathe` profile) with `at`, `rotation`, `op` (`union` / `subtract` / `intersect`), `blend` (smooth join radius), `twist`, `bend`, `displace` (noise detail), `material`, `color`, and the `joint` (or joints) that moves it (default: the nearest bone). `sculpt({ parts, skeleton, cell, triangles })` meshes it closed and manifold at hero resolution, simplifies to the triangle budget, cuts material borders on smooth curves, takes normals and blended colors from the field, and skins every vertex from the parts that reach it (smooth joins share weights, `rigid: true` parts move with one joint), returning one primitive per material plus a report (`openEdges` is 0 for a closed mesh). `limb(skeleton, "LeftForeArm", { radii: [4, 3], blend: 3 })` puts a round cone along a bone; `mirrorParts(leftParts)` adds the right side.
@@ -625,7 +622,7 @@ Layer3D.cylinder({ ..., height: 400, color: "#111", emissive: "#4da3ff", emissiv
- **Geometry outlines (ink):** `Layer.environment("neutral", { outlines: true })`, or `outlines: { color: "#191721", width: 2, referenceHeight: 1080, creaseAngle: 45, depthThreshold: 0.01, opacity: 1 }`. `width` is px at `referenceHeight`, scaled with the output height; start near 1 px at export height. Ink comes from depth and normals, so textures, shadows and coplanar seams get none; `creaseAngle: 180` keeps only silhouettes. `outline: false` on a layer/model excludes it but keeps it occluding ink behind it (for already-inked artwork). Ink follows fog and runs before depth blur and bloom; heavy lens blur spreads it into wide bands. Separate from the image-space `Toon` effect. `Layer3D.cube({ faces: { front: Layer.box(...) } })` faces inherit the cube's `toon`, `outline`, emissive and shadow settings unless set per face. Example: `examples/34_spatial_styling` in the engine repo.
- **3D pivots:** `anchorX/Y` choose the point held fixed during scale/rotation; changing an anchor at identity transform leaves the layer in place. Use `anchorY: 1` to keep a character's feet planted while scaling.
- **Fog** fades to `fog.color` exactly, so set it to the composition background for a seamless horizon.
-- **Models:** glTF materials bring base color, normal, metallic-roughness, occlusion and emissive maps; OBJ (`map_Kd`, `norm` in the `.mtl`) and FBX bring diffuse and normal maps, looked up next to the model. Textures can be PNG, JPEG, WebP, GIF, TIFF, AVIF or Basis KTX2 (ETC1S/UASTC, transcoded offline to RGBA8); TGA, PSD and DDS are skipped with a warning. Draco and meshopt-compressed glTF geometry is decoded by the asynchronous compositor loader; individual maps retain their own UV sets and texture transforms. glTF morph weights animate on the GPU before skinning. Unknown required glTF extensions fail clearly. Vertex colors (VOX, PLY, OFF, glTF `COLOR_0`) multiply the base color.
+- **Models:** glTF materials bring base color, normal, metallic-roughness, occlusion and emissive maps; OBJ (`map_Kd`, `norm` in the `.mtl`) and FBX bring diffuse and normal maps, looked up next to the model. Textures can be PNG, JPEG, WebP, GIF, TIFF, AVIF or Basis KTX2 (ETC1S/UASTC, transcoded offline to RGBA8); TGA, PSD and DDS are skipped with a warning. Draco and meshopt-compressed glTF geometry is decoded by the asynchronous compositor loader; individual maps retain their own UV sets and texture transforms. glTF morph weights animate on the GPU before skinning; sparse morph targets stay sparse from the file to the GPU (memory follows the deltas that exist, so faces with hundreds of correctives fit), and skins take up to eight influences per vertex (`JOINTS_1` / `WEIGHTS_1`). Unknown required glTF extensions fail clearly. Vertex colors (VOX, PLY, OFF, glTF `COLOR_0`) multiply the base color.
- **Model orientation:** the world is y-down, so a y-up model (most glTF, OBJ and FBX files) needs `rotateX: 180` to stand upright.
- **Reflective floor:** `floor: { y, color, reflectivity, roughness, fadeDistance, opacity }` mirrors the scene; `roughness` blurs the reflection, which also fades with distance and strengthens at grazing angles.
- `emissive` / `emissiveIntensity` / `exposure` animate like any prop (`.keys("emissiveIntensity", …)`).
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 22c1d837..e697c74a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2908,11 +2908,35 @@ importers:
specifier: ^4.1.11
- packages/forge:
+ packages/dna:
dependencies:
- '@framefields/storage':
+ '@framefields/forge':
specifier: workspace:*
- version: link:../storage
+ version: link:../forge
+ devDependencies:
+ '@framefields/tsconfig':
+ specifier: workspace:*
+ version: link:../tsconfig
+ '@framefields/webgpu-renderers':
+ specifier: workspace:*
+ version: link:../webgpu-renderers
+ '@types/node':
+ specifier: ^24.1.0
+ version: 24.10.14
+ gltf-validator:
+ specifier: 2.0.0-dev.3.10
+ version: 2.0.0-dev.3.10
+ tsdown:
+ specifier: ^0.19.0
+ typescript:
+ specifier: ^5.8.3
+ version: 5.9.3
+ vitest:
+ specifier: ^4.1.11
+
+ packages/forge:
devDependencies:
'@framefields/tsconfig':
specifier: workspace:*
@@ -3032,6 +3056,9 @@ importers:
'@framefields/core':
specifier: workspace:*
version: link:../core
+ '@framefields/dna':
+ specifier: workspace:*
+ version: link:../dna
'@framefields/forge':
specifier: workspace:*
version: link:../forge
diff --git a/specs/character-forge.md b/specs/character-forge.md
index 94ef513c..987f8e3e 100644
--- a/specs/character-forge.md
+++ b/specs/character-forge.md
@@ -1,6 +1,8 @@
# Character Forge: rigged characters built in code
-Status: Phases 1–2 done (GLB writer, skeleton, humanoid preset, bone gizmo; bound sculpting, manifold narrow-band meshing, simplification, smooth material borders, skin weights from the field; `packages/forge`, exposed as `framefields/forge`). Sharp-edge preservation for hard surfaces moves to Phase 7's hard-surface work. Human bodies and faces now start from MakeHuman's CC0 base (`human()`): realistic anatomy, edge loops and UVs, macro and feature targets, painted weights. `sculpt` stays for stylization, costume, armor and non-humans. The face rig (Phase 4) builds on MakeHuman's expression units and the ARKit 52 names. Phase 3 in progress: the loader reads clearcoat, sheen, anisotropy and iridescence and forge's `extras.framefields.subsurface`, the compositor uses them under layer overrides, and the subsurface lobe was rewritten to conserve energy (per-channel wrap). Eyes (first step of Phase 5): `human()` returns MakeHuman's eyeballs fitted to the shaped head (proxy binding), skinned to Mixamo `LeftEye` / `RightEye` pivoted at each ball's least-squares sphere center, plus the CC0 iris texture; a clear coat gives the wet highlight. Corneas are back as glass: glass now refracts the 3D scene behind it (a pre-pass of the batch without glass), and glTF transmission + IOR + volume thickness map to glass whose bend follows the refracted ray through that depth, so the iris shifts with the viewing angle. Lids follow the gaze through joint drivers (`drive`, carried in the GLB), and `addHuman` writes the whole character. Face (Phase 4): ARKit-named blend shapes from MakeHuman's expression units (symmetric ones split into sides with a soft seam), a teeth-and-tongue `mouth` part that moves with the jaw and lips, per-layer `morphs` by name, Loop subdivision that carries shapes and weights exactly, and sparse morph accessors (2 MB per face-rigged body). Skin look development: `skinTextures` bakes the color (blush, lips, mottling) and roughness into the body's UVs from regions found through the blend shapes, plus a tiling pore and crease normal map; `addHuman` uses them by default, and the writer generates tangents and writes texture transforms. Still to do in Phase 4: sculpted teeth to replace MakeHuman's helper blocks, a darkened mouth cavity, wrinkle maps driven by expression weights. Maps now sample with their own glTF samplers (DNA plan, Phase 1). Still to do in Phase 3: alpha-to-coverage for hair cards and morphs combined with skinning; the specular, IOR, transmission and volume extensions are written but not yet rendered. First character: **Ithrael Sunmourn** (`examples/36_emberwake/CHARACTERS.md`), an original hooded elven ranger with a long cloak, long hair, a sculpted face, real eyes, and a full set of expressions.
+Status (2026-11-05): `human()` and the MakeHuman assets were removed; realistic humans now come from DNA files (`specs/dna-face-rig.md`). The forge keeps the GLB writer, skeletons, `sculpt`, `subdivide` and the engine work below (glass eyes, drivers, `morphs`, sparse morphs, texture transforms). The MakeHuman notes below are history.
+
+Earlier status: Phases 1–2 done (GLB writer, skeleton, humanoid preset, bone gizmo; bound sculpting, manifold narrow-band meshing, simplification, smooth material borders, skin weights from the field; `packages/forge`, exposed as `framefields/forge`). Sharp-edge preservation for hard surfaces moves to Phase 7's hard-surface work. Human bodies and faces now start from MakeHuman's CC0 base (`human()`): realistic anatomy, edge loops and UVs, macro and feature targets, painted weights. `sculpt` stays for stylization, costume, armor and non-humans. The face rig (Phase 4) builds on MakeHuman's expression units and the ARKit 52 names. Phase 3 in progress: the loader reads clearcoat, sheen, anisotropy and iridescence and forge's `extras.framefields.subsurface`, the compositor uses them under layer overrides, and the subsurface lobe was rewritten to conserve energy (per-channel wrap). Eyes (first step of Phase 5): `human()` returns MakeHuman's eyeballs fitted to the shaped head (proxy binding), skinned to Mixamo `LeftEye` / `RightEye` pivoted at each ball's least-squares sphere center, plus the CC0 iris texture; a clear coat gives the wet highlight. Corneas are back as glass: glass now refracts the 3D scene behind it (a pre-pass of the batch without glass), and glTF transmission + IOR + volume thickness map to glass whose bend follows the refracted ray through that depth, so the iris shifts with the viewing angle. Lids follow the gaze through joint drivers (`drive`, carried in the GLB), and `addHuman` writes the whole character. Face (Phase 4): ARKit-named blend shapes from MakeHuman's expression units (symmetric ones split into sides with a soft seam), a teeth-and-tongue `mouth` part that moves with the jaw and lips, per-layer `morphs` by name, Loop subdivision that carries shapes and weights exactly, and sparse morph accessors (2 MB per face-rigged body). Skin look development: `skinTextures` bakes the color (blush, lips, mottling) and roughness into the body's UVs from regions found through the blend shapes, plus a tiling pore and crease normal map; `addHuman` uses them by default, and the writer generates tangents and writes texture transforms. Still to do in Phase 4: sculpted teeth to replace MakeHuman's helper blocks, a darkened mouth cavity, wrinkle maps driven by expression weights. Maps now sample with their own glTF samplers (DNA plan, Phase 1). Still to do in Phase 3: alpha-to-coverage for hair cards and morphs combined with skinning; the specular, IOR, transmission and volume extensions are written but not yet rendered. First character: **Ithrael Sunmourn** (`examples/36_emberwake/CHARACTERS.md`), an original hooded elven ranger with a long cloak, long hair, a sculpted face, real eyes, and a full set of expressions.
## Goal
diff --git a/specs/dna-face-rig.md b/specs/dna-face-rig.md
index abccd2ef..749938ef 100644
--- a/specs/dna-face-rig.md
+++ b/specs/dna-face-rig.md
@@ -1,12 +1,23 @@
# DNA characters: MetaHuman-compatible faces and bodies
-Status: Phase 1 done: each material map samples with its own glTF sampler (loader `mapSampling`, a sampler binding per map in the mesh shader). Phases 2 onward are planned.
+Status: Phases 1–2 done, plus the engine gaps they found.
+- **Phase 1:** each material map samples with its own glTF sampler.
+- **Phase 2:** `packages/dna` (`framefields/dna`) reads DNA files (2.1 to 2.8: descriptor and its extension, definition, behavior, geometry; other layers are listed and skipped). `dnaToGlb` / `addDna` write the neutral pose with rest orientations (the forge skeleton gained `orient`), a LOD's meshes, skin weights (duplicate joint entries merged) and blend shapes as named morph targets.
+- **Parity with Epic's library:** `packages/dna/fixtures/oracle.cpp` builds against OpenRigLogic 5.8 (commit `d3d329bb`). `oracle.dna` is made-up data written by Epic's writer, and each fixture's `.json` is what Epic's reader reads. `readDna` matches it field for field for 2.8 and 2.1 files. Epic's reader also reads our test writer's files identically.
+- **Engine gaps, closed:**
+ - **Sparse morphs:** the loader keeps sparse morph targets sparse (`MorphTarget3D.indices`), and the GPU pass gathers deltas per vertex from entries that exist (memory follows the deltas, no atomics).
+ - **Eight influences:** skins take up to eight influences per vertex (`JOINTS_1` / `WEIGHTS_1` through writer, loader and shader; a second vertex slot, flagged).
+ - **Materials:** DNA meshes get role materials, and `dnaMaterials` scans an export folder for textures.
+
+Still open:
+- The export's real texture file names (the scan's patterns are guesses until a real export is read).
+- The rig evaluator (Phase 3).
## Goal
Load a character exported from MetaHuman Creator (Export > DCC Export: a head DNA file, a body DNA file and textures) into a composition, and animate it with the same rig evaluation Unreal Engine uses: face controls drive joints, corrective blend shapes and wrinkle-map weights. The character then animates with the same tracks as forge humans: `morphs` (ARKit names), `pose`, `aim`, `lookAt`, IK and retargeting from vision.
-This sits next to `human()`, not in place of it. `human()` stays the path for people built in code from CC0 data. DNA characters are for users who bring a character made in MetaHuman Creator. Their realism comes from the rig: hundreds of correctives, and wrinkle maps that fade in with each expression. Both kinds of character share the renderer improvements this work brings, wrinkle maps above all.
+DNA characters are the only realistic-human path: `human()` and MakeHuman were removed (2026-11-05) because their rendering and motion fell short. Characters come from MetaHuman Creator exports and render with our own shaders. The forge stays for skeletons, sculpted props, costumes and non-humans.
## Source and terms
@@ -85,7 +96,7 @@ API: `const rig = new RigEvaluator(reader, { lod })`, then `rig.evaluate(control
## Verification
-- **Oracle:** build the pinned OpenRigLogic (CMake) with its Python bindings under `scratch/`, after the user approves the clone.
+- **Oracle:** OpenRigLogic 5.8 built under `scratch/` with a small C++ program (`packages/dna/fixtures/oracle.cpp`; no Python bindings needed). Done for reading; extended to evaluation in Phase 3.
- **Committed fixture:** a small synthetic DNA file written with the C++ writer from data we make up (a few joints, controls, PSDs, blend shapes, a conditional table, one tiny mesh). It contains no MetaHuman content, so it can be committed. A script regenerates it.
- **Parity tests:**
- the reader against the oracle on every layer of the fixture;
@@ -95,18 +106,34 @@ API: `const rig = new RigEvaluator(reader, { lod })`, then `rig.evaluate(control
- rendered frames of a neutral face, then jawOpen, smile, blink and brow raise, with wrinkles on and off;
- the timings recorded.
- Skipped in CI when absent, like the MakeHuman cache tests.
+ Skipped in CI when no export is present.
## Phases
-1. Per-map samplers in the renderer (prerequisite for wrinkle maps, fixes the pore map).
-2. DNA reader: header, descriptor, definition, geometry. `dnaToGlb` renders a neutral head with its textures.
-3. Behavior layer and evaluator: controls, PSD, joints, blend shapes. Face controls animate the head. Parity tests.
+1. Per-map samplers in the renderer. **Done.**
+2. DNA reader and `dnaToGlb`. **Done**, with reader parity against Epic's library, sparse morphs, eight influences and role materials.
+3. Rig evaluator, body first:
+ - **3a. Shared core. Done.** `RigEvaluator` (`packages/dna/src/rig.ts`) covers GUI → raw controls, PSDs, joint matrices per group and LOD, blend shapes and animated maps.
+ - **Parity:** RigLogic's scalar, full-precision outputs on the oracle character (`oracle eval`, 48 seeded cases across GUI/raw controls and both LODs) match to float precision. Mutation checks confirm the fixture catches interval skipping, PSD clamping and the PSD cap.
+ - **One deliberate difference:** PSDs a LOD does not use are 0 rather than last frame's value, so evaluation is stateless.
+ - **Still open:** composing deltas onto the neutral pose. Translation and scale add; the rotation delta applies in the joint's oriented frame (Maya's joint-orient convention). That needs a real export to confirm.
+ - **3b. Body correctives. Evaluation done; wiring and the render milestone open.**
+ - **RBF and twist/swing:** `rig-body.ts` adds RBF solvers (additive and interpolative; Euclidean, quaternion, swing-angle and twist-angle distances; Gaussian, exponential, linear, cubic and quintic kernels; automatic radius; normalization, pose scales, thresholds, gating) and twist/swing (tdm's slerp and quaternion-to-Euler, including its polynomial asin). The reader adds the `rbfb`, `rbfe`, `twsw`, `jbmd` and `mlbh` (names only) layers.
+ - **Parity:** the oracle character has five solvers covering every method and kernel, plus a twist and a swing. Outputs match RigLogic to float32 rounding (1e-6 for face parts; 2e-4 where an ill-conditioned interpolation matrix amplifies RigLogic's float32 inversion).
+ - **Mutation checks:** sixteen behaviour changes are caught.
+ - **Not evaluated yet:** quaternion joint groups (files needing them are refused) and machine-learned behavior.
+ - **Still open:** feeding the skeleton's joint quaternions into raw controls inside layers, and the shoulder raise and elbow bend milestone on a real exported body.
+ - **3c. Face:** face controls drive joints and correctives; ARKit names map to face controls so `morphs` keeps working.
4. Animated maps and wrinkle maps in the renderer.
-5. ARKit mapping and `morphs` on DNA characters; ARKit-named faces drive both kinds of character.
-6. Body DNA: twist/swing, RBF correctives, the `"unreal"` retarget preset, head and body merged.
-7. Machine-learned behavior, if present in exports and worth it.
-8. Docs: the `framefields-compose` skill (DNA characters, face controls, wrinkles), NOTICE, changesets, an example film shot with a DNA character, and the license wording from open question 1.
+5. Head and body as one character: the head's skeleton joined to the body's at the neck, with no gap and no double neck motion; the `"unreal"` retarget preset.
+6. Machine-learned behavior, if present in exports and worth it.
+7. Docs: the skill, NOTICE, changesets, an example film shot with a DNA character, and the license wording from open question 1.
+
+Tests every phase keeps:
+- **Seeking matches playing:** rendering frame 200 directly gives the same pixels and rig outputs as rendering 0 through 200. The evaluator keeps no state between frames.
+- **LOD switching:** each LOD loads and evaluates; switching LOD mid-shot keeps the pose.
+- **Several characters:** two instances of one character and two different characters in one scene evaluate independently.
+- **Memory:** rig data and GPU buffers are released when a character leaves the scene; repeated renders do not grow memory.
## Open questions