Jump to content

[SOLVED] Maya 2011 Export Static Mesh


photo

Recommended Posts

Posted

Hello, I am writing the automatic generation of XML files for Unigine from Maya. Could you help me, what formula used for generating <transform> element for the object. For example, scale * rotateX * rotateY * rotateZ * translate ???? well, or as something else?

Posted

Hello, I am writing the automatic generation of XML files for Unigine from Maya. Could you help me, what formula used for generating <transform> element for the object. For example, scale * rotateX * rotateY * rotateZ * translate ???? well, or as something else?

 

Hi there,

 

You're going to need to export to .mesh using maya export plugin. Then, open up the Unigine Editor, add the mesh, and export it from the node menu as a node. The transforms are shown and editable on the right when the mesh is selected.

Posted

After exporting to .mesh file I want to generate .node file automatically.

Posted

After exporting to .mesh file I want to generate .node file automatically.

 

Have a look into the 3DSMax plugin script code as there already is a node file export. It should be usable as a reference for your similar maya node export. Besides writing xml .node file also an xml .mat is required.

Posted

In 3DSMax script (Unigine\Tools Set\plugins\Max\UnigineExport\UnigineExport.ms) I found only:

format "\t\t\t<transform>1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</transform>\n" to:file

Another words, they don't write real translate, scale, rotate to the XML file. But I want to write real translate, scale, rotate of the object to the .node XML file.

Posted

Transform is a 4x4 matrix written in column major order.

Posted
MFnTransform maya_transform = ...;
MMatrix maya_matrix = maya_transform.transformation().asMatrix();
float unigine_matrix[16];
for(int i = 0; i < 4; i++) {
for(int j = 0; j < 4; j++) {
 unigine_matrix[4 * i + j] = maya_matrix[j][i];
}
}

  • 8 months later...
Posted

I have another question about Maya export plugin. It seems like exported models and animations have incorrect up vector, while exporting same model from 3dsmax (or even opening .dae model in Resource Editor) gives normal results. That renders Maya exporter totally useless and we have to re-export our models to Max every time. That is boring but acceptable for static meshes, but due to complex rig in Maya we were not able to move some animations from Maya to Max loselessly, so we need either Maya plugin with up-vector selection or a tool that is able to apply transformation matrix to mesh/smesh/sanim and save it back. I'm thinking of writing such tool but it would be much better if it was part of Unigine tools.

  • 2 weeks later...
Posted

In Maya there's an option to specify which axis to use for the Up vector. By default it is Y-axis. Changing it to Z-axis will allow to export correct models.

×
×
  • Create New...