Skip to content

Register a converted pack's colors for its own species - #2

Open
BYGGOLDENSTONE wants to merge 2 commits into
Tiny-Hawk:mainfrom
BYGGOLDENSTONE:add-species-aware-colors
Open

Register a converted pack's colors for its own species#2
BYGGOLDENSTONE wants to merge 2 commits into
Tiny-Hawk:mainfrom
BYGGOLDENSTONE:add-species-aware-colors

Conversation

@BYGGOLDENSTONE

Copy link
Copy Markdown
Contributor

Per our Discord chat — here's the colors half, on its own branch so you can review it on its own. (Physics is a separate PR; this one doesn't touch it.)

Symptom

Converting a non-human pack and then selecting that species in the Sidekick Character Creator shows only the Species color dropdown — Outfits / Attachments / Materials are missing, even though the Unity version of the same pack shows them. With some packs a scheme also lands in the wrong category (e.g. Sci-Fi Robots plating showing up under Elements). Human packs are unaffected.

Root cause

register_color_schemes.py files every pack's schemes under the Human species and only into the Outfits/Attachments groups:

OUTFIT_COLOR_GROUPS = (2, 3)
...
species = connection.execute("SELECT id FROM sk_species WHERE code='HN'").fetchone()

The toolkit's Presets tab gates a color category by the selected species (SSKPresetMenuWidget::ColourUIVisibility hides a group unless that species has ≥1 preset in it), so a non-human species ends up with nothing but its base Species entry.

Fix

Detect the pack's species from the part-name suffix (..._SN01 → Skeleton; the mesh suffix uses HU for the Human whose DB code is HN) and register accordingly:

  • Species (skin / plating) colors → under the pack's own species.
  • Outfits / Attachments → under Human (the shared pool).
  • Only the groups an atlas actually fills (≥ 50% non-sentinel) are written.
  • Materials / Elements are never written from an atlas. They're the base-curated sets (Materials 01–10, Elements 01); writing pack pixels into them is what mis-filed robot plating as an Element.

Then, to match the Unity tool (where the shared pools show for every species), each non-human species converted in the batch gets Human's Outfits / Attachments / Materials pools replicated onto it — keyed off the species being present, not off what its atlas fills, so a species that only ships skin colors (a zombie wearing human outfits) still gets the full menu. Elements stays Human-only. The replication is idempotent and leaves a species' own unique presets (e.g. Goblin's) untouched.

Compatibility

The manifest gains a third column (name\tcolormap.png\tspecies_code); a missing third column defaults to HN, so older manifests still work.

Tested

Starter (Human, regression-checked), Fantasy Skeletons, Sci-Fi Robots, Apocalypse Zombies — each species now shows the right categories, correctly filed; re-running is idempotent.

The color registrar wrote every pack's schemes under the Human species
(WHERE code='HN') and only into the Outfits/Attachments groups, so a
non-human pack's species showed only the base Species color category --
Outfits/Attachments/Materials were missing, and some schemes (e.g. robot
plating) landed in the wrong category.

This detects the pack's species from the part-name suffix and:
  - writes Species (skin/plating) colors under the pack's own species and
    Outfits/Attachments under Human (the shared pool), per the groups the
    atlas actually fills;
  - never writes Materials/Elements from an atlas (they stay the base-
    curated sets, so pack colors no longer mis-file there);
  - replicates Human's Outfits/Attachments/Materials onto each non-human
    species so its menu matches the Unity tool, keyed off the species being
    present (so a zombie wearing human outfits still gets the menus).

The manifest gains an optional species_code column (defaults to HN), so
older manifests keep working.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Tiny-Hawk
Tiny-Hawk self-requested a review June 28, 2026 19:02
Synty's own database keeps Human's Species list as just the 10 base skin
tones; its human packs add only Outfit/Attachment colors. Writing a pack's
Species swatches under Human duplicated the base skin tones. Skip the
Species group when the target species is Human; non-Human species still get
their own species colors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant