Node class doesn't show up in inspector

Hey folks,
I’ve got a somewhat large scene (~1000s of Meshes/InstancedMeshes) and I’m trying to keep them somewhat organized in the inspector. I’m currently creating TransformNodes with no transform to use as parents for some of the elements which works reasonably well.

Now that I’m taking a look at the application’s performance, I see the TransformNode constructor showing up on the flame graph with the Node superclass constructor being much less (~20-30%) of that. Changing over to Node instead of TransformNode for our groups seems to work well and save some cycles, but doing so removes the whole group from the inspector. Is there some reason why Nodes aren’t shown in the inspector, or perhaps some other very lightweight grouping mechanism I can use?

Thanks!

Hello! The Inspector gets its list of elements to show by hooking into the TransformNode and Mesh scene observables, so adding a Node will never call these and inform the Inspector there’s anything else to show. Looking into the Inspector’s code, I found there’s an additionalNodes parameter, where you can pass a list of new top-level nodes to show, and the children of these nodes: Node parent | Babylon.js Playground (babylonjs.com)

1 Like