9.28.2013

MitsubaForMaya - Python or c++

When I started this project, I wanted to develop both a Mac and PC version.  I have never developed seriously on a Mac before, so I thought it would be good practice.  As such, I familiarized myself with XCode IDE and began to look for an appropriate place to use as a jumping off point for the plugin.  However, Michael (the TA for senior design) suggested I look into the Python API for Maya, as the regular old c++/mel API is a nightmare to work with.  I normally would have used Python to begin with since I'm obsessed with Python, but I thought I should use c++ and its API since this plugin is likely to be relatively large and I equate that with c++.

To cut the story short, I am going to prototype the plugin using Python, and if it is too slow or hard to maintain, I will make a c++ version if I have time.

Python is the future anyways.

Edit: I made a test shader last night in Python as a proof of concept that I can make my own shaders for the user to use:


As you can see, this shader is called "Jeremy Test Shader", and computes shading based on the position of each point on the object.

I also should explain why exactly I am making these custom shaders.  Before that though, let me explain a little bit more about Mitsuba.  As a part of the system, Wenzel included a large number of material "plugins" (the term he uses for each module in the system).  These are all physically based, and their use is sometimes quite different from the use of Maya's equivalent.  And most of Mitsuba's materials do not have a Maya equivalent.  Here is a list of the surface materials that Mitsuba supports:

Smooth difuse material (diffuse)
Rough difuse material (roughdiffuse) 
Smooth dielectric material (dielectric) 
Thin dielectric material (thindielectric) 
Rough dielectric material (roughdielectric) .
Smooth conductor (conductor) 
Rough conductor material (roughconductor)
Smooth plastic material (plastic)
Rough plastic material (roughplastic) 
Smooth dielectric coating (coating)
Rough dielectric coating (roughcoating) 
Bump map modiier (bump)
Modified Phong BRDF (phong) 
Anisotropic Ward BRDF (ward) 
Mixture material (mixturebsdf)
Blended material (blendbsdf)
Opacity mask (mask)
Two-sided BRDF adapter (twosided) 
Irawan & Marschner woven cloth BRDF (irawan) 
Hanrahan-Krueger BSDF (hk) 

Difuse transmitter (difftrans) 

There are quite a few.  And there are other non-surface materials that I am neglecting for now.

The next steps are to export the geometry and materials (starting with diffuse only) to a real scene file.  Before that I need to figure out how to extend Maya's camera to create a physical camera that has all of the relevant properties that Mitsuba needs.