Add TypeScript FBX loader#18483
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
|
I added two initial test models for visual testing to the assets repo. I need to build out all of the visual test variations, but wanted to get this in draft PR for review since it's large while I build out the visual test assets. |
|
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/18483/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/18483/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/18483/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. |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
🟢 Memory Leak Test Results13 passed, 0 leaked out of 13 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (13)
|
|
Just explaining the reason it fails on native (before fully reviewing this) - This PR uses BigInt syntax ( |
|
@RaananW I'll take care of it. We dont need bigint |
Remove bigint usage from the FBX loader and harden parser validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document SceneLoader callback parameters for FBX public loader methods. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
|
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/18483/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/18483/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/18483/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. |
|
WebGL2 visualization test reporter: |
🟢 Memory Leak Test Results13 passed, 0 leaked out of 13 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (13)
|
There was a problem hiding this comment.
Is the specs folder a thing now? I only see one file in this folder right now for tree shaking.
Popov72
left a comment
There was a problem hiding this comment.
Code review comments from Copilot CLI. I left out the quality-gate notes as requested.
…tion standards.
Changes made:
- Removed the standalone FBX architectural/spec documentation from `specs/fbx-loader`.
- Kept documentation coverage limited to source-level TSDoc/JSDoc for public API surfaces.
- Added missing TSDoc for `FBXFileLoaderMetadata`, `FBXFileLoader.name`, and `FBXFileLoader.extensions`.
- Fixed a changed-file lint issue in the FBX material tests by replacing the directory barrel import `core/Engines` with `core/Engines/nullEngine`.
Validation:
- Confirmed there are no remaining markdown/text documentation changes in the effective branch diff.
- Confirmed edited FBX source files have no VS Code diagnostics.
- Ran changed-file eslint coverage via `npx.cmd eslint ...`; it passes cleanly.
- Note: `npm run lint:changed` still exits with `ENOENT` in this Windows shell because the script uses `spawnSync("npx", ...)`, but the equivalent `npx.cmd` eslint command passes.
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
🟢 Memory Leak Test Results13 passed, 0 leaked out of 13 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (13)
|
Addresses Popov72's review comment on PR BabylonJS#18483: BabylonJS#18483 (comment) Read Materials[0] for LayerElementMaterial entries using MappingInformationType "AllSame" instead of assuming slot 0. Preserve non-zero all-same slots through triangulation so meshes with multiple connected materials resolve the intended material. Also fixes the FBX material test NullEngine import noted in: BabylonJS#18483 (comment)
Addresses Popov72's review comment on PR BabylonJS#18483: BabylonJS#18483 (comment) Validate that binary FBX data contains the full 27-byte header before reading the version field, so malformed files produce a controlled parse error instead of a raw RangeError.
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Addresses Popov72's review comment on PR BabylonJS#18483: BabylonJS#18483 (comment) Convert numeric typed arrays for Shape Indexes so ASCII FBX shorthand arrays parsed as Float64Array do not cause morph targets to be dropped.
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Addresses Popov72's review comment on PR BabylonJS#18483: BabylonJS#18483 (comment) Convert numeric typed arrays for KeyAttrFlags and KeyAttrRefCount so ASCII FBX shorthand arrays parsed as Float64Array preserve constant and cubic interpolation flags. Also add missing TSDoc for exported animation diagnostic types and curve sampling helpers touched by this change.
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Addresses Popov72's review comment on PR BabylonJS#18483: BabylonJS#18483 (comment) Reject numeric FBX object IDs that cannot be represented as safe JavaScript integers before they enter number-keyed object and connection maps. This prevents precision loss from miswiring materials, skins, animations, or hierarchy relationships. Also add missing TSDoc for exported FBX document and connection graph types touched by this change.
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Addresses Popov72's review comment on PR BabylonJS#18483: BabylonJS#18483 (comment) Continue traversing mesh subtrees when a parent mesh does not match meshesNames but a descendant does. Use a TransformNode placeholder for the filtered parent so requested child meshes can be imported with hierarchy preserved.
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
|
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/18483/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/18483/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/18483/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. |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
⚡ Performance Test Results🟢 All performance tests passed — no regressions detected. |
🟢 Memory Leak Test Results13 passed, 0 leaked out of 13 scenarios 🟢 All memory leak tests passed — no leaks detected. Passed Scenarios (13)
|
Popov72
left a comment
There was a problem hiding this comment.
The PR description still says this adds specs/fbx-loader documentation, but the latest commits remove that folder. Can you either restore the specs or update the PR description if the deletion is intentional?
Yes, the deletion was intentional, so I updated the PR description. |
Summary
Notes
BumpandBumpFactorslots are treated as normal-map-like inputs for compatibility until true grayscale height-to-normal conversion is implemented.Validation
npm run compile -w @dev/loadersnpm run test -- packages/dev/loaders/test/unitnpm run format:checknpm run lint:checkcurrently fails on pre-existing core tree-shaking manifest/side-effect-stub drift outside the FBX changes.