Repository navigation
Conversation
Refine each inherited rig bone from the original sample grid and merge the results so subdivision depth cannot compound across bones. Normalize quaternions for the angular-error comparison and add regressions for bounded rig sampling and animation fidelity. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
There was a problem hiding this comment.
🟢 Approval recommended
The localized changes address compounded sampling growth with focused regression coverage and no unresolved review findings.
No open issues 🎉
What changed in this PR
This PR fixes excessive animation sampling growth in the FBX loader by preventing refinement from compounding across bones, without changing public APIs or loader options.
Changes:
- Refine each bone from the original sample intervals, then merge results into a shared, sorted sampling grid.
- Normalize quaternions before measuring angular error to avoid unnecessary subdivisions.
- Add regression coverage for refinement bounds, rotation stability, and authored sample-time preservation.
| File | Description |
|---|---|
| packages/dev/loaders/test/unit/FBX/skeletalAnimation.test.ts | Adds a four-bone regression test enforcing bounded refinement and complete clip coverage. |
| packages/dev/loaders/test/unit/FBX/animationSampling.test.ts | Tests stable rotations, authored times, and the subdivision depth limit. |
| packages/dev/loaders/src/FBX/fbxFileLoader.pure.ts | Prevents compounded refinement and normalizes quaternion error comparisons. |
Review effort: Balanced
|
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/19050/merge/index.html#WGZLGJ#4600 Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves): https://playground.babylonjs.com/?snapshot=refs/pull/19050/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/19050/merge#BCU1XR#0 If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools. |
🟢 Memory Leak Test Results4 passed, 0 leaked out of 4 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (4)
|
|
WebGL2 visualization test reporter: |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
|
Visualization tests for WebGPU |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🟢 Memory Leak Test Results4 passed, 0 leaked out of 4 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (4)
|
|
WebGL2 visualization test reporter: |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
|
Visualization tests for WebGPU |
Summary
Fix the out-of-memory failure when importing animated Mixamo FBX files reported in this forum topic.
_buildInheritedRigBoneAnimations()previously fed each bone's refined sample-time array into the next bone's refinement pass. Although each pass limits recursion to two levels, that limit restarted for each bone, allowing subdivisions to compound across the rig.Each bone now refines the same original sample intervals. The results are merged and sorted into a shared sampling grid. This preserves authored key times and adaptive refinement while bounding subdivisions to the existing depth limit independently of the number of animated bones.
Normalize the decomposed and interpolated quaternions used for the angular-error comparison. Small length errors, including the near-linear branch of quaternion interpolation, must not be interpreted as angular differences.
No public API or loader options change.
Regression coverage
Validation
mixamo.fbximports with the patched loader against Babylon.js 9.32.0 in a WebGL browser, without disabling refinement: 2 meshes, 1 skeleton, 1 animation group, 49 channels, approximately frames 0–505, and at most 2,499 keys per track. Animation advancement was confirmed after 120 rendered frames.Validation is scoped to the affected loader; no full-repository build or test run was performed.