Maya to Babylonjs gltf validation error

Hey folks,

Trying to export an animated skeleton from Maya to babylonjs using gltf.
When I tested exported gltf it didnt pass the validation check and print following error for every joint:

 {
        "code": "ACCESSOR_ANIMATION_INPUT_NON_INCREASING",
        "message": "Animation input accessor element at index 2 is less than or equal to previous: 0.06666667014360428 <= 0.06666667014360428.",
        "severity": 0,
        "pointer": "/animations/1/samplers/207/input"
      },

When I exported using maya 2018 two years ago didnt encounter these errors. Now I am using maya 2020 to export with a different generator version:

New export (the errored one):

"info": {
    "version": "2.0",
    "generator": "babylon.js glTF exporter for Autodesk Maya 2020.4 v20211115.1",
    "resources": [
      {
        "pointer": "/buffers/0",
        "mimeType": "application/gltf-buffer",
        "storage": "external",
        "uri": "stand_idle_close.bin",
        "byteLength": 130680
      }
    ],
    "animationCount": 2,
    "materialCount": 0,
    "hasMorphTargets": false,
    "hasSkins": false,
    "hasTextures": false,
    "hasDefaultScene": true,
    "drawCallCount": 0,
    "totalVertexCount": 0,
    "totalTriangleCount": 0,
    "maxUVs": 0,
    "maxInfluences": 0,
    "maxAttributes": 0
  }

Old export (the one passed the validator):

"info": {
    "version": "2.0",
    "generator": "babylon.js glTF exporter for Maya 2018 v20200721.1",
    "resources": [
      {
        "pointer": "/buffers/0",
        "mimeType": "application/gltf-buffer",
        "storage": "external",
        "uri": "stand_idle_close.bin",
        "byteLength": 57024
      }
    ],
    "animationCount": 2,
    "materialCount": 0,
    "hasMorphTargets": false,
    "hasSkins": false,
    "hasTextures": false,
    "hasDefaultScene": true,
    "drawCallCount": 0,
    "totalVertexCount": 0,
    "totalTriangleCount": 0,
    "maxUVs": 0,
    "maxInfluences": 0,
    "maxAttributes": 0
  }

Other info:
Using same validator for both old and new gltf:

"validatorVersion": "2.0.0-dev.3.5"

Tried to search for solution on KhronosGroup github pages but didnt got anything help.

Also when load the errored gltf in engine it shows as this:
gltf_error_engine
And the animation could not be able to load properly.

Does anyone have any clue about this error?
Many thanks,
Tawibox

cc @Guillaume_Pelletier to look into it. Could you share your asset ? it will help him to find the culprit.

1 Like

@sebavan @Guillaume_Pelletier

Hey guys, here are the updates of the issue as well as the source files:

I found the issue started from version CD Release 20211112.1
Before this version the exporter worked fine.

(PS: here are the versions I have tried:
CD Release 20220308.1 - didn’t pass the validator
CD Release 20211112.3 - didn’t pass the validator
CD Release 20211112.1 - didn’t pass the validator
CD Release 20211102.1 - passed the validator
CD Release 20210811.2 - passed the validator
CD Release 20200721.1 - passed the validator)

And from my inspection, the issue came from negative frames. As long as there are negative frames the exported gltf wont pass the validator.

These are my test files:

202203_babylonjsGlftExporterError.zip (54.6 KB)

In the package, it includes:

  • a maya .ma file of original animation
  • gltf didnt pass the validator (exported from v20211112.1)
  • gltf passed the validator (exported from v20211102.1)
  • a screen capture of my export settings

I noticed in the change log it does mention about the negative frames handling for 3ds max:

In my workflow, I use Maya and I do need negative key frames. So it would be a nice to keep that feature in the exporter. Or set it as an option users can choose export negative frames or not.

Many thanks!
Tawibox

2 Likes

Hello,
Understand the issue. However we can not export negative frame into GLTF, we can eventually offset the key to slide the animation to all positiv key or cut the animation below 0.
@bghgary what do you think ?

@Guillaume_Pelletier @bghgary @sebavan

Hey guys,

Just a quick updates here, found out if there are keys at frame 0, the exported gltf won’t pass the validator as well. In other words, only positive frames can pass the validator in the newer versions of exporter.

Hope this helps.
Thank you so much guys.
Tawibox

Offset seems like the right choice to me.

That seems like an exporter bug if it doesn’t work. glTF allows >= 0 for the animation/sampler/input time value. What does the glTF validator say for the error?

1 Like

It is related to the fact that if trim the value to zero, we get several frame with the same index (0). I’m agree it’s a bug and i will modify the code accordingly.

1 Like

@Guillaume_Pelletier @bghgary

Thanks a lot guys!

In case you guys need it, I am attaching the example .gltf and .ma files for error at frame 0 here.
202203_babylonjsGlftExporterError_animAtF0.zip (24.5 KB)

Much appreciated.
Tawibox

1 Like

PR done, tested succesfully with your file on 2020 and 2022

2 Likes

@Guillaume_Pelletier Amazing!! Thank you so much for the quick updates. Much appreciated.

1 Like