Prev | Next


RfM Quick Reference Guide


MEL Commands


RenderMan for Maya includes a number of useful MEL scripts that can be used in various ways. These scripts can affect Render Settings, attributes on nodes, your workspace, and even specific passes.


Note: parameters that are surrounded by ? are optional (Example: ?nm?).
rman Commands
rman genrib
Generates the RIB files for the scene, but does not render the scene.
rman render
The rman render command is equivalent to rendering Maya-style from the command line, i.e. Render -r rman.
rman stringinterpolate|subst str
Substitutes variables in the string str. rman subst allows for Tcl command substitution; rman stringinterpolate does not. Example:
rman stringinterpolate "The current frame number is $F4";
// Result: The current frame number is 0005 //
rman subst "1 + 1 = [expr 1+1]";
// Result: 1+1 = 2 //
rman getPref nm
Returns the value of the pref nm. Example:
rman getPref LicenseServer;
// Result: [file join [RATGetDir installdir] rmantree etc pixar.license] //
rman getPrefNames pat
Returns a list of all RenderMan for Maya prefs that match the pattern pat. Example:
rman getPrefNames "Job*"
// Result: JobPhaseTree //
rman setPref nm val
Sets the value of the pref nm to val. Example:
rman setPref BatchCompileMode lazy;
rman getvar nm
Query for the value of the RfM scripting variable named nm. Example:
rman getvar STAGE;
// Result: untitled //
rman getvar RIBPATH;
// Result: renderman/untitled/rib //
rman setvar nm val
Set an RfM variable named nm with value val to be used in scripting. Example:
rman setvar MYSHADERPATH "/path/to/my/shaders"
rman slim start
rman slim stop
rman slim message msg
These are used to communicate with Slim (RenderMan Studio only). rman slim start and rman slim stop are used to start and stop Slim respectively. rman slim message msg is used to tell Slim a message. For more information, refer to the Slim scripting page. Example:
rman slim message "plt1 CreateInstance -template pixar,Blinn#2";
rman loadShader nodename slofile
Causes the RenderMan shader slofile to be loaded on the RenderMan Shader Node node. Example:
rman loadShader RenderManShader1 "/path/to/shaders/plastic.slo";
rman getMayaAttrName nm
rman getRmanAttrName nm
Convert the Maya attribute name nm to the RenderMan equivalent or vice-versa. Example:
rman getMayaAttrName ShadingRate
// Result: rman__riattr___ShadingRate // 
rman getRmanAttrName rman__riattr___ShadingRate
// Result: ShadingRate //
rman regsub ?-all? pattern argument subspec
Match the regular expression pattern against the string argument and replace with subspec. Then, return the substituted string. The optional parameter -all will replace all occurences. Example:
rman regsub "5" "My 5a55y girl" "s";
// Result: My sa55y girl //
rman regsub -all "5" "My 5a55y girl" "s";
// Result: My sassy girl //
rman regexp ?-stringArray|-sa|-matchOnly|-mo? pattern argument
Matches the regular expression pattern against the string argument and will return all matches. If -matchOnly or -mo is passed as an argument, the command will return 1 if there are any matches and 0 otherwise. If -stringArray or -sa is passed as an argument, the command will return the matches in a string array. Example:
rman regexp -matchOnly "-v" "file-v234.ma";
// Result: 1 //
rman regexp -mo "_v" "file-v234.ma";
// Result: 0 //
rman debug msglevel
Changes the current debug message level to msglevel. msglevel can be either: DEBUG, INFO, NOTICE, WARNING, ERROR.
rman date
Returns the current date.
rman getversion ?nm?
Query for the version number of RenderMan for Maya. You can also query for the version number of other components by passing in a name for the third argument nm, where nm can be one of the following: about, mayaAPI, prman, platform, os, osVersion
rman getversion 
// Result: 2.0 (Jun 21 2007 11:18:54) Pro //
rman getversion about; // returns the string viewed via About RenderMan
// RenderMan_for_Maya 2.0 (Jun 21 2007 13:28:34) Pro
   RenderMan Studio 1.0
   Copyright (c) 1996-2007 Pixar Animation Studios.  All rights reserved.
// 
rman getversion prman; // returns prman version RfM was built against
 // Result: 13.0.5 // 

MEL Procedures
rmanGetAttrName nm
Convert the RenderMan attribute named nm to the corresponding Maya attribute name. The attribute names can then be added to the user's objects with rmanAddAttr. Example:
rmanGetAttrName "ShadingRate";
// Result: rman__riattr___ShadingRate //
rmanGetAttrName "trace:maxspeculardepth";
// Result: rman__riattr__trace_maxspeculardepth //
rmanAddAttr node attr val
Add the RenderMan attribute attr with value val to the node node. Example:
rmanAddAttr nurbsSphereShape1 rman__riattr___ShadingRate "";
You can combine rmanAddAttr with the rmanGetAttrName procedure (see above). Example:
rmanAddAttr nurbsSphereShape1 `rmanGetAttrName ShadingRate` "";
rmanSetAttr node attr val
Sets the value of attribute attr on the node node to val. This can be more advantageous than using Maya's setAttr as the data type of the attribute does not need to be known, and the value can be supplied as a string. Example:
rmanSetAttr nurbsSphereShape1 rman__riattr___ShadingRate 5;
setAttr nurbsSphereShape1.rman__riattr___ShadingRate 1;
rmanExecAEMenuCmd
Can be used to execute the equivalent selection sensitive menus which appear in the Attribute Editor under the Attributes->RenderMan menu. It may be more desirable to use this procedure as these menus usually add more than one attribute. A list of the menu entries can be seen in the rfm_gui.rman file. Example:
rmanExecAEMenuCmd blinn1 "Add Subsurface Scattering";
rmanExecAEMenuCmd spotLightShape1 "Add Custom Light Shader";
rmanCreateGlobals
Use this command to create the render globals nodes. They're typically created when the Render Settings window is raised. Example:
rmanCreateGlobals;
rmanCreateEnvLight
Adds the RenderMan Environment Light to your scene. Example:
rmanCreateEnvLight;

 


Prev | Next


 

 

Pixar Animation Studios
Copyright© Pixar. All rights reserved.
Pixar® and RenderMan® are registered trademarks of Pixar.
All other trademarks are the properties of their respective holders.