RMS
|
IntroductionThis tutorial looks at the issue of setting up a directory structure that will help an artist manage the .mel, .py, .rman, .slim and .tcl scripts they may use with Pixar's RenderMan Studio. Naming conventions are either a subject of personal preference or are imposed on an artist by the established practices of their studio. This tutorial pays particular attention to the way that directories, scripts and procedures are named. Of course, the reader is free to impose their own naming conventions on the material presented in this tutorial. Related TutorialsThe tutorial "Maya:Setup for Python" explains how to configure Maya so that it can load the users python scripts. The tutorial "Cutter:RiMel & Rman Scripting" explains how Cutter can help an artist prepare .mel and .rman scripts. The tutorial, "RMS:Cutter & Slim Templates", explains what slim files are and how the Cutter text editor can automatically generate them. |
|
Maya Directory Structure
maya/
|_ scripts # regular mel scripts ie. not related to RMS
|
|_ projects/
|_ RMS_ini/
| |_ RenderMan_for_Maya.ini # loads the users .rman scripts
| |_ slim.ini # loads the users .slim scripts
| |_ it.ini # loads the users .tcl scripts
|
|_ RMS_it/
| |_ saveJPG.tcl # a sample .tcl script for "it"
|
|_ RMS_mel/
| |_ addSphereRI.mel # sample scripts for Maya
| |_ addSphereUI.mel
| |_ addSphereUI.rman
|
|_ RMS_python/ # the users .py scripts are stored here
|
|_ RMS_slim/ # the users .slim (template) scripts are stored here
|
|
The directory structure shown above confines the scripts commonly used with RMS
to five sub-directories. Setting up Maya and RMS so that the
mel, rman, slim and "it" scripts can be referenced consists of the following steps.
Setting the Environment VariablesWindows & Linux
Add these two lines of text to the RMS_SCRIPT_PATHS=$MAYA_APP_DIR/projects/RMS_ini
MAYA_SCRIPT_PATH=$MAYA_APP_DIR/projects/RMS_mel
OSX
Add these two lines of text to the users |
RMS_SCRIPT_PATHS=/Users/$USER/Documents/maya/projects/RMS_ini
MAYA_SCRIPT_PATH=/Users/$USER/Documents/maya/projects/RMS_mel
|
Initialization Scripts
The initialization (.ini) scripts shown next should be saved in the |
|
it.ini (Windows & Linux)
|
|
it.ini (Mac OSX)
|
|
RenderMan_for_Maya.ini (Windows & Linux)
|
|
RenderMan_for_Maya.ini (Mac OSX)
|
|
slim.ini (Windows & Linux)
|
|
slim.ini (Mac OSX)
|
Image Tool Scripts
The Image Tool ("it") is an application commonly used to display images rendered
using RenderMan for Maya or rendered directly from a rib file that has been prepared
with Cutter. Images rendered to "it" are displayed in a window that
is superficially similar to Maya's fcheck application. However, unlike fcheck
the Image Tool has a powerful set of image processing functions built into its
scripting environment.
|
Testing the saveJPG.tcl ScriptFollow these steps to check if the it.ini initialization script and the sample Image Tool saveJPG.tcl script are working correctly.
The image will be saved in the present working directly, most often the Maya project directory.
To change to another directory use the following command, for example,
|
Mel & Rman ScriptsArtists using RenderMan Studio can dramatically alter the way a Maya scene is rendered by assigning mel scripts to the entire scene or to individual elements within the scene. Such mel scripts do not effect what Maya displays, they only alter the rib file (or rib stream) that Pixar's prman renderer receives. Refer to the tutorial "RMS: Ri Scripting" for an overview of this topic. This tutorial groups mel scripts, according to their functionality, into one of two types. UI Procedures
Procedures of this type setup what an artist will see in the "Extra RenderMan Attributes"
panel of the Attribute Editor. They are generally activated by a button previously added
to the Maya custom shelf. Alternatively, they are evoked directly from the script window.
Either way, such procedures automate the task of assigning, say, a
RI Procedures
Procedures of this type setup what the renderer will "see" in the rib file or rib
stream that it receives from the Rfm Pro plugin. These procedures implement the logic
that underpins the visual effect an artist wishes to create. They make use of so-called
addSquashySphere.mel
addSquashySphereAttrs.mel
it is difficult to know what procedures or functionality they implement. On the other hand, if a naming convention is followed that uses the suffixes UI and RI to classify mel scripts according to their functionality, then the following listing at least identifies the "role" that each script plays. addSquashySphereUI.mel // front-end user interface script
addSquashySphereRI.mel // back-end "RenderMan Interface" script
In addition, if a naming convention also stipulates that the main procedure within a mel script has identically the same name as the file itself, then the mel script that implements, say, this procedure, global proc addSquashySphereRI() should be easy to find within the users Maya directory structure. Rman Interface Scripts
As noted above, a mel script of the RI type may have a front-end UI script.
A UI script will, at the very least, add a string attribute to an object with a default
value that equals the name of a procedure implemented by a RI script (refer to comments
1 and 2 in the first mel script shown below). Additionally, a UI script may also setup some
UI widgets within the "Extra RenderMan Attributes" panel of the Attribute Editor - figure 1.
As a convenience, the characteristics of a widget or
widgets can be concisely described by a
By way of example, the following three scripts implement a custom RenderMan attribute
that "assigns" a quadric sphere to a selected object or objects. If the primary visibility of the
object to which the |
|
addSphereUI.mel
addSphereRI.rman
addSphereRI.mel
|
Testing the .mel and .rman ScriptsFollow these steps to check if the initialization files and the sample scripts are working correctly.
|
© 2002- Malcolm Kesson. All rights reserved.