Passes |
How to find out what kinds of passes there are
Instantiating passes
Adding a secondary output to a pass
Listing of known channels
How to get a list of a pass's outputs
Deleting a pass's extra outputs
Refreshing the Attribute Editor after adding settings to a node
RenderMan for Maya provides controls for advanced pass manipulation. Passes can be created and modified via MEL scripting. What follows is an examination of how to manipulate passes for RenderMan for Maya using MEL scripting.
RenderMan pass nodes in Maya are based on nodetype templates defined in RenderMan_for_Maya.ini. Here's what the beginning of the Shadow pass template looks like:
nodetype pass:render:Shadow {The part of the node type after the last colon is what will be refered to as its class. You could browse RenderMan_for_Maya.ini looking for pass classes. An easier place to look would be under the Passes tab in the render globals. If you click on the "Create Pass" button you can see an option menu containing all the known pass classes. Another easy way to get a list of pass classes is with this MEL command:
rmanGetPassClasses; // Result: Custom DeepShadow EnvCube EnvMap EnvNx EnvNy EnvNz EnvPx EnvPy EnvPz EnvRender Final MakeGlobalDiffuse2d MakeGlobalDiffuse3d Reference ReferenceImage Reflection RenderGlobalDiffuse2d RenderGlobalDiffuse3d SSDiffuse SSMakeBrickmap SSRender Shadow TxMake //
(top)
Once you know which class of pass you're interested in, instantiating it in Maya is as simple as typing the following MEL command.
Its definition looks like this:
global proc string rmanCreatePass(string $passclass)And here's an example:rmanCreatePass Shadow; // Result: rmanShadowPass //Once you've created a pass you can always find it again by looking under the Passes tab of the RenderMan Settings.
(top)
Here's the command you can use to add an extra output to a pass. Note, passes are normally instantiated with at least one output, so adding outputs is only necessary if you want extra outputs. This command creates an output node and wires it into the pass node.
global proc string rmanAddOutput( string $passnode, string $channels )The $channels parameter refers to the name of the output channel you're interested in.
Examples:
This causes a "specular" output to be added to all final passes.
rmanAddOutput rmanFinalGlobals specular; // Result: rmanFinalOutput1 //This adds an output containting surface normals to a specific render pass.
rmanAddOutput rmanFinalPass N; // Result: rmanFinalOutput2 //It's possible to put more than one channel into an output by separating channel names with commas. For example, this will generate an output containing u and v data.
rmanAddOutput rmanFinalPass "u,v"; // Result: rmanFinalOutput3 //
(top)
There's a command called rmanGetChannelClasses which will return a string array of the channels which are understood by the rmanAddOutput command.
Example
rmanGetChannelClasses; // Result: Ci Cs N Ng Oi Os P SSAlbedo SSArea SSDMFP SSRadiance ambient diffuse environmentdir globaldiffuse incandescence irradiance occlusion reflection refraction s shadow specular subsurface t u v velocity //
(top)
To get a list of the output nodes of a pass, use this command:
global proc string[] rmanGetOutputs( string $passnode )Example:
rmanGetOutputs rmanFinalGlobals; // Result: rmanFinalOutputGlobals0 rmanFinalOutput1 //
(top)
You can get rid of a pass's extra outputs with this command:
global proc rmanDeleteOutput( string $passnode, int $idx )This command takes an index, where "1" is the primary output, which can't be deleted. So the index you supply should be greater than 1.
You can get also delete extra outputs by simply deleting a pass's output nodes (which are wired in to the pass).
Example:
delete rmanFinalOutput1;
(top)
To cause the Attribute Editor's Extra RenderMan Attributes section to update, use this command:
rmanUpdateAE
(top)
Pixar Animation Studios
|