WIP: Character creator: archetypes, a clothes browser, necklines and anime clothes #137
Draft
khyretos
wants to merge 3 commits from
khyretos/claude/creator-polish into claude/creator-wardrobe
AGit
pull from: khyretos/claude/creator-polish
merge into: khyretos:claude/creator-wardrobe
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!137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "khyretos/claude/creator-polish"
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?
Stacked on #136 (wardrobe) -> #135 (anime) -> #134 (clothes). Female/Male archetype instead of a gender slider, body types Petite and Model with ideal proportions, smooth necklines, a scrolling clothes grid with 113 generated pictures, and the wardrobe on the VRoid anime avatars. 1351 tests pass. Full body: handoff files/creator-polish-pr.md. Not done: hair (measured fine, needs a screenshot), Blender base models.
Title
WIP: Character creator: archetypes, a clothes browser, necklines and anime clothes
User description
Stacked on #136 (wardrobe) -> #135 (anime) -> #134 (clothes). Female/Male archetype instead of a gender slider, body types Petite and Model with ideal proportions, smooth necklines, a scrolling clothes grid with 113 generated pictures, and the wardrobe on the VRoid anime avatars. 1351 tests pass. Full body: handoff files/creator-polish-pr.md. Not done: hair (measured fine, needs a screenshot), Blender base models.
PR Type
Enhancement
Description
Replaces gender slider with Female/Male archetype buttons
Adds smooth open necklines and a scrolling clothes browser
Enables anime VRoid avatars to wear realistic garment cuts
Diagram Walkthrough
File Walkthrough
9 files
Refactors anatomy for smooth necklines and GarmentBody supportImplements VRoid avatar dressing with garment cuts and skirtsAdds archetype buttons body type presets and clothes browserGenerates garment thumbnails via software rasterizerDefines GarmentBody struct and new garment piece functionsDeclares VrmStock and dressVrm function for anime avatarsAdds archetype body type and outfit tracking fieldsRestructures panel as column with scrolling clothes gridAdds archetype buttons slot tabs and card-based clothes view2 files
Tests neckline curves and garment thumbnail existenceValidates VRoid avatar dressing and skirt winding1 files
Builds garment_thumbs tool and copies thumbnail assets5 files
Licenses creator UI and generated garment thumbnailsDocuments anime clothes system and VRoid avatar dressingUpdates character creator asset list with thumbnailsExplains clothes browser layout and neckline fixesUpdates feature list to include archetypes and anime3 files
PR Reviewer Guide 🔍
(Review updated until commit
b89aee690c)📋 Focus areas: 🔴 5 open · ✅ 8 handled. Every push re-checks them; a handled area moves to Resolved findings at the bottom.
Incorrect Default Offset for 'top' Function
The default value for the
offsetparameter in thetopfunction was changed from0.003fto0.0075f. This change affects all new top garments that do not explicitly specify an offset, potentially altering their fit relative to the body suit compared to previous behavior or expectations.Hard-coded Gender Initialization
In
init(), the code setsm_human->set("macrodetails/Gender", 0.0f)unconditionally. While this is immediately overridden by theapplyArchetypecall if theKKE_CREATOR_GENDERenvironment variable is set, this initialization order creates a race condition where the human model is temporarily forced into female before the archetype logic runs. If the environment variable is missing or empty, the gender remains female. This hard-coding contradicts the PR description's intent of "Female/Male archetype instead of a gender slider" and should be removed or made conditional to avoid unintended side effects during initialization.Missing Error Handling for Garment Loading
The
dressVrmfunction iterates over clothes and callsfindGarment(w.id). If a garment ID is invalid or the file is missing,findGarmentreturnsnullptr, causing the loop to silently skip that garment without logging a warning or error. This makes debugging wardrobe issues difficult as the user might expect a specific item to appear but see nothing with no indication of why.Silent Failure on Missing Garments
The tool checks if a garment exists using
findGarment(id), but if it doesn't, it prints an error message and returns1. However, if the tool is run without arguments (generating thumbnails for all garments), it relies ongarments()which might return empty or fail silently depending on implementation details not visible here. More critically, if a specific garment ID is passed that doesn't exist, the tool exits with an error code, which is correct, but the lack of a try-catch block around the main logic means any unexpected exception will crash the tool rather than being handled gracefully.Hardcoded hairline threshold
The
hairstyleOnHeadfunction in HumanHair.cpp uses a hardcodedhairline = 1.0fparameter when calling itself (line 107). This value is passed to the function signature which defaults to1.0fif not provided, but the comment above the function declaration suggests it represents "how far down the forehead it grows". A fixed value of 1.0f may not correctly handle different head shapes or hairstyles that require varying hairline positions. The code should either pass an appropriate calculated value or allow the caller to specify this parameter explicitly based on the hairstyle type.ℹ️ Chunked review: the diff exceeded the model token budget, so it was reviewed in 2 chunks and the per-chunk results were merged.
✅ Resolved findings
tools/garment_thumbs/main.cpp:80-81
Hardcoded gender and proportions for thumbnails
The thumbnail generator hardcodes
Genderto0.0f(female) andBodyProportionsto0.7f(Model). This means thumbnails for male archetypes or other body types will always be generated using the female Model body. This creates a mismatch between the actual available clothes (which support male archetypes) and their preview images, potentially misleading users about how clothes fit different archetypes.tests/test_vrm_clothes.cpp:14-16
Missing Error Handling for File Loading
The test function
avatarcallskke::loadVrmwith a constructed file path. If the asset files (e.g., "HairSample_Female.vrm") are missing from the build directory or the path is incorrect,loadVrmwill likely return an invalid or null avatar object. The subsequent code accesses members of this object (likea.model.meshes) without checking if the load succeeded. This could lead to undefined behavior, crashes, or silent test failures depending on howloadVrmhandles errors. The test should verify that the avatar loaded successfully before proceeding with assertions.engine/src/HumanClothes.cpp:46
Incorrect default offset for 'top' garments
The default
offsetparameter in thetopfunction was changed from0.003fto0.0075f. This affects all top garments that do not explicitly specify an offset (e.g., "t-shirt", "polo"). While this might be intentional for visual spacing, it is a significant change to the default behavior of existing garment definitions and could cause tops to sit too far out on the body unless carefully audited.engine/src/HumanHair.cpp:88
Potential Logic Error in Hair Growth Condition
Line 88 introduces a new condition for hair growth (
grows). The logicabove > 0.18f - 0.25f * std::clamp(-forward - 0.6f, 0.0f, 1.0f)calculates a threshold based on theforwardvector. While the intent seems to be adjusting the growth threshold based on forehead position, the term-0.25f * ...subtracts a positive value from0.18f. This lowers the threshold asforwardbecomes more negative (further back on the head). It is unclear if this specific mathematical relationship correctly models the desired hairline geometry compared to the previous hardcoded0.62ffor the forehead. Without a visual reference or detailed geometric analysis, it's difficult to confirm this change doesn't cause hair to grow in unintended areas or fail to grow where it should.engine/src/VrmClothes.cpp:42
Missing fallback for missing skin meshes
In the
preparefunction, ifst.skinMeshesis empty, the function returns early without populating thebodystructure. Later,garmentPiecesOncallsgarmentSkirtwhich accessesst.body. Ifst.bodyis uninitialized or incomplete due to the early return, accessing its members (likewaist,sole) could lead to undefined behavior or incorrect calculations when dressing VRoid avatars that lack a skin mesh group.engine/src/modules/CharacterCreatorModule.cpp:382-386
Missing Error Handling for Environment Variables
The code reads environment variables
KKE_CREATOR_GENDER,KKE_CREATOR_PRESET, andKKE_CREATOR_CLOTHESwithout checking if they are null or empty before parsing. If an environment variable is set to an invalid string (e.g., "abc" for GENDER),std::strtofwill return 0.0f, potentially causing unexpected behavior like defaulting to female when a user intended to set a specific value or pass garbage data. While the impact might be limited to defaulting, explicit validation improves robustness.engine/src/modules/CharacterCreatorModule.cpp:966
Potential Logic Error in Archetype Application
In
applyArchetype, the function callssetBodyType(m_bodyType)to apply the build sliders. However,setBodyTyperesets all sliders to their default values before applying the preset's specific values. This means that if a user has manually adjusted individual sliders (like Muscle or Weight) before switching archetypes, those manual adjustments will be lost when the archetype changes, even though the body type name remains the same. The logic assumes the body type definition is the sole source of truth for the build, ignoring intermediate user modifications.tests/test_human.cpp:640
Hardcoded Path Dependency in Test
The test
EveryGarmentHasAThumbnailusesKKE_SOURCE_DIRto locate thumbnail files. If this macro is not defined correctly in the test build configuration or if the test is run from a different directory structure than expected, the test will fail with a false negative regarding missing thumbnails rather than reporting the actual issue. It is better to use a relative path or ensure the macro is guaranteed to be set in the test environment.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.