Skip to content

Conversation

@alexchuber
Copy link
Contributor

@alexchuber alexchuber commented Dec 18, 2025

This PR adds the remaining glTF configuration tools (Extensions config, loader plugin config, and validator) to the Inspector v2 Tools pane.|

Default view:
image

After loading new file and editing loader settings:
image

Features:

  • Configure all loader settings (bounding boxes, animations, materials, etc.)
  • Enable/disable glTF extensions and configure extension-specific properties
  • Real-time validation feedback with detailed report viewer
  • Animation import with merge mode configuration

@alexchuber alexchuber requested a review from ryantrem December 18, 2025 22:33
@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

Snapshot stored with reference name:
refs/pull/17580/merge

Test environment:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17580/merge/index.html

To test a playground add it to the URL, for example:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/17580/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/17580/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/17580/merge
https://gui.babylonjs.com/?snapshot=refs/pull/17580/merge
https://nme.babylonjs.com/?snapshot=refs/pull/17580/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/17580/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.

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/?snapshot=refs/pull/17580/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

Building or testing the sandbox has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/testResults/

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Dec 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/?snapshot=refs/pull/17580/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/?snapshot=refs/pull/17580/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/?snapshot=refs/pull/17580/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

Building or testing the sandbox has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/testResults/

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 15, 2026

@alexchuber alexchuber force-pushed the inspector-v2-import-tools branch from a3b2baa to e6880ea Compare January 16, 2026 00:00
@bjsplat
Copy link
Collaborator

bjsplat commented Jan 16, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/?snapshot=refs/pull/17580/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 16, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 16, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 16, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 16, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 16, 2026

* Used internally by the Inspector and Sandbox tools.
* @internal
*/
public static ResultsHistory: Nullable<GLTF2.IGLTFValidationResults[]> = null;
Copy link
Contributor Author

@alexchuber alexchuber Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because, in the Sandbox, the Inspector can only initialize after a model is dropped into the app. But the glTF validator section of the Inspector must show the validation report of the most recently-loaded glTF-- aka, the one that loaded before the Inspector ever initialized, and definitely before the dynamic "Import Tools" modules had a chance to load.

So, the Sandbox needs to ensure that 1. we record glTF validation results as early as possible, and 2. the results are accessible to the Inspector when it does load.

Hence, this lo-fi, lazy state in the GLTFValidation class. In practice, this module should only be loaded in debug scenarios anyway.
If you have better ideas, pls shoot :)

label="Loader Options"
expandByDefault={false}
expandedContent={
<div style={{ paddingLeft: tokens.spacingHorizontalM }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't need to do specific styling for property lines -- perhaps we want to move this into the expanded content of the property line itself

label="EXT_lights_image_based"
component={SwitchPropertyLine}
key="EXT_lights_image_based_enabled"
target={extensionOptions["EXT_lights_image_based"]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible that extensionOptions["EXT_lights_image_based"] or any of the other targets change? if so, we may want to use useProperty to ensure that if extensionOptions.foo changes, this gets rerendered

const openValidationDetails = useCallback(() => {
const win = window.open("", "_blank");
if (win) {
// TODO: format this better and use generator registry (https://github.com/KhronosGroup/glTF-Generator-Registry)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not familiar with this functionality but do u want to use a child window here?


export type GLTFLoaderOptionsType = typeof CurrentLoaderOptions;

const CurrentExtensionOptions = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is enabled the only possible option? and is this a construct built just for inspector or is this an existing options structure?

type MessageBarProps = {
message: string;
title: string;
message?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think we want to make these optional -- can we instead chnage the callsite?


// Setting up some GLTF values
GLTFFileLoader.IncrementalLoading = false;
GLTFValidation.ResultsHistoryEnabled = true; // Early enable validation results tracking for glTF Validation tool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems unrelated to inspectorv2 -- is it intentional?


private static _LoadScriptPromise: Promise<void>;

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were these just needed for inspectorv2? i wonder if we can achieve same reuslts without needing to change the gltfValidation tools -- can u explain why these additions are necessary?

expandByDefault={false}
expandedContent={
<div style={{ paddingLeft: tokens.spacingHorizontalM }}>
<BoundProperty
Copy link
Contributor

@georginahalpern georginahalpern Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is all kind of the same -- i wonder if we want to loop through extensionOptions by key/value pairs and just create for each item do

<BoundProperty
label = key
component={SwitchPropertYline}
key=key
target=value
propertyKey="enabled" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants