Inspector not showing items

Hi there.
I’ve got a scenario where the inspector stops showing items that are added to the scene. Difficult to re-create in PG, so hoping there is a simple/obvious reason? The sequence that causes it is:

  1. scene.dispose(); engine.dispose();
  2. followed by load up of a serialized scene and re-create of scene+engine.
  3. adding of other elements (lights, loaded GLBs, etc)

Nothing from step3 shows up in the inspector, but everything does show up actually in the scene. Fwiw, my objective here is to totally clear out the scene of materials/textures/etc, before loading a new scene - so that it doesn’t have any unused cruft in memory.

can you share the code opening the debug layer ? it looks like you are still opening the previous one whereas it should be recreated for the new scene.

Here’s the inspector code:

  if (bjsinspectoron){{
      embedMode: true,

Maybe I should be using a different variable for the 2nd scene (I am re-using g.scene for both scene1 and scene2)??

You could try to take a look in this direction or try to manually create a debugLayer:

const inspector = new DebugLayer(theSceneYouNeed);{...});

That worked like a charm!

1 Like