Invisible mesh from gltf

Hi there,

I’m exporting a scene from blender to gltf. The scene has invisible meshes that act as colliders (planes for stairs).

However, blender exports these without a mesh ID in the gltf

{
“name” : “Plane”,
“rotation” : [
0.23380382359027863,
0,
0,
0.9722837805747986
],
“scale” : [
0.22394409775733948,
0.4259147644042969,
0.23582002520561218
],
“translation” : [
-73,
-91.19999694824219,
633.5
]
},

as opposed to visible meshes that also have a “mesh” value, which is an ID.

{
“mesh” : 242,
“name” : “Cube_125”,
“rotation” : [
0,
-0.7071067690849304,
0.7071068286895752,
1.067701660417697e-07
],
“scale” : [
100,
100,
100
],
“translation” : [
797.510986328125,
-614.916015625,
-33.454166412353516
]
},

I believe this is why when I list the meshes I load with SceneLoader.ImportMesh in the callback function, the planes are not included in the list.

Is there a way to access these objects when loading the scene?

They have a name so you should see them in the scene

How does it look like in the inspector?

I use

BABYLON.SceneLoader.ImportMesh(“”, “./assets/gltf/”, “scene.gltf”,scene, function(meshes) {
meshes.forEach(function(mesh) {
console.log(mesh.name);
}

this doesn’t print out the names of hidden meshes (it prints out everything else).

I’ll try to create a playground for this.

yeah but these objects will be TransformNodes (scene.transformNodes)

that’s what I was looking for :slight_smile:

hmmm but now I learned to my dismay that transformNodes don’t have checkCollisions :slight_smile:

Would it be better if I exported them from blender in a visible state and then manipulate them as meshes in babylon, giving them collisions and disabling their rendering at load time?

Well they need to have a geometry to be used with collisions (which will automatically promote the transformNodes to meshes)

I ended up with a dirty hack, making the meshes visible in blender and turning them invisible after importing the scene. it seems to have fixed the problem for me.