RMS
|
Introduction
Naming conventions are either a subject of personal preference or are
imposed on an artist by the established practices of their studio. Depending on your
circumstances you may prefer to ignore this section.
|
|
Directory Structure
maya/
|_ scripts # regular mel scripts ie. not related to RMS
|
|_ projects/
|_ RMS_ini/
| |_ RenderMan_for_Maya.ini # loads the users .rman files
| |_ slim.ini # loads the users .slim files
|
|_ RMS_mel/
| |_ addSphereRI.mel # sample file - explained later
| |_ addSphereUI.mel # ditto
| |_ addSphereUI.rman # ditto
|
|_ RMS_slim/ # the users slim template files would be stored here
|
|
The directory structure shown above confines an artists RMS scripts to three sub-directories.
Setting up Maya and RMS so that both applications reference those scripts
consists of three steps.
Setting the Environment VariablesWindows & Linux
Add these two lines of text to your RMS_SCRIPT_PATHS=$MAYA_APP_DIR/projects/RMS_ini
MAYA_SCRIPT_PATH=$MAYA_APP_DIR/projects/RMS_mel
OSX
In your |
RMS_SCRIPT_PATHS=/Users/$USER/Documents/maya/projects/RMS_ini
MAYA_SCRIPT_PATH=/Users/$USER/Documents/maya/projects/RMS_mel
|
Initialization Scripts
The initialization scripts shown next should be saved in the |
|
RenderMan_for_Maya.ini (Windows & Linux)
|
|
RenderMan_for_Maya.ini (OSX)
|
|
slim.ini (Windows & Linux)
|
|
slim.ini (OSX)
|
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 interface script
addSquashySphereRI.mel // back-end 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
|
TestingFollow these steps to check if the initialization files and the sample scripts are working properly.
|