Some RenderMan tricks require that multiple passes be created, this dialog makes it easy to setup such passes.
| Name | the name of the pass, used to generate rib and image names, also passed as the Attribute/user/passtype value |
| On | is the pass enabled? |
| Camera | the name of the camera to render. Note the name can be the parent of the camera (ie: persp instead of perspShape) |
| Script | the name of a mel function to run at the beginning/end of the pass, the script is called with an integer argument of 3 before a preview, 1 before a render, 2 after a preview and 0 after a render. Typically the only difference between preview and render will visibility manipulation of display .vs. render layers. MayaMan will automatically restore most parameters so the '0' invokation only has to undo tricky stuff. Note, you must not create or destroy things, you can manipulate visibility. |
global proc my_passSetup(int $mode)
{
// create some attributes somewhere to hold the values I'm going to change
// might as well hang them on the nugget
if(!`objExists MayaManNugget.my_pass_old_width`) {
addAttr -ln my_pass_old_width -at long MayaManNugget;
addAttr -ln my_pass_old_height -at long MayaManNugget;
}
switch($mode) {
case 3: // configure the scene for a preview
case 1: // configure the scene for a render
setAttr MayaManNugget.my_pass_old_width `getAttr defaultResolution.width`;
setAttr MayaManNugget.my_pass_old_height `getAttr defaultResolution.height`;
setAttr defaultResolution.width 512;
setAttr defaultResolution.height 512;
setAttr -type "string" MayaManNugget.CustomDisplay "framebuffer";
if($mode == 3) {
setAttr "ball_layer.visibility" 0;
setAttr "small_layer.visibility" 1;
}
break;
case 2: // put settings back how they were before the preview
case 0: // put settings back how they were before the render
setAttr defaultResolution.width `getAttr MayaManNugget.my_pass_old_width`;
setAttr defaultResolution.height `getAttr MayaManNugget.my_pass_old_height`;
if($mode == 2) {
setAttr "ball_layer.visibility" 1;
setAttr "small_layer.visibility" 0;
}
break;
}
}
global proc multi_pass_setup(string $mtl, string $chan, int $mode)
{
...
}
And the entry in the 'Script' field of the pass would be something like:
multi_pass_setup "lambert1" "diffuse"