-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Create abstraction layer over the inspector gizmo layer #17177
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
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/17177/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/17177/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/17177/merge#BCU1XR#0 |
Devhost visualization test reporter: |
WebGL2 visualization test reporter: |
Visualization tests for WebGPU |
Devhost visualization test reporter: |
WebGL2 visualization test reporter: |
Visualization tests for WebGPU |
Looks good! @kv-bh just a heads up though, we are working on a full re-write of the inspector which we will announce soon (just for awareness in case there are any other improvements you had in mind for inspector v1 code!). |
I did notice there was an "inspector-v2" in the source code, so that would explain that. I don't have any plans to make any other adjustments, this was just something I noticed in my travels through the codebase. Thanks for the heads up! |
This change fixes some issues with the inspector due to its
gizmoManager
being treated as anany
type.Issue Description
To see the issue this is attempting to address, go to https://sandbox.babylonjs.com/ and load a model, then open the inspector and click this button:

A message will appear on screen:
Script error. Check the developer console.
(nothing appears in console).The actual issue stems from this error:
Which leads to here:
Babylon.js/packages/dev/inspector/src/components/sceneExplorer/entities/sceneTreeItemComponent.tsx
Lines 185 to 187 in 197d8f6
The issue being that this assumes that this value has been initialized, which in this case it has not been.
Change Description
This change makes all access to the Inspector's
gizmoManager
use one of two helper functions: one for getting and optionally creating, and one for disposing. This abstracts the type-unsafety of theany
types to one file, rather than spreading them across ~10 different locations.This code should not make any changes to when the inspector creates the
gizmoManager
, as the code path to create it should only be activated in the place where it was originally created.