Importing glTF and grouping meshes


I’d like to import a glTF model and do the following thing with it:

  • Maintain the separate meshes for texture/material handling;
  • Group the meshes so I can transform it;
  • Fade in/out the whole model (animating visibility).

Problem is that when I use BABYLON.Mesh (basically an empty mesh) as a parent, it doesn’t have dimensions so I cannot create an instance out of it (I get a warning). When I use BABYLON.TransformNode I cannot animate the visibility of the whole thing (because a TransformNode is not a mesh).

Is there a way to group all the meshes of an import so I can animate/transform the model and still have access to the ‘submeshes’?

Thank you!


You may want to merge all the meshes into one with Mesh.MergeMeshes but I’m not sure that what you need.

The way to go to group meshes is to use a TransformNode as parent. If you want to create an instance of the group you will have to create a new TransformNode, create instances of all children and attach the new instances to the new transformnode