# Maya scene with animations exporting to gltf with broken animation when animation groups are enabled

**URL:** <https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063>\
**Category:** Content creation (3dsMax, Maya, Blender, glTF)\
**Created:** [May 23, 2020, 1:33am UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063 "2020-05-23T01:33:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shayyan\_Ahmed](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shayyan_ahmed/32/8570_2.png) [@Shayyan\_Ahmed](https://forum.babylonjs.com/u/Shayyan_Ahmed)\
**Post date:** [May 23, 2020, 1:33am UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/1 "2020-05-23T01:33:56Z")

</div>

I am trying to export a maya scene to gltf. It has about 700 frames of 6 different animations. Two of the animations cover a larger part of the timeline and are having most of the issues in the export.

The Animations export just fine without any animation groups enabled. But the animation goes wacky when exported with animation groups.

As far as I can figure out, the animation groups have a problem with objects in the scene which scale up to become visible. For example I have an object that I scale up from a value of 0.02. The objects stays at scale ‘1’ for a number of animation groups and then goes back to 0.02 (It’s hidden state).

When I scale upto a value of ‘1.02’ instead of ‘1’ it exports differently, with more of the animation groups exporting properly than before. But it doesn’t completely solve the problem as some animation groups are not playing as they are supposed to with missing keys or keys out of place.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 23, 2020, 11:22am UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/2 "2020-05-23T11:22:03Z")

</div>

Ping @Drigax our own exporter guru 😉

---

<div class="post-metadata">

**Author:** ![Shayyan\_Ahmed](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shayyan_ahmed/32/8570_2.png) [@Shayyan\_Ahmed](https://forum.babylonjs.com/u/Shayyan_Ahmed)\
**Post date:** [May 26, 2020, 4:35pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/3 "2020-05-26T16:35:25Z")

</div>

Hello, I have figured out what the problem is. Babylon exporter occludes the keys that don’t change value over the course of an animation group.

There are some cases where I can’t change the value of a the key even slightly. For example if my object is visible at Scale 1 and I scale it to 1.02. Even this slight change reflects in my animation and the object grows. Even if I make it work somehow, it’s going to be quite tedious.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 26, 2020, 4:36pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/4 "2020-05-26T16:36:26Z")

</div>

That will be a huge help for @Drigax Thanks a lot for the pointer

---

<div class="post-metadata">

**Author:** ![Shayyan\_Ahmed](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shayyan_ahmed/32/8570_2.png) [@Shayyan\_Ahmed](https://forum.babylonjs.com/u/Shayyan_Ahmed)\
**Post date:** [May 26, 2020, 4:40pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/5 "2020-05-26T16:40:00Z")

</div>

I have spent a lot of time testing it out. That is exactly the problem! This is the only promising exporter at the moment so I’d like to see it get better. Waiting for a fix, thanks.

---

<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:** [May 26, 2020, 4:42pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/6 "2020-05-26T16:42:14Z")

</div>

Up @Drigax

---

<div class="post-metadata">

**Author:** ![Drigax](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/drigax/32/16585_2.png) [@Drigax](https://forum.babylonjs.com/u/Drigax)\
**Post date:** [May 26, 2020, 4:49pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/7 "2020-05-26T16:49:02Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![Drigax](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/drigax/32/16585_2.png) [@Drigax](https://forum.babylonjs.com/u/Drigax)\
**Post date:** [May 26, 2020, 5:16pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/8 "2020-05-26T17:16:54Z")

</div>

> <https://github.com/BabylonJS/Exporters/issues/827>
>
> See:
> https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063
> Repro file was shared privately.
> When an animation track spans multiple animation groups in Maya, and does not have any keyframes in...

Tracking it with this issue. Thanks for sharing your scene privately, I understand what’s going on now.

---

<div class="post-metadata">

**Author:** ![Shayyan\_Ahmed](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shayyan_ahmed/32/8570_2.png) [@Shayyan\_Ahmed](https://forum.babylonjs.com/u/Shayyan_Ahmed)\
**Post date:** [May 27, 2020, 7:32pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/9 "2020-05-27T19:32:57Z")

</div>

I’d like to give an example to be a bit more clear about the issue. I did make sure that there were key frames on the animation group boundaries (keys at the animation group’s start and end frame). That is not the problem.

Babylon exporter excludes the animation on a joint if that joint is static through out the animation groups. Which means that at the first frame of the animation group the joint’s translation values were at 1 and it stays at 1 till the last frame of the animation group.

The exporter thinks that the joint is not animated (or keyed). Even though that essential static position is keyed in to maintain it’s pose through out the animation group. The exporter thinks that there is no animation as no values have changed, so it probably adds it to the optimization.

---

<div class="post-metadata">

**Author:** ![Drigax](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/drigax/32/16585_2.png) [@Drigax](https://forum.babylonjs.com/u/Drigax)\
**Post date:** [May 27, 2020, 9:54pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/10 "2020-05-27T21:54:16Z")

</div>

Thanks, adding some interpolation to the nearest frames to our animation group boundaries for all animated bones in our hierarchy appears to fix this. Note that we currently only linearly interpolate our animation data, so large gaps between points on a curve will not look good. Regardless, our animation group export is looking a bit more consistent now.

---

<div class="post-metadata">

**Author:** ![Shayyan\_Ahmed](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shayyan_ahmed/32/8570_2.png) [@Shayyan\_Ahmed](https://forum.babylonjs.com/u/Shayyan_Ahmed)\
**Post date:** [May 27, 2020, 11:01pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/11 "2020-05-27T23:01:49Z")

</div>

You fixed it !!  
Exports perfectly!  
Thanks Nick for providing a fix so quickly. I will let you guys knows if I come across any issues again in the future. Exporter works nicely for now. Great work

---

<div class="post-metadata">

**Author:** ![Shayyan\_Ahmed](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/shayyan_ahmed/32/8570_2.png) [@Shayyan\_Ahmed](https://forum.babylonjs.com/u/Shayyan_Ahmed)\
**Post date:** [May 27, 2020, 11:02pm UTC](https://forum.babylonjs.com/t/maya-scene-with-animations-exporting-to-gltf-with-broken-animation-when-animation-groups-are-enabled/11063/12 "2020-05-27T23:02:57Z")

</div>

Thanks Nick!  
Works like a charm now. Will let u know if i have any problem again. 😊😊
