RMS
|
Introduction
Pixar's RenderMan Studio (RMS) enables most of the functionality
"normally" accessed via their GUI's ie. mouse and keyboard input, to be
controlled directly via MEL scripts.
|
Accessing Slim CommandsInvoking a slim command from MEL takes the general form of, rman slim "COMMAND -flag1 -flag2..."; // for example rman slim "[slim CreatePalette -new -edit]"; or rman slim "$reference COMMAND -flag data]"; // for example rman slim "set plastic [$p CreateInstance -file \"$RMANTREE/lib/shaders/plastic.slo\"]"; rman slim "set cs [$plastic GetProperties -name \"Cs\"]"; or slimcmd $reference COMMAND info; // for example rman slim "[$p SetLabel \"my palette\"]"; By $reference I mean a string that indentifies a slim object - Pixar's documentation calls them "handles". |
Creating a PaletteBecause the MEL script we are writing will most probably be run several times we need to check for the existance of a previously created palette.code snippet 1
|
Adding a ShaderThe macro $RMANTREE will expand to the full path of the Pixar directory.code snippet 2
|
Setting Shader ValuesNotice the use of quoted curly braces to enclose multiple values. Internallyslim uses the TCL scripting language - lists are enclosed in parenthesises. code snippet 3
|
Adding a TemplateThis mel snippet assumes a slim template file is located at /home/user_name/cutrTest.slim The slim template represents a constant "shader" ie. slim 1 extensions cutter { extensions fundza cutr { template shadingmodel Test { collection shadingmodel shadingmodel { access output display hidden parameter color CI { access output } parameter color OI { access output } } RSLFunction { void cutrTest ( output color CI; output color OI; ) { OI = Os; CI = OI * Cs; } code snippet 4
|
© 2002- Malcolm Kesson. All rights reserved.