This is a collection of assorted software which I had written way back in 2003. Please note that these are 5 years old, so they may have lost some topical value now.

maya manipulator plugin

David Gould’s Complete Maya Programming , provided some insights into how to make a manipluator plugin. Here is one of my attempts. Please find the code here, that should work for Maya8.5.

  1. After you compile the code, please load in the plugin kgManip.mll.
  2. Source the mel script kgGenerateSlabs.mel.
  3. Run 'kgGenerateSlabs()' in the script window. This should create a grid of slabs and kgLocators on top of the slabs.
  4. Select any kgLocator
  5. Modify/Transformation Tools/Show Maniplulator Tools. THis makes the corresponding manipulator visible. Trypulling the manipulator. This changes the slab height.

Environment mapping using renderman

I created the following maya scene , using NURBS modeling in Maya. For aligning them on the floor, I dropped 10 or so vases from different heights, and let them bounce and settle on the ground, utilizing a gravity field. I had used the u-v texture editor to texture map the sky-dome using the following spherical texture map sph_sky which I found in the web. I used the maya-rib exporter that came with my Maya Unlimited 4.5, and since it didnt export texture coordinates, I wrote a mel script to export a selected geometry and texture coordinate as a rib file. Next I had to generate the environment maps from the scene, so that they can be used in the environment map shaders for the balls. For this I created this mel script . With these useful mel scripts, I could create the rib files 1, and 2 . As I said before, I used the standard environment mapping shader which was already available. Here is the result.shiny_balls_final

Two things that I have used for this project have since then been discontinued.

  • BMRT renderer for renderman
  • Rib exporter, bundled with Maya 4.5

Ambient Occlusion Shader for Renderman

Here is an ambient occlusion shader for renderman. I have used stratified sampling of the hemisphere surrounding a point to get the ambient occlusion value. Here amb_occis the result of ambient occlusion. Here directional_lightingis the result of lighting the same scene with directional lighting. Here is the composited image.composited_amb_occ_dirlight

Shader evaluation using python script

This is a small set of python scripts that renders a rib file multiple times, eachtime with different shader parameters. The scripts are

First, edit the shaderParamDict in the script shaderStat.py to specify the maximum and minimum values, of the shader parameters to be tested, and a way to iterate them. These are parameters that you can specify in a declarative manner.

Then do

shaderStat.py <input rib file name> <shader name> <sub sequence of shader parameter names that need be verified> I have used the following python features in this script.

  • currying
  • OO design
  • iterators, generators
  • dynamic changing of the functions of a module

Here are some resulting images for a simple noise shader on a simple vase scene. shader_stat_result



blog comments powered by Disqus

Published

04 December 2008

Tags