WIP: Character creator: a wardrobe of a hundred garments in the body's own fabrics #136
Draft
khyretos
wants to merge 1 commit from
khyretos/claude/creator-wardrobe into claude/creator-anime
AGit
pull from: khyretos/claude/creator-wardrobe
merge into: khyretos:claude/creator-anime
khyretos:main
khyretos:renovate-hold-imgui-rnnoise
khyretos:gh-pages
khyretos:windows-results
khyretos:renovate/font-awesome-7.x
khyretos:lint-fix/yaml_prettier
khyretos:renovate/https-code.forgejo.org-forgejo-upload-artifact-5.x
khyretos:renovate/https-code.forgejo.org-forgejo-download-artifact-7.x
khyretos:renovate/https-code.forgejo.org-actions-cache-6.x
khyretos:renovate/xiph-rnnoise-0.x
khyretos:renovate/cmake-mirrors-non-major
khyretos:lint-fix/json_prettier
khyretos:lint-fix/bash_shfmt
khyretos:ci/coverage-ccache
khyretos:ci/speed-ccache-jobs
khyretos:claude/integration
khyretos:claude/creator-vitruvian-wip
khyretos:claude/park-engine-foundations
khyretos:claude/park-parity
khyretos:claude/jiggle-skeleton-base
khyretos:claude/creator-polish-base
khyretos:claude/creator-polish
khyretos:claude/creator-wardrobe
khyretos:claude/creator-anime
khyretos:claude/creator-clothes
khyretos:pre-release
khyretos:release
khyretos:claude/mpm-water
khyretos:lint-fix/markdown_markdownlint
khyretos:claude/lua-nav
khyretos:claude/creator-hair
khyretos:claude/dynamic-navmesh
khyretos:claude/lua-audio
khyretos:claude/save-slots
khyretos:archive/2026-10-24/clothref
khyretos:archive/2026-10-24/f01aref
khyretos:archive/2026-10-24/f02aref
khyretos:archive/2026-10-24/f12ref
khyretos:archive/2026-10-24/g18eref
khyretos:archive/2026-10-24/g19aref
khyretos:archive/2026-10-24/g19b2
khyretos:archive/2026-10-24/g19bref
khyretos:archive/2026-10-24/g19cref
khyretos:archive/2026-10-24/g19dref
khyretos:archive/2026-10-24/reflA
khyretos:archive/2026-10-24/reflB
khyretos:khyretos/rhi-shaders
khyretos:claude/rhi-light-sets
khyretos:claude/rhi-pipeline-state
khyretos:archive/2026-10-24/r1gref
khyretos:archive/2026-10-24/ciref
khyretos:archive/2026-10-24/r1eref
khyretos:archive/2026-10-24/r1dref
khyretos:archive/2026-10-24/r1cref
khyretos:archive/2026-10-24/r1bref
khyretos:archive/2026-10-24/r1aref
khyretos:archive/2026-10-24/f13ref
khyretos:archive/2026-10-24/f11ref
khyretos:archive/2026-10-24/f10dref
khyretos:khyretos/ci-on-prs
khyretos:archive/2026-10-24/f10cref
khyretos:archive/2026-10-24/f10bref
khyretos:claude/bloom
khyretos:archive/2026-10-24/f10ref
khyretos:archive/2026-10-24/f08ref
khyretos:archive/2026-10-24/f07ref
khyretos:archive/2026-10-24/f05bref
khyretos:archive/2026-10-24/f05ref
khyretos:archive/2026-10-24/f03ref
khyretos:archive/2026-10-24/f02cref
khyretos:benchmark-data
khyretos:claude/cloth-passes
khyretos:archive/2026-10-24/f02bref
khyretos:archive/2026-10-24/refl-merge-base
khyretos:archive/2026-10-24/claude-b087-ref
khyretos:archive/2026-10-24/claude-macos-cross
khyretos:archive/2026-10-24/claude-macos-ref
khyretos:archive/2026-10-24/stash-macos-ref
khyretos:archive/2026-10-24/claude-win-probe
khyretos:patches/inbox
khyretos:tennis-feedback-wip
khyretos:archive/2026-10-24/runner-kit-check
No reviewers
Labels
No labels
deps
deps-major
hold
security
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
khyretos/kk-engine!136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "khyretos/claude/creator-wardrobe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Requested by Kees · project thread
Stacked on the anime PR #135 (base
claude/creator-anime), which stacks on the clothes PR #134. One commit. Merge order: #134, #135, then this.WIP: visual work. Kees's look-OK needed before merging; then drop the WIP prefix.
Kees (10-27): "since we have our own cloth and physics simulations, make some base shirts, pants, shoes etc, at least like 100 items, to render them in game so I can test the character creator fully."
What
Eleven garments were each a hand-written cut of MakeHuman's body suit. Now every garment is a line in a table (
HumanClothes.cpp): a cut (sleeve, neckline, hem, length), a layer offset, aclothFabric()preset and its own colour. 113 garments in seven slots: tops (32), outerwear (20), bottoms (15), skirts (12), dresses (12), socks (6), shoes (11), gloves (5). Adding one is adding a line.garmentPieces(): a dress is a bodice from the suit and a skirt of cloth; a long coat, trench, duster, kimono or cape is a jacket and its tails.garmentShape()stays as the first piece.bodygroup), the only pieces not from the suit.garmentMaterial: roughness and gloss).garmentSlots(),garmentSlotsClash()(a dress takes the top's and the bottom's place). The creator'swear(), random outfits (dress 25%, coat 30%, gloves 15%), the self-test (counts pieces), the Clothes tab (seven sections) and the colour-slot buttons follow.dressUp()logs what it fitted:clothes: 6 piece(s), 2 as cloth: slip dress, trench coat, opera gloves, thigh boots.Still plain colours with the fabric's weave and sheen, no printed textures (MakeHuman's
.mhcloclothes remain the next step for that).Tests
HumanClothes.EveryGarmentHasItsPart: >= 100 garments, every piece has vertices, a known fabric and slot; necklines and sleeves take cloth away (V < crew, deep V < V, tank < tee < three-quarter < long); dresses are two pieces; slot clashes.HumanClothes.DressedBakeIsOneSkinnedModel: a dress gives two meshes, gloves a skinned one from the skin; satin shinier than wool.kke_tests: 1346 passed.files/shots/(I could not view them myself: Kees's look is needed).🤖 Generated with Claude Code
Title
WIP: Character creator: a wardrobe of a hundred garments in the body's own fabrics
User description
Requested by Kees · project thread
Stacked on the anime PR #135 (base
claude/creator-anime), which stacks on the clothes PR #134. One commit. Merge order: #134, #135, then this.WIP: visual work. Kees's look-OK needed before merging; then drop the WIP prefix.
Kees (10-27): "since we have our own cloth and physics simulations, make some base shirts, pants, shoes etc, at least like 100 items, to render them in game so I can test the character creator fully."
What
Eleven garments were each a hand-written cut of MakeHuman's body suit. Now every garment is a line in a table (
HumanClothes.cpp): a cut (sleeve, neckline, hem, length), a layer offset, aclothFabric()preset and its own colour. 113 garments in seven slots: tops (32), outerwear (20), bottoms (15), skirts (12), dresses (12), socks (6), shoes (11), gloves (5). Adding one is adding a line.garmentPieces(): a dress is a bodice from the suit and a skirt of cloth; a long coat, trench, duster, kimono or cape is a jacket and its tails.garmentShape()stays as the first piece.bodygroup), the only pieces not from the suit.garmentMaterial: roughness and gloss).garmentSlots(),garmentSlotsClash()(a dress takes the top's and the bottom's place). The creator'swear(), random outfits (dress 25%, coat 30%, gloves 15%), the self-test (counts pieces), the Clothes tab (seven sections) and the colour-slot buttons follow.dressUp()logs what it fitted:clothes: 6 piece(s), 2 as cloth: slip dress, trench coat, opera gloves, thigh boots.Still plain colours with the fabric's weave and sheen, no printed textures (MakeHuman's
.mhcloclothes remain the next step for that).Tests
HumanClothes.EveryGarmentHasItsPart: >= 100 garments, every piece has vertices, a known fabric and slot; necklines and sleeves take cloth away (V < crew, deep V < V, tank < tee < three-quarter < long); dresses are two pieces; slot clashes.HumanClothes.DressedBakeIsOneSkinnedModel: a dress gives two meshes, gloves a skinned one from the skin; satin shinier than wool.kke_tests: 1346 passed.files/shots/(I could not view them myself: Kees's look is needed).🤖 Generated with Claude Code
PR Type
Enhancement
Description
Adds 100+ garments via data-driven cuts in HumanClothes.cpp
Implements multi-piece garments like dresses and coats
Introduces fabric presets for cloth simulation and shading
Updates UI to show seven clothing slots including gloves
Diagram Walkthrough
File Walkthrough
4 files
Replaces hardcoded garments with data-driven table of 113 itemsAdapts dressing logic for multi-piece garments and glovesExtends API with garmentPieces, garmentSlots, and material functionsAdds UI sections for outerwear, dress, and gloves1 files
Adds tests for garment count, pieces, and slot clashes2 files
Rewrites clothes section to explain new system and fabricsUpdates README to mention 100+ garments and fabric presetsPR Reviewer Guide 🔍
📋 Focus areas: 🔴 3 open · ✅ 0 handled. Every push re-checks them; a handled area moves to Resolved findings at the bottom.
Missing Error Handling for Empty Garment Lists
In
dressUp()(line 1270), the code iterates overm_look.clothesand callsfindGarment()for each ID. If a garment ID is invalid or missing from the table,findGarment()returnsnullptr, but the loop continues without skipping that iteration. This could lead to undefined behavior when accessinginfo->slotor other fields later in the logic. The code should explicitly check ifinfoisnullptrand skip processing that garment.Potential Null Pointer Dereference in Random Outfit Generation
In
randomise()(line 967-978), the code generates random outfits by iterating overgarmentSlots(). For each slot, it collects valid garments into a vectorin. However, ifinis empty (e.g., no garments defined for a slot), the code proceeds to line 973 where it checksif (in.empty() || u(m_rng) > chance) continue;. While this check prevents dereferencing an empty vector, the logic at line 976 assumesgis non-null. Ifinis not empty butu(m_rng)selects an index out of bounds (unlikely due tostd::uniform_int_distribution), it could cause issues. More importantly, the code does not validate thatgis non-null before using it. A safer approach would be to add an explicit null check after selectingg.Inconsistent Material Roughness Calculation
In
garmentMaterial()(line 453-463), the roughness is calculated asfabric.roughness - 0.3f * fabric.specular, clamped between 0.2f and 0.95f. However, in the old code (before this PR), the roughness was hardcoded based on garment type (e.g., 0.5f for shoes, 0.85f for others). This change introduces a dependency on theclothFabric()preset's properties, which may not be consistent across all fabrics. For example, if a fabric has a very low specular value, the resulting roughness might be too high, leading to unrealistic shading. Consider adding a fallback or validation to ensure the roughness remains within expected ranges for different fabric types.PR Code Suggestions ✨
No code suggestions found for the PR.
🧹 Lint report · ❌ 38 problems in 6 checks · 🧹 3 formatting checks to tidy
Nothing here blocks the merge (report only).
MARKDOWN · markdownlint: first lines of the output
CPP · cppcheck: first lines of the output
YAML · yamllint: first lines of the output
BASH · shellcheck: first lines of the output
DOCKERFILE · hadolint: first lines of the output
REPOSITORY · trivy: first lines of the output
🧹 Formatting only (layout, no behaviour; the nightly lint-fix job applies these as a PR): YAML · prettier (57 files checked), BASH · shfmt (11 files checked), JSON · prettier (147 files checked)
✅ Clean: actionlint, git_diff, gitleaks, grype, jsonlint, secretlint, stylelint, trufflehog, xmllint
MegaLinter on soucouyant · full logs in the Actions run · comment
/improvefor AI fix suggestionsView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.