Maya 3D to Babylon Animation Rotation Problem

Hi everyone.

I am having an issue with the basic rotation animation.
I’ve created the animation in Maya and tried to see it in Babylon but result was unxpected. Rotation is totally messed up and i dont know why.
Animation baked-unbaked nothing changed.

Here is a video of the problem.

Thank you all.

Maybe @PatrickRyan or @PirateJC can help

Hey @mkaanztrk how are you getting your object out of Maya and into Babylon?

Also, @mkaanztrk, this looks to be node based animation and not skinned animation. Can you describe how your node parent structure looks in Maya, or provide a screen shot of the outliner as well as describe where the pivot points of the mesh objects live? What about scale… what size physically is your model?

Thank you for the quick response.

@PirateJC I am using Babylon Maya exporter.

@PatrickRyan I’ve uploaded some screenshots,

For the scale matter, i didn’t measure it but now i did and its 24cm Y, 9cm X, 15cm Z.

@mkaanztrk, a couple more questions. Are you on the latest version of the exporter 20210308.2? Are you able to share a playground or your model with us so we can debug? There are a lot of things I’m guessing at right now.

@PatrickRyan I’ve uploaded .mb file with you if its okay. (3.4 MB)

Thank you so much

And I am using 2019 version.

@mkaanztrk, so there are several things I found in your file, so let me walk through them one by one. Spoiler alert: (3.7 MB) (2.0 MB)

The first thing I found in your file is that your mesh is not at world zero, but is offset in space with your transforms frozen:

You can see the local and world offset for your pivots baked into the mesh. This is what is causing the problem. We are loading the file at world zero, since your frozen transforms are at 0, but your pivot offset is being applied to your rotation animation because the transform has this offset in the file.

What I did was to bring the mesh back to world zero to eliminate some of the offset in the pivot working under the hood. I also reset the transforms and noticed that your original transform was baked into the bottom left of the door as seen from the outside, so the original transform was making your door swing from the opposite side and swing into the basemesh, not opening away from the basemesh. This is the mesh after the unwinding of the baked pivot:

But you can see that there is still some offset in the pivot. This will cause trouble with node animation as the glTF does not have a sense of the history of the mesh. We do translate these pivot offsets, on a mesh that has a big history, even when deleted, can keep remnants of the original positions with the pivot offset.

To combat this, I dropped a locator in the scene along the pivot axis of the door and applied the rotation animation to that mesh with the door set as a child to the locator. The locator will export as an abstract mesh that has a transform and can be animated. This bypasses any baked history of the door mesh so that the node animation plays correctly:

While this is a solve that works for this model, I think a better workflow would be to skin the mesh to a simple two-bone skeleton. You can rigid bind the root bone to the basemesh, and then rigid bind the test mesh to a bone sitting at the rotation axis of the door. Then you animate the door bone to open and close. This is better because it is the offset of the bones from the root that determine all motion rather than relying on animations on separated meshes keeping relation to one another when in motion.

Other than that, there were some issue with your normals (a lot of glTF validation errors) as well as vertices with no UV assignment. I did some mesh cleanups, but there are still more issues, likely in vertices overlapping one another. I did a quick automatic UV unwrap as well so I could get the mesh rendering correctly in the sandbox. But there were some normal conformity issues as well with parts of the basemesh having reversed normals which I manually corrected. There is likely more cleanup to do as the triangulation seems to have created a lot of unnecessary faces:

I hope this at least helps you get going in the right direction, but feel free to ping me with other questions.

@PatrickRyan Thank you for this awesome answer. I will try all of them thank you.

1 Like