Hair: read a hair asset's strand grooms from the game instead of guessing them #273

Manually merged
github merged 2 commits from gh-pr/273/head into gh-pr/273/base 2026-11-26 20:23:32 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 13:35 UTC · original
holdmysocks:claude/people-hair-links → master · +304 −59 · 5 files · 2 commits · merged 2026-11-25 14:10 UTC

What

Many outfits showed a bald head, and others showed the wrong hair. The viewer guessed which strand grooms belong to a hair asset from names, archive order and geometry. The link is in fact stored, and this reads it.

  1. A hair asset's GUID is the name id of its placeholder drawable's name, _full included. The name id is the first half of MurmurHash3 x64 128 (seed 0) of the lower-case name, the same hash as meta7a::asset_id. 1,854 of the 1,879 assets of the piece table are named this way.
  2. The piece table lists an asset's pieces by the name ids of their files. A piece file is named after the placeholder without _full, plus a piece word (_base, _hairline, _babyhair, _tail, _fringe, _crown, _front …). LODs add _lod1 and so on.
  3. The archive's table of contents gives every file its name id, in column 73bcb72dce74f11f. 6,232 of the 6,238 ids of the piece table are files of the archive; 5,711 of them are grooms.

Changes

  • hairlink builds the table from the stored link when the table of contents can be read: 878 hair, beard, brow, lash and body-hair assets, each with all its pieces, in about 15 seconds (the inferred table took about a minute and placed 276 assets at 50 % or more). The table says whether it is exact. The cache version is bumped, so it rebuilds once.
  • The inferred walk stays as the fallback (other platforms, other game builds) and its notes now say it is a guess.
  • rpf9toc::file_ids reads the file id column of an archive and the archives inside it.
  • Viewer: an exact link is kept whole. The on-head filter and the percentage only apply to an inferred link. Linked body hair still starts hidden.
  • Grooms: a piece that stores only clump strands (first count 0 in every root triangle) grew no strands. It now grows from its second count, unclumped. One main character's short cut had its whole top in such a piece.

Checked

  • Lucia: the outfits that were bald now show hair (four checked, each with a different hair asset), and the default ponytail is now the right one. The inferred table had put other pieces there.
  • Jason: all five pieces of his cut show; the names of three of them hash to _base, _crown and _front.
  • cargo test -p sixng-core: 261 passed. New tests: LOD chains from known piece starts, and a clump-only piece.

Not done

  • The LODs of a piece are still attached by bones and strand counts. Their ids could be read too when the piece name is known; about half of the piece words are not named yet.
  • Animal fur (furlink) still infers its link. The same three steps should apply.
  • Strand pieces on clothing (costumes, masks, some hats) are in the table as part other and are not shown.
  • One generic ponytail has a few long strands hanging forward in the bind pose. Not looked into.
**@⁠holdmysocks** on GitHub · 2026-11-25 13:35 UTC · [original](https://github.com/holdmysocks/SixNG/pull/273) `holdmysocks:claude/people-hair-links` → `master` · +304 −59 · 5 files · 2 commits · merged 2026-11-25 14:10 UTC ## What Many outfits showed a bald head, and others showed the wrong hair. The viewer guessed which strand grooms belong to a hair asset from names, archive order and geometry. The link is in fact stored, and this reads it. ## The stored link 1. A hair asset's GUID is the name id of its placeholder drawable's name, `_full` included. The name id is the first half of MurmurHash3 x64 128 (seed 0) of the lower-case name, the same hash as `meta7a::asset_id`. 1,854 of the 1,879 assets of the piece table are named this way. 2. The piece table lists an asset's pieces by the name ids of their files. A piece file is named after the placeholder without `_full`, plus a piece word (`_base`, `_hairline`, `_babyhair`, `_tail`, `_fringe`, `_crown`, `_front` …). LODs add `_lod1` and so on. 3. The archive's table of contents gives every file its name id, in column `73bcb72dce74f11f`. 6,232 of the 6,238 ids of the piece table are files of the archive; 5,711 of them are grooms. ## Changes - `hairlink` builds the table from the stored link when the table of contents can be read: 878 hair, beard, brow, lash and body-hair assets, each with all its pieces, in about 15 seconds (the inferred table took about a minute and placed 276 assets at 50 % or more). The table says whether it is exact. The cache version is bumped, so it rebuilds once. - The inferred walk stays as the fallback (other platforms, other game builds) and its notes now say it is a guess. - `rpf9toc::file_ids` reads the file id column of an archive and the archives inside it. - Viewer: an exact link is kept whole. The on-head filter and the percentage only apply to an inferred link. Linked body hair still starts hidden. - Grooms: a piece that stores only clump strands (first count 0 in every root triangle) grew no strands. It now grows from its second count, unclumped. One main character's short cut had its whole top in such a piece. ## Checked - Lucia: the outfits that were bald now show hair (four checked, each with a different hair asset), and the default ponytail is now the right one. The inferred table had put other pieces there. - Jason: all five pieces of his cut show; the names of three of them hash to `_base`, `_crown` and `_front`. - `cargo test -p sixng-core`: 261 passed. New tests: LOD chains from known piece starts, and a clump-only piece. ## Not done - The LODs of a piece are still attached by bones and strand counts. Their ids could be read too when the piece name is known; about half of the piece words are not named yet. - Animal fur (`furlink`) still infers its link. The same three steps should apply. - Strand pieces on clothing (costumes, masks, some hats) are in the table as part `other` and are not shown. - One generic ponytail has a few long strands hanging forward in the bind pose. Not looked into.
The link from a hair asset to its strand grooms is stored after all,
through name ids:

- an asset's GUID is the name id (first half of MurmurHash3 x64 128) of
  its placeholder drawable's name;
- the piece table lists the asset's pieces by the name ids of their
  files (placeholder name without _full, then a piece word);
- the archive's table of contents gives every file its name id (column
  73bcb72dce74f11f).

hairlink now builds the table from these when the table of contents can
be read: 878 hair, beard, brow, lash and body-hair assets, in seconds.
The inferred walk stays as the fallback and is marked as such. Against
the exact table the walk was often wrong, also at a high probability.

Viewer: an exact link is kept whole (no on-head filter, no percentage),
and linked body hair still starts hidden.

Grooms: a piece that stores only clump strands (first count 0 in every
root triangle) grew no strands; it now grows from its second count.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:23:31 +00:00
github manually merged commit 5efb47cbf2 into gh-pr/273/base 2026-11-26 20:23:32 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.