I refactored the exporter a little bit and simplified it in general. Meshes now export perfectly with their proper transforms.
The meshes have to export to obj files relative to their parent SceneNode. The easiest way to do this is to just put the scene node exactly at the origin and call maya’s export obj function. Unfortunately, it’s actually pretty difficult to do this from Maya’s C++ API.
The solution?
Use the Maya API to call MEL commands. I burned most of a day trying to get meshes to export properly using only the C++ Api. Once I remembered I could use MEL, everything was working perfectly within 20 minutes. I don’t know why, but when I work in C++ I completely forget that MEL even exists.
In all, the exporter can handle just about any scene that can be made in maya. I exported one of Denrei’s maps blindly and there were no problems. Further, the exporter is architected in a way that makes it dead simple to add handlers for exporting new node types. So, when we want to add a new node, perhaps a sound node, a handler is added and it is exported with the scene.