Able to corrupt GLTF file by adding an Animation that rotates

Hi All hope your doing well.

I have an application that was running an older version of BabylonJS, I updated to the newest version and I have a bug where an animation with a rotation caused the gltf export to be corrupted.

I have reproduced the bug here in the playground:

Validating the file within Kronos:
https://github.khronos.org/glTF-Validator/

Gives me the following error:
“code”: “ANIMATION_SAMPLER_OUTPUT_ACCESSOR_INVALID_COUNT”,
“message”: “Animation sampler output accessor of count 1201 expected. Found 1200.”,
“severity”: 0,
“pointer”: “/animations/0/channels/0/sampler”

Adding @bghgary our own GLTF expert !!!

I can repo. Seems like a bug.

Okay good to know. Is there a possible work around?

I need to investigate and then I will know.

1 Like

I have a fix here: Fix bug in glTF animation export by bghgary · Pull Request #13356 · BabylonJS/Babylon.js (github.com)

You can work around this if you use Quaternion instead of Euler rotation but that might not be worth the effort. :slight_smile:

2 Likes

That was quick! I will try to get quaternions working if I am not able to get a new release with your fix. My deadline is around Jan 15. Can I expect this in a build before then? Thank you for your help!

Build should be Thursday :wink:

1 Like