Cutter
|
|
|
A .rman script does not create the interface in Maya. That task is accomplished by a
MEL script that uses two Pixar MEL procedures, Naming Conventions
The tutorial
"RMS: Ri Scripting" recommends the
use of a strict naming convention for ".rman" files and their "associated" MEL scripts.
For example, the MEL script that adds custom attributes to the
RenderMan tab should have the same name as the ".rman" script. Likewise the MEL script
that querries the interface and injects additional statements into the rib stream
should have a name derived from the ".rman" file. For example,
|
Example - An Interface for a Procedural Primitive
This section provides a step-by-step example of creating a ".rman"
script and its associated MEL scripts from scratch. The work flow consists of three
steps.
The scripts shown in this section should be saved in the
|
|
|
Declare param {string rp_path} {
label "Helper App Path"
description "No description."
subtype file
range {*.py}
}
|
|
Change the name of the param to |
Adding a String UIAfter the last param use the popup menu to insert a "string" (other) param block - figure 7. |
|
|
Declare param {string rp_args} {
label "Args"
description {Inputs must be separated by
at least one white space.}
}
|
|
Edit the param block so that it conforms to the text shown above. Adding a Float Slider UIUse the popup menu to insert a "float" (slder) param block - figure 8. |
|
|
Declare param {float rp_bboxScale} {
label "BBox Scale"
subtype slider
range {0.1 10 .001}
description "A scaling factor for the bounding box."
}
|
|
Edit the param block so that it conforms to the text shown above. Adding a Checkbox UIUse the popup menu to insert a "int" (switch) param block - figure 9. |
|
|
Declare param {int rp_useBBox} {
label "Use BBox"
description "Use or ignore the proxy bounding box."
subtype switch
}
|
Step 2.2 - Creating the RI MEL script
Use the
Listing 3 shows the MEL code that will be generated by Cutter. Save the script in the RMS_mel directory. Listing 3 (runProgramRI.mel)
The last three lines of MEL are present only for the purposes of showing where the code that uses Pixar's RiMel commands should appear in the script. |
Step 3 - Editing the MEL scripts
The runProgramUI.mel script requires very little editing. If the reader wishes to set a default value
they can do so by inserting an appropriate value within the empty quotations of an attribute. For example,
attr = `rmanGetAttrName "rrp_bboxScale"`;
rmanAddAttr $shapeName $attr "";
might be changed to, attr = `rmanGetAttrName "rrp_bboxScale"`;
rmanAddAttr $shapeName $attr "2.0";
The runProgramRI.mel script will require a moderate amount of editing. The three lines at the end of the runProgramRI.mel script should be replaced by the code snippet shown in listing 4. |
|
Listing 4
The code for the helper app (procedural primitive) is show in listing 5. |
|
Listing 5 (addpoints.py)
The addpoints.py script makes use of a module named pnoise. The code for it can be found in the tutorial "Noise: Perlin Improved Noise" listing 1. The scripts can be saved into any location, however, both addpoints.py and pnoise.py must be in the same directory. |
Using the Scripts
To add the interface to the shape node of surface follow these two steps.
|
© 2002- Malcolm Kesson. All rights reserved.