anim_glb: bind weighted bones outside the skeleton as extra rest-pose joints #308

Open
github-bot wants to merge 1 commit from github-bot/gh-308 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 03:05 UTC · original
ubiquitarianism:old-pr/10043 → main · +95 −5 · 3 files · 1 commits · draft

Carried over from old PR 10043 by tedin7 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10043, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
tedin7: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

@ItsNotRexed: an exe PR, as you asked.

What

tools/anim_glb.py no longer refuses a clothing part whose weighted bones are not in the skeleton. New extend_joints adds one joint per weighted unknown bone hash, named bone_0x<hash>, as a child of the skeleton's first root with identity local transform and the root's inverse bind matrix. The export loop extends the joint list part by part (several parts share one joint per hash; earlier indices do not move). bind_part itself is unchanged and still refuses a hash the skeleton lists twice. Docs and module docstring updated.

Why

docs/character_skeleton.md measures 3,212 of 9,571 skinned part drawables that use bones outside both skeletons (mostly clothing cloth bones), and the exporter raised "weighted bones not in the skeleton" for all of them. The part has no skeleton of its own, so nothing about those bones can be read; the extra joint is the same bone_0x........ naming and parent-fallback skinned_glb.py already uses, and the root's inverse bind keeps every vertex at its stored rest position. No game data is used.

Tested

  • python3 -I -m pytest tests/test_anim_glb.py: 38 passed (2 new: extend_joints unit test, ~21 lines; two-part CLI export with a shared and an own cloth bone, ~38 lines, which also runs tools/glb_skinning.py on the output: exit 0).
  • Negative control: same tests against origin/main tool: 2 failed ("weighted bones not in the skeleton: 0x12345678"), 36 passed.
  • tests/test_skinned_glb.py + tests/test_glb_skinning.py: 55 passed, 1 skipped.
  • Not done: reading a part's own skeleton (docs say these drawables have none); extra joints are all attached to the root, no name-based parent guess since only hashes are known.
**@⁠Andretuta** on GitHub · 2026-11-24 03:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/308) `ubiquitarianism:old-pr/10043` → `main` · +95 −5 · 3 files · 1 commits · draft > Carried over from **old PR 10043** by `tedin7` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10043`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `tedin7`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): `@ItsNotRexed`: an exe PR, as you asked. ## What `tools/anim_glb.py` no longer refuses a clothing part whose weighted bones are not in the skeleton. New `extend_joints` adds one joint per weighted unknown bone hash, named `bone_0x<hash>`, as a child of the skeleton's first root with identity local transform and the root's inverse bind matrix. The export loop extends the joint list part by part (several parts share one joint per hash; earlier indices do not move). `bind_part` itself is unchanged and still refuses a hash the skeleton lists twice. Docs and module docstring updated. ## Why `docs/character_skeleton.md` measures 3,212 of 9,571 skinned part drawables that use bones outside both skeletons (mostly clothing cloth bones), and the exporter raised "weighted bones not in the skeleton" for all of them. The part has no skeleton of its own, so nothing about those bones can be read; the extra joint is the same `bone_0x........` naming and parent-fallback skinned_glb.py already uses, and the root's inverse bind keeps every vertex at its stored rest position. No game data is used. ## Tested - `python3 -I -m pytest tests/test_anim_glb.py`: 38 passed (2 new: `extend_joints` unit test, ~21 lines; two-part CLI export with a shared and an own cloth bone, ~38 lines, which also runs tools/glb_skinning.py on the output: exit 0). - Negative control: same tests against origin/main tool: 2 failed ("weighted bones not in the skeleton: 0x12345678"), 36 passed. - tests/test_skinned_glb.py + tests/test_glb_skinning.py: 55 passed, 1 skipped. - Not done: reading a part's own skeleton (docs say these drawables have none); extra joints are all attached to the root, no name-based parent guess since only hashes are known.
A clothing part whose weighted cloth or accessory bones are not in the master skeleton was refused whole. Each such hash now becomes a joint bone_0x<hash> under the skeleton root with identity local transform and the root's inverse bind, so the rest pose is unchanged; clips can still drive it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:52:48 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/308/head:github-bot/gh-308'
git switch 'github-bot/gh-308'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-308'
git switch 'github-bot/gh-308'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-308'
git switch 'github-bot/gh-308'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-308'
git switch 'main'
git merge --squash 'github-bot/gh-308'
git switch 'main'
git merge --ff-only 'github-bot/gh-308'
git switch 'main'
git merge 'github-bot/gh-308'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.