I have a single glTF mesh/rig that is instantiated multiple times per scene. I also have glTF animation files (using the same rig) that I want to apply to certain instances of the mesh. I’d like to minimize loading. My thinking was that I could use SceneLoader.LoadAssetContainerAsync()
to load the clips to a persistent scene that doesn’t get rendered, and then use AssetContainer.mergeAnimationsTo()
to apply those animations to my main, rendered scene that gets destroyed and recreated on player death. However, after using mergeAnimationsTo
that scene.animationGroups
is empty, while persistentScene.animationGroups
has the originally loaded anims as expected. I can see the animations applied to the rendered instantiated meshes, I just can’t access or control them (.play()
, .stop()
etc). I’m new to Babylon - can I not apply data across scenes like this? Does the persistent scene need to be included in the render loop for this to work? Should I just aim to keep the same scene around the whole time instead?
Note that I’ve gotten all the animation retargeting, controls, etc. working while operating on a single scene, so I know there’s not an issue with my mesh, animations, glTF loader etc.