Gltf bone transform node not moving with parent

Hi folks, I’m a little stuck on this one.

I’ve got a rigged gltf model I want to parent by its bones to another object to move around the scene, however when I parent the bone’s transform node to another object it doesn’t move with its parent.

Hey gltf are using transformNode to drive their position/animation (this is how gltf handles it). So you should not move the bone but the node that drives the bone

That’s what I’ve been doing, which works great if I manually move the transform node, but if I parent that transform node to something nothing happens.

can you repro in the PG? It should definitely work

here’s a playground showing the issue. Babylon.js Playground

I’ve imported the gltf and moved one of the transforms positions and it worked, then I parented the transform to a sphere and moved the sphere and it doesn’t move.

Ok I misunderstood your need :slight_smile:
it cannot work as only local matrix of each transformNode is used. Parenting is done through bones themselves. It is a bit overcomplicated but this is how gltf work:

  • Each bone is linked to a node
  • Each node computes his local matrix which is sent to the bone
  • Then bone hierarchy is used to build the final world matrix of each bone

So you cannot change the hierarchy of nodes :frowning:

I see , that makes a bit more sense now. Instead of parenting I might try matching the movement with scene.registerBeforeRender(). Thanks for the help @Deltakosh!

1 Like