Textures: Used by lists heads and characters for ped skin textures #105

Manually merged
github merged 1 commit from gh-pr/105/head into gh-pr/105/base 2026-11-26 20:10:12 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 02:42 UTC · original
holdmysocks:fix/related-textures-heads → master · +214 −1 · 3 files · 1 commits · merged 2026-11-24 03:01 UTC

Fixes #96.

The bug

"Used by" in the Textures tab said "No material in the indexed models uses this texture" for head textures. It is wider than heads: no drawable binds ped skin textures at all. A head's face colour and normal, the body's normal, detail and mask maps, and the eyes' colour are named only by wardrobe items (States -> Asset), so the texture-users index, which is built from model materials, has nothing for them. Checked against the index: a face albedo, a face normal, a body normal, a body mask, a body detail map and an eye albedo all have zero users; a teeth albedo has four (teeth drawables bind theirs).

The fix

  • pedlook::wardrobe_textures: store hash -> (wardrobe resource, head drawable named by the item's tag 4bfd27dd), built once from the packs index (about a minute) and cached as <work>/index/wardrobe_textures.json (11 MB).
  • Textures tab: when no material uses the selected texture, "Used by" lists the heads the wardrobe items name and the named characters whose wardrobe has the texture, each a link that opens it in the Model viewer, and counts the wardrobes of models without a name in the index. A window screenshot waits for the lookup.

Verified

  • Window screenshots on the integrated GPU: a face albedo lists 1 head and 1 character; a body normal lists 42 characters and 880 other wardrobes; an eye albedo lists 21 characters and 1,561 other wardrobes.
  • cargo test --workspace: 144 core and 12 viewer tests pass.

Not verified

  • Clicking a link to open the head or character was not tried (it sets the same open_model the material list uses).
  • Textures used by both a model material and a wardrobe item show the materials only, as before.
  • A head is listed only when the item that names the texture also carries the head tag; a face named by a parent item shows under its character instead.
  • macOS Metal renderer not run.

Files

crates/sixng-core/src/pedlook.rs (one new table), crates/sixng-gui/src/texture_view.rs, README.md.

**@⁠holdmysocks** on GitHub · 2026-11-24 02:42 UTC · [original](https://github.com/holdmysocks/SixNG/pull/105) `holdmysocks:fix/related-textures-heads` → `master` · +214 −1 · 3 files · 1 commits · merged 2026-11-24 03:01 UTC Fixes #96. ## The bug "Used by" in the Textures tab said "No material in the indexed models uses this texture" for head textures. It is wider than heads: no drawable binds ped skin textures at all. A head's face colour and normal, the body's normal, detail and mask maps, and the eyes' colour are named only by wardrobe items (`States` -> `Asset`), so the texture-users index, which is built from model materials, has nothing for them. Checked against the index: a face albedo, a face normal, a body normal, a body mask, a body detail map and an eye albedo all have zero users; a teeth albedo has four (teeth drawables bind theirs). ## The fix - `pedlook::wardrobe_textures`: store hash -> (wardrobe resource, head drawable named by the item's tag `4bfd27dd`), built once from the packs index (about a minute) and cached as `<work>/index/wardrobe_textures.json` (11 MB). - Textures tab: when no material uses the selected texture, "Used by" lists the heads the wardrobe items name and the named characters whose wardrobe has the texture, each a link that opens it in the Model viewer, and counts the wardrobes of models without a name in the index. A window screenshot waits for the lookup. ## Verified - Window screenshots on the integrated GPU: a face albedo lists 1 head and 1 character; a body normal lists 42 characters and 880 other wardrobes; an eye albedo lists 21 characters and 1,561 other wardrobes. - `cargo test --workspace`: 144 core and 12 viewer tests pass. ## Not verified - Clicking a link to open the head or character was not tried (it sets the same `open_model` the material list uses). - Textures used by both a model material and a wardrobe item show the materials only, as before. - A head is listed only when the item that names the texture also carries the head tag; a face named by a parent item shows under its character instead. - macOS Metal renderer not run. ## Files `crates/sixng-core/src/pedlook.rs` (one new table), `crates/sixng-gui/src/texture_view.rs`, `README.md`.
No drawable binds ped skin textures (a head's face, the body's normal,
detail and mask maps, the eyes' colour): wardrobe items name them, so the
texture-users index had nothing and Used by said no material uses them.
For such a texture the panel now lists the heads the wardrobe items name
and the named characters whose wardrobe has it, each opening in the Model
viewer, from a table built once from the packs index
(<work>/index/wardrobe_textures.json).

Fixes #96.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:10:10 +00:00
github manually merged commit dd23f11b44 into gh-pr/105/base 2026-11-26 20:10:12 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.