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!
Hi everyone
Just checking to see what the result was with this?
Working on a project now where preserving the mesh pivots on export would come in super handy.
Iāve not checked the file, but there is something not seem to be known by most people. In MAYA, you have the local and world pivots in the transform node. And those are changed often while you model.
So before exporting, you either have to bake the positions and orientations of everything in world space (a pain in the ass), OR make sure your local pivots are zored (another pain in the ass).
Usually, if you check the option to bake animations at exporting, it is not a problem, but who knows.
