GLTF(2.0) loader not loading empty meshes/"TransformNodes"?

Title asks it all :slight_smile:

Slowly digging into the GLTF format,
I have a mesh with a TransformNode / Empty mesh as a child, i see it within the GLTF file as following;

{
  "rotation": [
    0.0,
    0.0,
    0.0,
    -1.0
  ],
  "scale": [
    0.85,
    0.85,
    0.85
  ],
  "translation": [
    0.0,
    1.9,
    -0.5
  ],
  "name": "projectileOrigin"
}

But running through the imported meshes, it’s missing :frowning:
Thoughts?

Pinging @bghgary and @Drigax, our GLTF knights!

Can you explain what this statement means? If you can provide a playground, that will be even better.

Hi @bghgary
“But running through the imported meshes”
When it seemed something was wrong, i simply did:

newMeshes.forEach( (m)=>{ console.log(m.name) } ); 

Afraid it’s a licensed model, but i’ll see if i can setup a simplified PG :slight_smile:

Here, Babylon.js Playground

This should contain;
__ root__ (Empty parent)
projectile (Ball mesh, child of __ root__)
projectileOrigin (Empty mesh, child of __ root__) <- missing

Ah, yes. That won’t return the transform nodes. This is because of the contract of the API. I can’t assign transform nodes to the meshes. It is loaded though, and you can get it by name or id through the scene. We currently don’t have a way to get the specific transform node that was loaded. That can be added if going through scene doesn’t work for you.

1 Like

Ahh, i see it now in scene.transformNodes, thank you for the help! :slight_smile:
I assumed it would be passed with the meshes as-if it was a empty mesh, like the root / parent.

Right, the root is an empty mesh because it needs to be passed out through the existing API.