glb_inspect: count animation weights per mesh morph target #1486
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1486
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/glb-inspect-morph-weight-count"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: GLB-INSPECT-MORPH-WEIGHT-COUNT
What and why
Running
python -I tools/glb_inspect.py AnimatedMorphCube.glb --json report.jsonon the Khronos sample reports a count error on upstreamb4b7756e8c64. The animation has 127 keys and two morph targets, so all 254 scalar weights belong there. The old check also accepts an underfilled stream when its length happens to match what a single target would need.The inspector now resolves each weight channel's target mesh and checks the packed scalar count against its morph target count. LINEAR and STEP store one weight per target per key. CUBICSPLINE stores three per target per key. Checking the channel also identifies which mesh is incompatible when a sampler is shared. glTF 2.0 animation spec
Tested
issuesarray.python -I tests/test_glb_inspect.py -k test_morph_weightexercises eight CLI cases. All eight failed their assertions on the original implementation and passed after the fix. The fixtures cover valid and short streams for all three interpolation modes, a shared sampler, and a mesh with a static primitive before the animated one.ANIMATION_SAMPLER_OUTPUT_ACCESSOR_INVALID_COUNTfor all three underfilled fixtures.python -I tests/test_glb_inspect.py -von Windows and Ubuntu (WSL). Each ran 39 tests with one platform-specific skip and no failures.python -I scripts/check_no_game_data.py tools/glb_inspect.py tests/test_glb_inspect.pyandgit diff --checkpassed.python -I scripts/run_semantic_tests.py tests/semantic -j 12ran 6,223 tests across 476 files in 407 s with zero failing files.GPUs tested: N/A (CPU-only GLB inspection).
AI-assisted: Yes.
Checklist
main(cc22b7d4fd).[KEEP]
tools/glb_inspect.pyresolves each weights channel's target mesh and checks scalar counts against morph target count (x3 for CUBICSPLINE), with 3 new tests intests/test_glb_inspect.pycovering shared samplers and static-first primitives.MERGEABLE) and no duplicate open PRs for this fix.#1486 | head 89b4e9edf28ff76e0ed57dae8e2adbc4a00f381d (merged cleanly with main 1bc055e6c2) |
python -I tests/test_glb_inspect.py| red on main:FAILED (failures=8, skipped=6)(flagged valid multi-targetLINEAR/STEP/CUBICSPLINEmorph-weight outputs as mismatched, missed half-width outputs, missed shared-sampler width mismatches across meshes, and skipped primitives withouttargetson index 0) | green on PR+main:45 ran, OK (skipped=6)(39/39Windows-applicable testsOK) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/glb_inspect.pyandtests/test_glb_inspect.pyon Windows 11, verifying_morph_target_countacross primitives, channel-scoped_check_output_count(keys * target_count * (3 if CUBICSPLINE else 1)) forSCALARweightschannels (including shared samplers across meshes with different morph-target counts and nodes lacking morph targets), plustests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Tested
89b4e9edfmerged (no commit) withmain829530dbd: Python 3.12.4, Windows 11 10.0.26300, CPU only.check_no_game_data.pyis clean.tests/test_glb_inspect.py, 45 tests pass (1 skipped).tools/glb_inspect.pyback tomain, 8 failures (e.g.'channel[1]' not found in 'sampler[0] has 4 output values for 2 keys with LINEAR interpolation').No blocker from my side.
AI-assisted (Claude Code).
Merged after TheGeogeo's red/green check (check) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto
main8a35304fb without conflict, and its test file(s) (tests/test_glb_inspect.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.