-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Inspector v2: GLTF Import tools #17580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Inspector v2: GLTF Import tools #17580
Conversation
|
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/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 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. |
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
Building or testing the sandbox has failed. If the tests failed, results can be found here: |
|
WebGL2 visualization test reporter: |
|
Visualization tests for WebGPU |
|
Devhost visualization test reporter: |
|
You have changed file(s) that made possible changes to the sandbox. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/ |
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
Devhost visualization test reporter: |
|
WebGL2 visualization test reporter: |
|
Visualization tests for WebGPU |
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
You have changed file(s) that made possible changes to the sandbox. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/ |
|
Devhost visualization test reporter: |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
Building or testing the sandbox has failed. If the tests failed, results can be found here: |
|
Devhost visualization test reporter: |
|
WebGL2 visualization test reporter: |
|
Visualization tests for WebGPU |
a3b2baa to
e6880ea
Compare
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17580/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
You have changed file(s) that made possible changes to the sandbox. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17580/merge/ |
|
Devhost visualization test reporter: |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
| * Used internally by the Inspector and Sandbox tools. | ||
| * @internal | ||
| */ | ||
| public static ResultsHistory: Nullable<GLTF2.IGLTFValidationResults[]> = null; |
There was a problem hiding this comment.
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 }}> |
There was a problem hiding this comment.
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"]} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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>; | ||
|
|
||
| /** |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" />
This PR adds the remaining glTF configuration tools (Extensions config, loader plugin config, and validator) to the Inspector v2 Tools pane.|
Default view:

After loading new file and editing loader settings:

Features: