# Not able to blend animation with beginWeightedAnimation

**URL:** <https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204>\
**Category:** Questions\
**Tags:** tutorial, animation, typescript, animationblending\
**Created:** [July 15, 2022, 8:14am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204 "2022-07-15T08:14:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [July 15, 2022, 8:14am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/1 "2022-07-15T08:14:06Z")

</div>

Hi there,

I am trying to blend my animation but it is not working as shown in the example

> **[Babylon.js Playground](https://playground.babylonjs.com/#IQN716%239)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

I have created a GLB file with all the animation in one animation group but they are not working

> **[Babylon.js Playground](https://playground.babylonjs.com/#IQN716%231172)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Please help me with this, thank you in advance

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 15, 2022, 12:04pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/2 "2022-07-15T12:04:38Z")

</div>

Hi, are you sure the weighted animations are defined correctly? What is the reason for the model to simply play all animations randomly?

---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [July 15, 2022, 12:06pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/3 "2022-07-15T12:06:37Z")

</div>

all the animations are in the same clip

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 15, 2022, 12:08pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/4 "2022-07-15T12:08:49Z")

</div>

not what I asked 🙂

Notice how the original playground is showing this when you turn off all weighted animations:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/6/d6fb037ab6815950ef858415dac7107c083b88d2.jpeg)

Your model’s animation definition is incorrect.

---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [July 15, 2022, 12:11pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/5 "2022-07-15T12:11:49Z")

</div>

how can i correct them

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 15, 2022, 12:12pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/6 "2022-07-15T12:12:52Z")

</div>

i believe it has something to do with the way you are exporting it, but @PatrickRyan probably has a better answer.

---

<div class="post-metadata">

**Author:** ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)\
**Post date:** [July 16, 2022, 2:37am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/7 "2022-07-16T02:37:29Z")

</div>

@Shubham, I looked into the file and what I think is happening is that you have an animation group saved into your glTF (which should be coming from the exporter from whatever DCC tool you are using). What I believe is happening is there is a conflict between the animation groups (which automatically start playing when the glTF is loaded) and assigning new animatables to the same skeleton with `beginWeightedAnimation`. You could try exporting your file without animation groups and I am guessing this would solve the issue.

However, I think there may be something we need to do in engine so I am going to summon @Deltakosh as he wrote most of the animation logic and @RaananW for backup as DeltaKosh is on vacation next week. From what I debugged, the animatables are being created by `beginWeightedAnimation` but if there was any weight assigned in the constructor, the animation would “stop” and then dispose as `disposeOnEnd` was set to the default true. So basically, every time the scene would start (with animation groups stopped or even disposed) would start any animatable with weight, then immediately stop and dispose of it. Setting `disposeOnEnd` to false prevents the animatables from being disposed, but they never start playing. The `animationStarted` parameter remains false, even if the animatable is given weight in the constructor.

[The scene I set up with some logging and added parameters is here](https://playground.babylonjs.com/#IQN716#1175) but you can see in the scene below that the idle animation has weight, but the animatable thinks `animationStarted` is false.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/1/a1fa29b3cf7cf6d695afdf69bbf5a2286069241e.jpeg)

---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [July 18, 2022, 6:16am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/8 "2022-07-18T06:16:11Z")

</div>

So i am using blender to export all the animation in one clip, and i am taking the animations from mixamo. how can i remove the animation groups from the gltf

---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [July 18, 2022, 6:23am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/9 "2022-07-18T06:23:47Z")

</div>

Actually what i am doing is i am import this model in my web app on application start and then on runtime i am importing more models which doesn’t have animation to it they have the same armature as the one that i imported before, then i am cloning the animation from the old model and retargeting to the new ones and now i want to blend the animations in new model

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 18, 2022, 11:25am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/10 "2022-07-18T11:25:39Z")

</div>



---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 18, 2022, 11:26am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/11 "2022-07-18T11:26:08Z")

</div>

assigning myself, and I hope to find time this week to check that. Otherwise we’ll wait for @Deltakosh 🙂

---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [July 20, 2022, 3:33am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/12 "2022-07-20T03:33:02Z")

</div>

hi @RaananW got any solution for my problem

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 20, 2022, 11:46am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/13 "2022-07-20T11:46:33Z")

</div>

@PatrickRyan has provided you with a solution that should be a fix on your end. What I am going to check, either today or tomorrow, is the second issue, which might be something that needs to be fixed in the framework itself. Would be great if you tried the suggestion and notified us if it worked for you.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [August 1, 2022, 12:17pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/14 "2022-08-01T12:17:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [August 22, 2022, 7:18am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/15 "2022-08-22T07:18:27Z")

</div>

@PatrickRyan @RaananW, sorry I couldn’t test this earlier as I was working on other stuff. I tried the solution but it’s not working, I have removed the animation from the glTF now it is not playing any animations.

You can check here:

> **[Babylon.js Playground](https://playground.babylonjs.com/#IQN716%231223)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)\
**Post date:** [August 22, 2022, 4:22pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/16 "2022-08-22T16:22:44Z")

</div>

@Shubham, what you actually need to remove from the glTF is the animation groups, not the animations themselves. The Blender exporter seems to set by default `Group by NLA Track` in the glTF exporter:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/6/56fb64e5d477e4bc03cd5c89c960357fc28c3184.png)

Unchecking that should not group any animations in your file. Give that a try and let us know if that solves your issue.

---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [August 23, 2022, 4:34am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/17 "2022-08-23T04:34:20Z")

</div>

@PatrickRyan, I tried unchecking the Group by NLA Track but it didn’t work, it is playing all the animation as before

> **[Babylon.js Playground](https://playground.babylonjs.com/#IQN716%231225)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Actually, I combined all the animation in one clip, is that the right way to do it?

[https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/1/b15f9001063d3366a3713cf150ecbae7a14d94b6.mp4](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/1/b15f9001063d3366a3713cf150ecbae7a14d94b6.mp4)

or else can you tell me how to export animations in blender from the scratch

---

<div class="post-metadata">

**Author:** ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)\
**Post date:** [August 23, 2022, 9:37pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/18 "2022-08-23T21:37:22Z")

</div>

I’m not super familiar with exporting animations from blender. Pinging @PirateJC!

---

<div class="post-metadata">

**Author:** ![Shubham](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shubham/32/22838_2.png) [@Shubham](https://forum.babylonjs.com/u/Shubham)\
**Post date:** [August 29, 2022, 5:25am UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/19 "2022-08-29T05:25:02Z")

</div>

hi @PatrickRyan, can you ping @PirateJC again?

---

<div class="post-metadata">

**Author:** ![PirateJC](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/piratejc/32/1003_2.png) [@PirateJC](https://forum.babylonjs.com/u/PirateJC)\
**Post date:** [August 29, 2022, 4:41pm UTC](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204/20 "2022-08-29T16:41:03Z")

</div>

Hey @Shubham Sorry for the delayed response. I’ll take a look right now. I’m not an expert, but I’ll see what I can discover.

[Next page](https://forum.babylonjs.com/t/not-able-to-blend-animation-with-beginweightedanimation/32204.md?page=2)
