Hair export: strand colours (COLOR_0) and a coloured Blender material #344

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

@⁠holdmysocks on GitHub · 2026-11-26 03:03 UTC · original
holdmysocks:hair-colour → master · +147 −33 · 6 files · 4 commits · merged 2026-11-26 04:09 UTC

Hair export, part of #146: strand colours.

Builds on #342 (its commit is in this branch until #342 merges; the diff here adds one commit).

  • outfit --hair: each grown piece carries the colour the viewer gives its slot. That is the outfit's colour set for the slot, else the one the item names, looked up in the game's strand tables. Without a set there, the item's own colour presets are used (unless flagged as not a hair colour).
  • COLOR_0 (linear RGB) per point, along the strand's colour variant ramp from root to tip. Guides carry no colour. The mesh extras and the summary name the set (colour_set, its name hash) and colour_source (strand tables or item presets).
  • scripts/blender_hair_curves.py: reads COLOR_0 into a colour point attribute. Coloured pieces get a Principled Hair BSDF in colour parametrization, fed through a Gamma node (2). The BSDF reads its colour as the hair's overall colour, so the game's colours unsquared render near white. Pieces without colours keep the plain brown material.
  • README: the colour attribute, the extras and the material.

Checked on Jason (player_story000_01 --look 0): all 11 pieces take their set from the strand tables (hair, brows, lashes and beard sets). Hair is brown, darker at the root (linear 0.07, 0.045, 0.027 at the root, 0.21, 0.12, 0.075 at the tip), and the brows are darker. Blender 5.3 headless: 22 objects, 146,441 strands, each grown piece with a colour attribute and the coloured material. A Cycles render on the GPU shows brown hair and beard with lighter tips.

**@⁠holdmysocks** on GitHub · 2026-11-26 03:03 UTC · [original](https://github.com/holdmysocks/SixNG/pull/344) `holdmysocks:hair-colour` → `master` · +147 −33 · 6 files · 4 commits · merged 2026-11-26 04:09 UTC Hair export, part of #146: strand colours. Builds on #342 (its commit is in this branch until #342 merges; the diff here adds one commit). - `outfit --hair`: each grown piece carries the colour the viewer gives its slot. That is the outfit's colour set for the slot, else the one the item names, looked up in the game's strand tables. Without a set there, the item's own colour presets are used (unless flagged as not a hair colour). - `COLOR_0` (linear RGB) per point, along the strand's colour variant ramp from root to tip. Guides carry no colour. The mesh extras and the summary name the set (`colour_set`, its name hash) and `colour_source` (strand tables or item presets). - `scripts/blender_hair_curves.py`: reads `COLOR_0` into a `colour` point attribute. Coloured pieces get a Principled Hair BSDF in colour parametrization, fed through a Gamma node (2). The BSDF reads its colour as the hair's overall colour, so the game's colours unsquared render near white. Pieces without colours keep the plain brown material. - README: the colour attribute, the extras and the material. Checked on Jason (`player_story000_01 --look 0`): all 11 pieces take their set from the strand tables (hair, brows, lashes and beard sets). Hair is brown, darker at the root (linear 0.07, 0.045, 0.027 at the root, 0.21, 0.12, 0.075 at the tip), and the brows are darker. Blender 5.3 headless: 22 objects, 146,441 strands, each grown piece with a `colour` attribute and the coloured material. A Cycles render on the GPU shows brown hair and beard with lighter tips.
- grooms --full --head <model.glb> names each grown groom's head UV set,
  matched against that head (a model outfit wrote, or a head drawable
  exported on its own)
- The viewer's Export shown grooms button matches against the shown
  character's head as the viewer exported it
- Grown grooms carry their bones, so the Blender script can parent them
- The Blender script takes several hair files (one per groom)
- README: the set cannot be told from the kind of piece
Each grown piece carries the colour the viewer gives its slot: the
outfit's colour set for the slot, else the item's, from the game's strand
tables, else the item's own colour presets. COLOR_0 holds the linear
colour per point along the strand's variant ramp; the mesh extras name
the set (colour_set, colour_source). The Blender script reads it into a
colour point attribute that drives a Principled Hair BSDF.
# Conflicts:
#	README.md
#	crates/sixng-cli/src/main.rs
#	crates/sixng-core/src/groom.rs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:29:07 +00:00
github manually merged commit 2492870c9c into gh-pr/344/base 2026-11-26 20:29:07 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.