Body shape: full rig program; clothing helper bones follow the garment surface rig (#308) #356

Manually merged
github merged 2 commits from gh-pr/356/head into gh-pr/356/base 2026-11-26 20:30:05 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-26 04:56 UTC · original
holdmysocks:garment-surface-308 → master · +477 −161 · 2 files · 2 commits · merged 2026-11-26 05:48 UTC

Part of #308 (body sliders). This PR changes the body-shape rig reader and the export. The viewer is unchanged.

Rig program. bodyshape.rs now runs the game's whole rig program instead of four block types:

  • The input list loads the float controls and the bones' local translation, rotation and scale into registers.
  • The program blocks compute: constants, scalar and vector arithmetic, quaternion products and rotations, shortest-arc and three-point frames, cone readers, piecewise-linear curves, blend skinning and additive passes.
  • The output list writes the bone channels back.

Block 81 is a curve, not the clamp it was read as. The body-shape rig still gives the same pose: on a T-shirt export at full weight and muscle, all 562 body joints match the old build exactly.

Clothing helper bones. Clothes with their own helper bones (GM_*) are now posed by the game's garment surface rig (GarmentSurfaceMale / GarmentSurfaceFemale). It reads the shaped body bones and writes the helper bones' local translation and rotation. Before, the helper bones followed their parent rigidly.

  • Self-check, almost-neutral shape: the rig's output lands on the stored helper bones within 0.1 mm (Lucia, female rig) and 8.4 mm (Raul, male rig).
  • At full weight and muscle, the helper bones of a slim long-sleeve T-shirt move by up to 10 cm (median 3.5 cm).
  • Clothes without helper bones are skinned only to the body bones, as in the game. Their poke-through is a matter for the skin hide masks.

The viewer is not switched yet. Clothes in the viewer still follow the skin. With only the surface rig, skin shows through Raul's shirt and Lucia's top at full weight. In the game each garment also runs per-style shape rigs (*_Garment_Shapes_*, which read the same weight and muscle controls). These add another 8–15 cm, differ a lot between styles, and nothing found so far links a garment to its style rigs. That is the next step.

Neutral exports are unchanged: the rigs run only with a body shape. Tested with cargo test -p sixng-core bodyshape and by comparing old and new exports joint by joint.

**@⁠holdmysocks** on GitHub · 2026-11-26 04:56 UTC · [original](https://github.com/holdmysocks/SixNG/pull/356) `holdmysocks:garment-surface-308` → `master` · +477 −161 · 2 files · 2 commits · merged 2026-11-26 05:48 UTC Part of #308 (body sliders). This PR changes the body-shape rig reader and the export. The viewer is unchanged. **Rig program.** `bodyshape.rs` now runs the game's whole rig program instead of four block types: - The input list loads the float controls and the bones' local translation, rotation and scale into registers. - The program blocks compute: constants, scalar and vector arithmetic, quaternion products and rotations, shortest-arc and three-point frames, cone readers, piecewise-linear curves, blend skinning and additive passes. - The output list writes the bone channels back. Block 81 is a curve, not the clamp it was read as. The body-shape rig still gives the same pose: on a T-shirt export at full weight and muscle, all 562 body joints match the old build exactly. **Clothing helper bones.** Clothes with their own helper bones (`GM_*`) are now posed by the game's garment surface rig (`GarmentSurfaceMale` / `GarmentSurfaceFemale`). It reads the shaped body bones and writes the helper bones' local translation and rotation. Before, the helper bones followed their parent rigidly. - Self-check, almost-neutral shape: the rig's output lands on the stored helper bones within 0.1 mm (Lucia, female rig) and 8.4 mm (Raul, male rig). - At full weight and muscle, the helper bones of a slim long-sleeve T-shirt move by up to 10 cm (median 3.5 cm). - Clothes without helper bones are skinned only to the body bones, as in the game. Their poke-through is a matter for the skin hide masks. **The viewer is not switched yet.** Clothes in the viewer still follow the skin. With only the surface rig, skin shows through Raul's shirt and Lucia's top at full weight. In the game each garment also runs per-style shape rigs (`*_Garment_Shapes_*`, which read the same weight and muscle controls). These add another 8–15 cm, differ a lot between styles, and nothing found so far links a garment to its style rigs. That is the next step. Neutral exports are unchanged: the rigs run only with a body shape. Tested with `cargo test -p sixng-core bodyshape` and by comparing old and new exports joint by joint.
bodyshape.rs now runs the game's rig program in full: the input list
loads float controls and bone local channels into registers, the
blocks compute (vector and quaternion arithmetic, curves, cone readers,
blend skinning, additive passes) and the output list writes bone
channels back. The body-shape rig gives the same pose as before.

Exports with a body shape then run GarmentSurfaceMale/Female for
clothing with its own helper bones (GM_*): the rig reads the shaped
body bones and writes the helper bones' locals, instead of the helper
bones following their parent rigidly. The viewer keeps clothes
following the skin: the garment's per-style shape rigs are not linked
yet, and without them skin shows through at full weight.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:30:04 +00:00
github manually merged commit b4dfab7d2b into gh-pr/356/base 2026-11-26 20:30:05 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.