I’m encountering a problem where my model disappears when I attempt to clone an animation group for additive blending. I used the following line in my PlayGround: https://playground.babylonjs.com/#6I67BL#507
The problem is that I can not clone the AnimationGroup (I set cloneOriginalAnimationGroup to true) which still affects the original animation group somehow. What do you think @Evgeni_Popov?
Additive animations are added to an existing regular (ie. not additive) animation. If there’s no regular animation playing, animation will be broken.
Think of additive animations as: regularAnim += additiveAnim;
If there’s no regular animation running, regularAnim is 0 and you end up with only additiveAnim as the result, which is wrong.
In the original PG, you either have idle, walk or run animation playing, which are the regular (not additive) animations. Then, thanks to the slide bars, you can make some additive animations come into play (sad, sneak, … animations).
In your PG, because you convert the walk animation to additive, you don’t have any regular animation playing anymore when you click on “Walk”, hence the broken animation.
I see your point. But the thing is I can not clone an AnimationGroup that I’d like to run as a regular animation, sometimes use as an additive animation. For example this code still breaks the walk anim;
When I clone some object, and apply some changes on cloned one, I’d expect that original one should be fine.
var cc = scene.animationGroups.find(a => a.name === 'walk').clone();
BABYLON.AnimationGroup.MakeAnimationAdditive(cc, {cloneOriginalAnimationGroup:true});