AnimationGroups loaded in AppendAsync, but not in ImportMeshAsync

Hey guys.

I load my objects with the function importMeshAsync. The object also contains animations.
But I don’t get any AnimationGroup back as return value (in the Promise, the value is a empty array).
If I load the object with AppendAsync, then I get an AnimationGroup displayed.
Why don’t I get it with importMeshAsync? I need this return very much. :slight_smile:

Thank you for your help.

Because animation groups are at scene level and not at mesh level. You should use SceneLoader.Append to get them

Thanks for the quick reply. =)

So what are the animationGroups in the return value of the importMeshAsync function for (importMeshAsync Doc)?
These should be the animationGroups that were added by the import or was added? Or am I blind right now? :smiley:

OMG I forgot about that :). But my comment stands :slight_smile: if the animation groups are targetting more than your mesh they will not be in that list

Wouldn’t it be nicer if the animationGroups contained those that concern the mesh? Would help me a lot.
After I have imported the mesh, I would like to go through it if there are animations on the mesh. But that’s not possible at the moment.

:slight_smile:

Can you repro on the PG? I want to make sure it is not a bug :smiley:

Here is a funny PG =) Babylon.js Playground
In the sandbox the animations are there, in the PG they are not.

Ok so this is expected as the babylon loader does not populate that info for the reason I mentioned earlier
but replacing the importMesh with a Append works:
https://playground.babylonjs.com/#34ZCKI#1