I am trying to load in objects from a .blend file converted into a .glb file. I have objects nested in empty objects so that I can try and detect which objects are parents/children of other objects, and so I can hide/show children of a certain group based on object naming conventions.
A snippet of my object hierarchy in blender can be seen below:
I got my application working by using:
const result = await SceneLoader.ImportMeshAsync(null, “assets/babylon-models/”, this.modelID, this._scene);
this returned meshes and rendered everything fine.
But I noticed that it just returns the mesh primitives, so I looked to try and use this instead:
const result = await SceneLoader.LoadAssetContainerAsync(“assets/babylon-models/”, this.modelID, this._scene);
however, this returns an AssetContainer.
I tried to access the transformNodes (result.transformNodes) so that I can then access the parent transform nodes and the children meshes of all of the transformNodes. However, when I tried to access individual transformNode of transformNodes, I don’t know how to get and render all of the meshes.
This could be really obvious, but I’ve been coding all night and have a ton of brain fog.
TLDR: I’m trying to create a list of meshes with the empty objects from my blend file, so that I can show and hide and collide with groups of meshes in my scene. I am not sure what to use, and using await SceneLoader.LoadAssetContainerAsync in public async _loadAsset() (which is called in public async load()) seems to lead to the scene not rendering all of my meshes. Any help in regards to gathering a list of meshes (and empty objects from blender, so the hierarchy is maintained and all I have to do is check the parent’s name and descendants) would be much appreciated! Thanks!