AnimationGroup stop very slow if there are a lot of Animatables

Hi

I want to stop some AnimationGroup-Items at the same time.
I have some animated characters with a lot of animations which are going on at the same time. At some point I want to stop the animations of them.
This is very slow and my scene is frozen for some seconds.
There are ~100k - 200k animatables (scene._activeAnimatables.length) in my scene.

I have checked the code:

and this:

Turns out that calling this._scene._activeAnimatables.splice(index, 1); on every single instance of Animatable is very slow and causing the issue.

So my question:
Is there a better way of stopping animation groups without having such a freeze of the whole scene?

Thank you :slight_smile:

Thanks for the report, there should definitely be…

Can you share a repro so that I ll fix it ASAP ?

+1 on the repro, but as a general suggestion, if you don’t need blending, there’s Baked Animations which are way faster :smiley: Baked Texture Animations | Babylon.js Documentation (babylonjs.com)

Thank you. I will provide you a Playground link as soon as I can.

1 Like