Body shape: the game's bone composition and body types for every character #318

Manually merged
github merged 4 commits from gh-pr/318/head into gh-pr/318/base 2026-11-26 20:26:59 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 22:23 UTC · original
holdmysocks:body-morphs-308 → master · +156 −19 · 4 files · 4 commits · merged 2026-11-25 23:32 UTC

Part of #308 (body sliders on the main characters). The "only the parts shown hide skin" fix moved to #319, which is merged; master is merged in here.

What changes

1. Bones are composed the way the game's skeleton update does it. This replaces the rule in the first version of this PR, which was inferred from renders. The game's per-frame skeleton update works like this:

  • It takes each bone's local rotation, translation and scale from the animation frame, or from the bone's default record when the frame has no value for it.
  • It composes them with the parent's model-space (rotation, translation, scale):
    • rotation = parent rotation × local rotation
    • translation = parent translation + parent rotation applied to (parent scale × local translation, per axis)
    • scale = parent scale × local scale, per axis
  • Skinning then places a vertex at rotation × (scale × (inverse bind × vertex)) + translation.

So a helper bone's scale does reach the bones under it, but in each bone's own axes, without the shear that the earlier matrix product added. The old matrix product is what tore the chest of heavy male shapes.

--body-shape exports pose the same way. The joint world matrices match the game's transforms. A joint's local matrix can carry shear, and TRS joint nodes (used with animations) can't hold it.

A unit test covers the rule with a parent scaled 3x along z and a child turned 90° about x. The child's offset is scaled with the parent (1.3 m), and the child's own z axis is 3 long while its y axis stays 1: no shear.

2. Body type from the fit tag. The rig and the reference skeleton were picked by !name.contains("_mr1"), so every male body type other than mr1 was shaped as a female body. Now:

  • Every fit tag that starts with m (mr1, mb1, mo1, mc1, msk1) gets the male rig and skeleton.
  • Kid (mk1) and infant (mi1) parts get their own reference skeletons (ambient_kidbody, ambient_infantbody). Before, they were bound to the adult female skeleton: a kid's head bone sat 0.65 m above the head mesh.
  • Kids and infants have no body-shape rig (the rig dictionary has only the female and male LOD rigs), so the sliders leave them as they are, and exports say so in a warning.
  • The bb and xxl reference skeletons have the same joint positions as the regular ones, so they need nothing separate.

Coverage (all characters)

Of the 2,628 characters and outfit-list models whose default look resolves:

body characters rig
mr1 1,602 male
fr1 942 female
mo1 14 male (female before this PR)
fo1 12 female
mb1 8 male (female before this PR)
fb1 2 female
mk1 / mi1 9 / 6 none (kid / infant skeletons)
no fit tag 33 by name, as before

So 2,580 have body-shape data: every adult body is shaped by one of the two rigs. The 22 mo1 and mb1 characters were shaped with the female rig before this PR, and the 15 kids and infants with the adult rig and skeleton.

Sample at the extremes. I rendered 14 characters in their default outfits at weight/muscle 0/0, 1/1, -1/0 and 1/0:

  • 12 picked at random: five mr1, five fr1, one fo1, one fb1;
  • plus Kordell (mb1) and Abel (mo1).

13 look right at every setting: smooth bodies with no tears, and clothes that follow. Abel's skin pokes through his T-shirt at the belly at full weight. That happens because the viewer's clothes follow the nearest skin rather than the game's garment rigs, which aren't linked yet. Jason and Lucia also look right, apart from the nipple noted below.

Before / after (viewer, RTX 4080)

  • Jason and Lucia, bare body (head plus upper and lower body), at weight/muscle 0/0, 1/0, 1/1 and -1/0, rendered with three builds:

    • the master build: cut into pieces (the hide-mask bug);
    • the inferred rule from the first version of this PR;
    • the game's rule.

    With the game's rule:

    • Jason's heavy chest is round and has no tears.
    • Lucia's chest keeps the volume the inferred rule had flattened.
    • Neutral is unchanged.
  • Jason's chest close-up at 1/0 and 1/1: no torn skin. A pointed nipple with a fold under it remains (see below).

  • Kordell (mb1), at full weight: before, he got wide female hips. After, he is shaped as a male body.

  • Abel (mo1): shaped as a male body after the fix.

  • Thomas, kid (mk1): before, his body tore apart at every slider setting. After, he is whole and unchanged by the sliders.

