9.21.2013

Mitsuba for Maya - Background, VRay examples, Maya api, XCode framework

For my senior design project, I am building a plugin for Maya that will allow Maya to interact with the Mitsuba rendering engine.  The Mitsuba website can be found here.  This past summer, I worked on developing a plugin for Mitsuba for a research project at Cornell University.  Mitsuba is extremely full-featured (see the documentation here), but does not have the most intuitive or easy to use front end.  So, I am planning to write a plugin that will allow Maya to serve as the front end for Mitsuba.  

The main example that I am going to use as a guide is the VRay for Maya plugin.  VRay is similar to Mitsuba in a lot of ways, and I think they can often be used to solve the same kinds of rendering problems, such as global illumination in complex scenes.  They differ in that VRay is a commercial renderer, while Mitsuba is a research oriented system.  I don't think that this will make a huge impact on how I design my plugin, but I think that it is important to at least note it.  Here is a general video of the VRay for Maya plugin:



There are a lot of base functionality that I want to emulate, such as the render settings setup, render window features, and file output.  At the basis for all of this, however, is writing out the geometry to a Mitsuba scene file (which is really just an xml file with a specific format).  Geometry is what we are actually going to be rendering, so I think it is a good place to start.  Which bring me to the important question for this week - how do I output the geometry in a scene from Maya?  To find the answer, I have to wade through the massive Maya API and its documentation....

It took some time to even find what I should be looking for, but I eventually found this page in the documentation, which details File Translators.  The backend of my plugin is basically just writing the Maya scene file to a Mitsuba scene file, so I think this a perfect place to start.  To test, I am just going to add a button to the tool bar that exports the geometry from the scene to a Mitsuba scene file.  Then I'll render that scene file manually.  It's simple, but I have to start somewhere.

That brings me to how I am actually going to code this.  I am planning on developing Mac and Windows versions of this plugin, and I am starting on Mac.  Other than the exhaustive list of plugins that come with the Maya installation, I found a tutorial here that should prove to get me started.  I have never developed on a Mac before, so I haven't gotten all of the kinks worked out (XCode is not building the plugin at all actually), but I think I cam close.