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

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.

Ping @Drigax our own exporter guru :wink:

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.

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

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.

Up @Drigax


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

1 Like

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.

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.

1 Like

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

1 Like

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