evgeniy.zaitsev Posted January 15, 2011 Posted January 15, 2011 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?
michael.zhang Posted January 15, 2011 Posted January 15, 2011 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.
evgeniy.zaitsev Posted January 15, 2011 Author Posted January 15, 2011 After exporting to .mesh file I want to generate .node file automatically.
ulf.schroeter Posted January 16, 2011 Posted January 16, 2011 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.
evgeniy.zaitsev Posted January 16, 2011 Author Posted January 16, 2011 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.
frustum Posted January 16, 2011 Posted January 16, 2011 Transform is a 4x4 matrix written in column major order.
evgeniy.zaitsev Posted January 16, 2011 Author Posted January 16, 2011 Can you write a little bit more information, something like this: http://download.autodesk.com/us/maya/2010help/API/class_m_fn_transform.html The transformation matrix is then constructed as follows: ...
frustum Posted January 17, 2011 Posted January 17, 2011 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]; } }
alexei.garbuzenko Posted October 5, 2011 Posted October 5, 2011 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.
manguste Posted October 18, 2011 Posted October 18, 2011 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.
Recommended Posts