Man Versus Code

The personal website of Joe Marrero.

Maya Exporters: Exporting texture data

Wow. I am starting to lean towards 3DS Max from Maya. To retrieve the texture data from Maya it appears you would have to traverse the DAG differently, because the plugs are different.



Moreoever, after taking a peek at the Maya exporter from Ogre this is exactly what they do. The problem lies in the fact that for multitexturing in Maya, you need to have a layered texture node. This node would then be between the material node and the texture file node. For single texturing, the texture file node is directly connected to the color plug of the material node. Any Maya exporter has to be able to detect multitexturing by iterating over the DAG and looking for any layered texture nodes.

This interesting "round-about" problem also brings me to another interesting weird fact about Maya. When exporting materials that are connected with texture data, the color attribute gets locked and cannot be changed from within Maya. The color of the color attribute is set to black when it has a texture. Therefore, the diffuse color of the material properties will get incorrectly exported to the color black. Now, when I peeked at the Ogre Maya exporter code again, I saw that they fix the diffuse color by setting it to <1.0f, 1.0f, 1.0f, 1.0f> instead of the color stored within the material (because it is black).



Although Maya is extremely extensible, it appears not to be as developer-friendly as the API that comes with 3DS Max. Very sad indeed.