Maya to GLTF Exporter doesn't respect Maya pivots

Is there a way to export using the MayaToGLTF exporter that respects the pivots setup in Maya? Right now everything I bring in, the pivots just seem to be at 0,0,0, no matter what part of the object I am selecting.

pinging @Drigax

Not sure. Mind sharing a sample that I can look at?

Here’s a quick example.
turret.zip (12.8 KB)

I can fix by using groups or locators and parenting geo to that, but I’d obviously prefer the objects be as clean and organized as I can make them, fewer separate meshes, part’s zeroed out, etc

Just tried the new Maya 2020 exporter and had a few issues. BTW, awesome to have it working in 2020!

Couple of things, the exporter still doesn’t seem to respect the pivots set up in Maya if any of those objects have had their transforms frozen in Maya.

When I exported as a GLB file, it broke objects up by material. So if I had a solid object in Maya but that object had 2 separate materials, it made a GLB with a new node and then 2 objects underneath that node, each material as a separate object.

It also added a ‘_ root ’ and a “root” child then the normal object was a children under that. Is that normal, I thought it normally added just the “_ root ” node

Ok, I I haven’t looked into the pivot issue, my understanding is that we use the object’s local transform as the output node transform for each object. I’m not sure how moving the pivot changes how the object geometry is interpreted, or if we should instead use the object pivot as the output node local transform. I’ll have to take a closer look at your turret example to understand what we’re doing wrong here.

Regarding materials, that is expected. glTF only supports a single material per mesh, currently I don’t plan to add functionality to the exporter to merge materials at export. I’m unsure if we split mesh primitives by material currently…

Hey @MyFault can you share your source .ma scene as well?

A cursory glance at the scene suggests that this is “expected behavior” but lets make sure that this isn’t the case…:

you mention that you are freezing your object geometry, however that may be the cause of your issue:

I see that all the child components have a local transform @ its local origin, but if this is the hierarchy and transforms used in scene, this seems to be expected, as far as I can understand.

I’m not too experienced with creating in Maya, so my understanding of how the pivot is used may be misunderstood. @PatrickRyan, if you have the time, can you help clarify as well? Does maya have separate concept of pivot and origin, or can we expect that our node’s local orientation is always its pivot?

EDIT:
I think I understand now after talking with @PatrickRyan, we want to consider our object pivot to be the local axis for the node that it applies to, but we’re instead baking the geometry to be offset relative to the parent node, using the frozen axis, and ignoring the pivot.

@MyFault, I looked into your question and I agree with you points about preserving the pivots. @Drigax and I strategized about it and I created some test assets to help our exploration. We’ll ping back when we have a solution.

Sorry, I missed all this but as always, y’all are on it.

I’m continually impressed at everyone involved with BabylonJS!

1 Like