Way to manage instantiation of transform nodes with animated meshes inside

Hi there:

After importing an animated mesh from a GLTF in my scene, and instantiating its root transform node using the API Node.instantiateHierarchy, I realize that the animation group in the model is only affecting the original mesh, but not the instances.

This is a GLTF with a baked animation, not skeletons at all. We’ve tested that with an animated model with a skeleton, all works as expected.

Sadly, I can’t make a PG because the assets are strictly confidential.

Any idea or tip on this?

Thanks for your time.

P.S: Maybe is a more affordable way to implement it via Asset Containers?

Hi there everybody:

In order to ease the resolution of this issue, meanwhile not violating the NDA of this project, we’ve managed to generate a really limited version of the “offending” model, incorporated to this PG.

Please note that, against the expected behavior, only the original doors open but not the instances.

Of course, we’re very sure the problem comes from the GLTF, so any help in that direction will be welcome, so my 3D artist colleague @joie can fix it.

Thanks for your time.

I’m not sure there’s a way to do that automatically (but I’m no animation expert). You can do it quite easily, however, by cloning the animation group:

cc @PatrickRyan in case I missed something.

1 Like

Good evening, @Evgeni_Popov, and thank you very much for your invaluable help on this topic.

Your solution works flawless.

Certainly it had confused me the fact that using other asset it works out-of-the-box (w/o the need for cloning the original animation group at all), as you can see in this different version of my original PG, so I thought something was wrong with our GLTF.

Thanks for your time.

It’s a bit different because in your second example the meshes have a skeleton attached to them. And when instantiating, the skeleton property of the source mesh is copied to the instances. So, when the skeleton is animated, as it is shared by all instances, they are properly animated.

In your first example, the animation is directly applied to the source meshes themselves. If you want to animate the instances, you need to copy the animations and target them to the instance.

2 Likes

Thanks for the explanation, @Evgeni_Popov.

We were thinking that something like that is what was happening, but like to be sure about.