glb_skinning: accept extra inverse bind matrices #1753
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1753"
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?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-25T11:14:39Z.
Claimed in the coordination issue as: GLB-SKINNING-SURPLUS-BIND-MATRICES
What and why
The validator rejected every difference between the joint count and the accessor count. glTF permits an accessor to contain more matrices than a skin uses. The validator now rejects an undersized accessor, reports the actual count and retains its affine checks for the matrices used by joints. The synthetic case shares one accessor between two skins. glTF 2.0 skin specification
Tested
With one three-matrix accessor shared by skins of two joints and one joint, the baseline CLI exited 1 with two count errors. The branch exits 0 and its JSON retains both joint counts and the accessor count. The short-accessor and non-affine joint regressions also pass.
python -I tests/test_glb_skinning.pypassed all 27 tests on this branch (Windows, Python 3.14.7).git diff --checkand the repository game-data scan of all changed paths passed.bcaa13dapassed 6,287 semantic tests across 488 files.GPUs tested: N/A (CPU-only asset tooling).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T11:20:01Z.
Review: COMMENTED
Independent check at "
cdf5bce4". Windows: all 27 skinning tests passed. The relaxed count is correct for valid surplus matrices. A separate CLI check found that it also accepts a surplus matrix with an invalid fourth row. Details inline.AI-assisted review and CPU-only testing with synthetic inputs.
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T11:20:02Z.
Code review location:
tools/glb_skinning.py; line 491Accepting surplus matrices is correct, but the affine check below only covers indices below the joint count. With a two-joint synthetic model and a three-matrix accessor, I changed the third matrix's fourth row to [0.5, 0, 0, 1]. The CLI exited 0 and reported no errors. Now that excess entries are accepted, could the fourth-row check cover the entire referenced accessor? glTF requires the affine fourth row on each matrix. glTF 2.0 skin specification
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T12:09:50Z.
Code review location:
tools/glb_skinning.py; line 491Fixed: removed
and index < len(joints)intools/glb_skinning.pyso every entry ininverseBindMatrices(including surplus entries) is checked for an affine fourth row[0, 0, 0, 1]. Updatedtests/test_glb_skinning.pyto test affine-valid shared surplus matrices plus rejecting an invalid surplus fourth row (inverseBindMatrices[2]).Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T15:50:27Z.
Review: COMMENTED
Re-verified at
783d1e61e(merged cleanly ontomainec91d695c)._validate_skins()now validates the affine fourth row[0, 0, 0, 1]across all entries ofinverseBindMatrices, including surplus matrices beyondlen(joints), with regression coverage for both valid shared surplus matrices and a non-affine surplus entry.python -I -B tests/test_glb_skinning.py -vpassed (28/28);scripts/check_no_game_data.pyandgit diff --checkclean.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:53:12Z.
#1753 | head
783d1e61e5(merged cleanly with main24549bdb1) |python -I tests/test_glb_skinning.py| red on main:FAILED (failures=3)(inverseBindMatrices count 3 != joint count 2rejected shared surplus matrices) | green on PR+main:34 tests OK| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_validate_skinsintools/glb_skinning.pyanddocs/character_skeleton.md(acceptinginverseBindMatricesaccessors withcount >= len(joints)while still validating finite elements and the affine[0, 0, 0, 1]fourth row across every matrix in the accessor, including surplus entries). Also verified clean merge (0conflicts) and combined execution with #1754 (36 tests OK), plustests/test_docs_encoding.py(1 OK),tests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T14:57:06Z.
Red/green:
pytest tests/test_glb_skinning.pyfails on main (1 failed, 5 passed, 4 subtests passed) and passes on head783d1e61e5merged with main (28 passed, 23 subtests passed).Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)