Not in this PR (findings for #308)

  • The 14 rig inputs that no control drives. They are not in the game's presets, PSO or meta files, and their hashes are not constants in the executable. They act on:

    • the neck (9c978205, 5ebebbe7);
    • the breasts and chest (f9bc636e, 12b6dd5f, 36c800c8, c7717edf, f9dc7b4c, b3e7142f, a064c82b, 9b89a2b0);
    • the hips and thighs (a64a2b22, ee16a69c);
    • the upper arms (c0fd5915, a981e727).

    So they look like extra shape controls set from data not decoded yet. Several of them reshape the breast bones, which probably explains the pointed male nipple at full weight.

  • Face fat: the game's body-shape presets (common.rpf BodyShapePresets) and both rigs have no face controls.

  • Lucia's "holes in the neck": a light band along the underside of the jaw. It shows on the head alone, at every body setting, and disappears in the albedo view, so it is head shading (shader ped_standard_head), not geometry.

  • Body textures: Lucia's upper-body item names a texture that isn't in the install, so her torso keeps the flat tone taken from the face.

  • Body hair: the grooms are listed under "Hair and fur" but start switched off.

  • Jason's hips: a visible line where the upper and lower body textures meet.

**@⁠holdmysocks** on GitHub · 2026-11-25 22:23 UTC · [original](https://github.com/holdmysocks/SixNG/pull/318) `holdmysocks:body-morphs-308` → `master` · +156 −19 · 4 files · 4 commits · merged 2026-11-25 23:32 UTC Part of #308 (body sliders on the main characters). The "only the parts shown hide skin" fix moved to #319, which is merged; master is merged in here. ## What changes **1. Bones are composed the way the game's skeleton update does it.** This replaces the rule in the first version of this PR, which was inferred from renders. The game's per-frame skeleton update works like this: - It takes each bone's local rotation, translation and scale from the animation frame, or from the bone's default record when the frame has no value for it. - It composes them with the parent's model-space (rotation, translation, scale): - rotation = parent rotation × local rotation - translation = parent translation + parent rotation applied to (parent scale × local translation, per axis) - scale = parent scale × local scale, per axis - Skinning then places a vertex at rotation × (scale × (inverse bind × vertex)) + translation. So a helper bone's scale does reach the bones under it, but in each bone's own axes, without the shear that the earlier matrix product added. The old matrix product is what tore the chest of heavy male shapes. `--body-shape` exports pose the same way. The joint world matrices match the game's transforms. A joint's local matrix can carry shear, and TRS joint nodes (used with animations) can't hold it. A unit test covers the rule with a parent scaled 3x along z and a child turned 90° about x. The child's offset is scaled with the parent (1.3 m), and the child's own z axis is 3 long while its y axis stays 1: no shear. **2. Body type from the fit tag.** The rig and the reference skeleton were picked by `!name.contains("_mr1")`, so every male body type other than `mr1` was shaped as a female body. Now: - Every fit tag that starts with `m` (`mr1`, `mb1`, `mo1`, `mc1`, `msk1`) gets the male rig and skeleton. - Kid (`mk1`) and infant (`mi1`) parts get their own reference skeletons (`ambient_kidbody`, `ambient_infantbody`). Before, they were bound to the adult female skeleton: a kid's head bone sat 0.65 m above the head mesh. - Kids and infants have no body-shape rig (the rig dictionary has only the female and male LOD rigs), so the sliders leave them as they are, and exports say so in a warning. - The `bb` and `xxl` reference skeletons have the same joint positions as the regular ones, so they need nothing separate. ## Coverage (all characters) Of the 2,628 characters and outfit-list models whose default look resolves: | body | characters | rig | |---|---|---| | `mr1` | 1,602 | male | | `fr1` | 942 | female | | `mo1` | 14 | male (female before this PR) | | `fo1` | 12 | female | | `mb1` | 8 | male (female before this PR) | | `fb1` | 2 | female | | `mk1` / `mi1` | 9 / 6 | none (kid / infant skeletons) | | no fit tag | 33 | by name, as before | So 2,580 have body-shape data: every adult body is shaped by one of the two rigs. The 22 `mo1` and `mb1` characters were shaped with the female rig before this PR, and the 15 kids and infants with the adult rig and skeleton. **Sample at the extremes.** I rendered 14 characters in their default outfits at weight/muscle 0/0, 1/1, -1/0 and 1/0: - 12 picked at random: five `mr1`, five `fr1`, one `fo1`, one `fb1`; - plus Kordell (`mb1`) and Abel (`mo1`). 13 look right at every setting: smooth bodies with no tears, and clothes that follow. Abel's skin pokes through his T-shirt at the belly at full weight. That happens because the viewer's clothes follow the nearest skin rather than the game's garment rigs, which aren't linked yet. Jason and Lucia also look right, apart from the nipple noted below. ## Before / after (viewer, RTX 4080) - **Jason and Lucia, bare body** (head plus upper and lower body), at weight/muscle 0/0, 1/0, 1/1 and -1/0, rendered with three builds: - the master build: cut into pieces (the hide-mask bug); - the inferred rule from the first version of this PR; - the game's rule. With the game's rule: - Jason's heavy chest is round and has no tears. - Lucia's chest keeps the volume the inferred rule had flattened. - Neutral is unchanged. - **Jason's chest close-up at 1/0 and 1/1:** no torn skin. A pointed nipple with a fold under it remains (see below). - **Kordell (`mb1`), at full weight:** before, he got wide female hips. After, he is shaped as a male body. - **Abel (`mo1`):** shaped as a male body after the fix. - **Thomas, kid (`mk1`):** before, his body tore apart at every slider setting. After, he is whole and unchanged by the sliders. ## Not in this PR (findings for #308) - **The 14 rig inputs that no control drives.** They are not in the game's presets, PSO or meta files, and their hashes are not constants in the executable. They act on: - the neck (9c978205, 5ebebbe7); - the breasts and chest (f9bc636e, 12b6dd5f, 36c800c8, c7717edf, f9dc7b4c, b3e7142f, a064c82b, 9b89a2b0); - the hips and thighs (a64a2b22, ee16a69c); - the upper arms (c0fd5915, a981e727). So they look like extra shape controls set from data not decoded yet. Several of them reshape the breast bones, which probably explains the pointed male nipple at full weight. - **Face fat:** the game's body-shape presets (common.rpf `BodyShapePresets`) and both rigs have no face controls. - **Lucia's "holes in the neck":** a light band along the underside of the jaw. It shows on the head alone, at every body setting, and disappears in the albedo view, so it is head shading (shader `ped_standard_head`), not geometry. - **Body textures:** Lucia's upper-body item names a texture that isn't in the install, so her torso keeps the flat tone taken from the face. - **Body hair:** the grooms are listed under "Hair and fur" but start switched off. - **Jason's hips:** a visible line where the upper and lower body textures meet.
Viewer: only the parts shown hide skin. The hide masks of every item in
the outfit were applied, so a garment switched off in the Parts panel
still cut its hole in the body.

Body shape: a bone's scale shapes its own vertices but no longer carries
into its children. The rig scales chest helper bones by up to about 3x
along one axis; passed down, that pushed the bones under them several
centimetres out and tore the chest of heavy male shapes. Applies to the
viewer sliders and to --body-shape exports. Inferred from renders, not
read from the game.
Each bone keeps a model-space rotation, translation and scale. A child's
rotation is the parent's times its own, its translation the parent's plus
the parent's rotation applied to its own translation scaled per axis by
the parent's scale, and its scale the parent's times its own, per axis.
Replaces the rule inferred from renders, where a bone's scale did not
reach its children.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:26:58 +00:00
github manually merged commit 6e1455ef52 into gh-pr/318/base 2026-11-26 20:26:59 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.