Fixes to Maya exporter

I wanted to list the fixes I’ve made to my own copy of the Maya exporter, in the hopes that someone will integrate them into the main source tree, and that they may prove useful to others in the meantime:

I made it so “constant” animation channels (where all values in the animation curve are equal to the existing target value) are not exported. This greatly reduces file sizes and parsing times at little cost in the exporter. Here’s the section of my source code (my changes surrounded by #if 1):

“horizontalFieldOfView” is used instead of “verticalFieldOfView” for the “YFOV”, which is incorrect. There are two places in the source this needs to be changed. Also, I added support for orthographic “LEFT/RIGHT” parameters for cameras:

I modified my version of “DaeTextureLibrary::includeTexture” to search the tree of input nodes besides the immediate input node and include the first “MFn::kFileTexture” it finds, rather than just dumping out nothing if the immediate input is not a texture. I did this because our artists commonly have extra custom shader nodes in their Maya files between the texture and the image. Including this concept might be helpful to some users.

There is a bug in color export – a string pointer is off by one:

Finally, I’ve worked around some things in my reader rather than fixing them in the exporter. I generally have to figure out “idx” attributes which are lacking for inputs under polygons and combiner elements. In controllers, Maya adds a hash (#) to the “target” attribute of the controller which shouldn’t be there according to the spec. The required “semantic” attribute is missing from the inputs under combiner elements – I’m getting this from the “name” attribute of the “param” pointed to instead for now. Last but not least, there’s the known issue that the Maya exporter doesn’t support multiple UV sets. On my wish list, I’d like an option to export “baked” keyframe data for animations at a specified frame rate (I will probably add this myself soon).

Edited to remove copywritten source code. Admin.


 Your post couldn't be more timely. I've just been hired by Alias, to improve the quality and reliability of the Maya plug-in for Collada. I have already started merging other people's code and fixing bugs. Please send me your changes at claforte 'at' feelingsoftware . com, and I'll make sure they get included in the next release, which should happen within a week or so.

 Thank you very much for your contribution!  :D

Christian Laforte
Maya API and OpenGL consultant