MayaMan Help Contents

MayaMan Extra Pass

Some RenderMan tricks require that multiple passes be created, this dialog makes it easy to setup such passes.

Output Extra Pass during Preview

This option controls whether the extra pass images are produced when doing a preview.

Output Extra Pass during Render

This option controls whether the extra pass images are produced when doing a render-single or render-sequence.

Scripts Change Visibility

If the pass scripts changes layer/object visibility then you'll need to turn on this flag.. normally MayaMan discards hidden objects early but if they are going to be needed for later passes then this flag disables the culling.

Pass Options

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.

Example of Pass Config Script


    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;
      }
    }

Example of Pass Config Script With Extra Arguments

Sometimes it's useful to use one script to configure more than one pass... in this case the procedure should be declared with the $mode argument last.

	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"

MayaMan Help Contents