How does Babylon like geometry in meshes?

I have made a couple of files in blender. In the first one, all the geometry was at the same hierarchy level, i.e. no geometry was nested under another geometry. I could get to all my geometry to turn it on and off, transform it, or adjust the alpha.

I then made another Blender file and some of the geometry was nested so if I rotated the primary geometry, the others would rotate with it. This one, I can get to load, but can’t get access to each individual piece of geometry.

I’m using the following code snippet that worked in the first case and not in the second.

BABYLON.SceneLoader.ImportMesh("","./", “Primitives.glb”, scene, function (newMeshes) {
scene.createDefaultCameraOrLight(true, true, true);

		// Adding variables to specific meshes
			var V1 = newMeshes[12];
			var V2 = newMeshes[8];
			var V3 = newMeshes[0];
                   });

Am I missing something on how Babylon handles meshes, especially if they’re in a hierarchy? I figured they’d all still be rolled out starting with 0 and going up from there. Is there a way to view the hierarchy of the mesh once loaded?

Thanks,

Brian

hi welcome to the forum

use mesh.parent

https://www.babylonjs-playground.com/#4AEW8L

You can view the parent child hierarchy with the Inspector. The Inspector is directly available within the playground under the settings menu. With the Inspector open expand the Nodes list.

In your own projects you will need to load the Inspector Display and Use the Inspector - Babylon.js Documentation

1 Like

That’s what I needed. Thanks!