# Animation blending and key interpolation bug in new CDN

**URL:** <https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729>\
**Category:** Bugs\
**Tags:** animationblending, animationgroups\
**Created:** [November 13, 2024, 11:19am UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729 "2024-11-13T11:19:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeuroModern](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neuromodern/32/28683_2.png) [@NeuroModern](https://forum.babylonjs.com/u/NeuroModern)\
**Post date:** [November 13, 2024, 11:19am UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/1 "2024-11-13T11:19:04Z")

</div>

Hi, folks! After the CDN update (min and loader), i got a strange bug during the animation blending. like the mesh or parts of the mesh have a scale deformation. in the last version v6.40.0 a blending and an animation works well.

in the attached video you can see the bug in the first half, and a normal behavior in the second part.

how to fix it? thanks

crosspost in github issues [Animation blending bug in the new CDN · Issue #15811 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/issues/15811)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 13, 2024, 4:04pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/2 "2024-11-13T16:04:30Z")

</div>

Please do not create issue on the repo. We use it to track our work  
Can you repro? We will need it to fix the problem

Adding @Evgeni_Popov who did a lot of work on the animation code recently

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 13, 2024, 5:19pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/3 "2024-11-13T17:19:51Z")

</div>

Without more details, it will be difficult to find the problem…

The best solution would be to provide a repro in the playground. Alternatively, can you test different versions to see which one makes your project fail? That way, we can better target the problem.

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![NeuroModern](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neuromodern/32/28683_2.png) [@NeuroModern](https://forum.babylonjs.com/u/NeuroModern)\
**Post date:** [November 14, 2024, 11:16am UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/4 "2024-11-14T11:16:38Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#5UIIN1%233)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

here an example of the scale deformation.  
if i use  
let animationPhase = Math.floor(Math.random() \* 10);  
or  
let animationPhase = Math.random() \* 10;  
and then  
scene.getAnimationGroupByName(“A\_Run\_F”).goToFrame(animationPhase);

i am clarify bug.

animation in gltf file have not round value of keyframe position, its looks like other versions of BJS have an interpolation between keys

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

---

<div class="post-metadata">

**Author:** ![NeuroModern](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neuromodern/32/28683_2.png) [@NeuroModern](https://forum.babylonjs.com/u/NeuroModern)\
**Post date:** [November 14, 2024, 11:38am UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/5 "2024-11-14T11:38:03Z")

</div>

and also, if i skip zero keyframe i still have bug  
let animationPhase = Math.random() \* 10 + 1;

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 14, 2024, 11:58am UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/6 "2024-11-14T11:58:28Z")

</div>



---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 14, 2024, 12:18pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/7 "2024-11-14T12:18:44Z")

</div>

Thanks for the repro, here’s the fix:

> <https://github.com/BabylonJS/Babylon.js/pull/15818>
>
> See https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-i…n-new-cdn/54729/4.
> 
> My change in #15126 was a breaking change, because when the weight isn't -1, the animation is considered additive, and this can break if there isn't at least one animation that isn't additive.
> 
> I needed this change for Teams Avatar, so I made a change so that the old behavior is the default, but I added a flag so that I could use the animation weight on demand.

---

<div class="post-metadata">

**Author:** ![NeuroModern](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neuromodern/32/28683_2.png) [@NeuroModern](https://forum.babylonjs.com/u/NeuroModern)\
**Post date:** [November 14, 2024, 12:25pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/8 "2024-11-14T12:25:24Z")

</div>

Ooo, so instant! Thanks) When it gonna be available in cdn?

---

<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:** [November 14, 2024, 12:58pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/9 "2024-11-14T12:58:45Z")

</div>

It was just merged, next nightly/cdn update will be available tomorrow  
unless @Evgeni_Popov - do you think we need to release a patch for this?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 14, 2024, 1:29pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/10 "2024-11-14T13:29:41Z")

</div>

I don’t think we’re in a hurry, unless @NeuroModern is?

---

<div class="post-metadata">

**Author:** ![NeuroModern](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neuromodern/32/28683_2.png) [@NeuroModern](https://forum.babylonjs.com/u/NeuroModern)\
**Post date:** [November 14, 2024, 2:22pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/11 "2024-11-14T14:22:24Z")

</div>

@RaananW @Evgeni_Popov  
i manually edited babylon.max.js from cdn, and compressed it by uglify-js, it is 7.2mb now instead a current cdn min version that 6mb, do not rush, it is not critical now. just tag me when it gonna be uploaded

big thanks guys! have a good evening

---

<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:** [November 14, 2024, 2:27pm UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/12 "2024-11-14T14:27:22Z")

</div>

in aprox. 18 hours 🙂

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 15, 2024, 1:30am UTC](https://forum.babylonjs.com/t/animation-blending-and-key-interpolation-bug-in-new-cdn/54729/13 "2024-11-15T01:30:16Z")

</div>


