Cutter - Automatic Conversion of Shaders and RSL Functions to Slim Files
return to main index |
|
i n t r o d u c t i o n
This tutorial provides a detailed description of Cutter's ability
to automatically generate Slim
template and appearance files. Although the tutorial includes
a brief description of these files it is assumed the reader has some familiarity
with Slim palettes and appearance editors. The tutorial is targeted at
RenderMan ArtistTools.
However, these notes will require revision once Pixar's new high end product,
RenderMan Studio is released.
|
Side Note: To avoid confusion, when this tutorial refers to the Slim application it will capitalize the first letter of the word Slim. Slim's text files, on the other hand, will be referred to in all lower case ie. slim. |
|
Slim scripts are text files that come in two flavors - appearance slims and template slims.
Both are built on top of Tcl and both are identified by their ".slim" file extension.
An appearance slim file contains GUI information that defines the interface presented by a
Slim editor to an artist for the purpose of adjusting the parameters of a shader.
By itself an appearance slim file is useless - it must be accompanied by a pre-compiled
shader. A template file, on the other hand, is not associated with a pre-compiled shader so
in addition to having GUI information it also contains Tcl code that is used
by Slim to write and compile a shader "on-the-fly".
programmingRAT/customizing_slim/slimfile.html
programmingRAT/customizing_slim/templatesAdvanced.html
Fundza has a rudimentary, though quite handy, slim quick reference for those who wish to write slim files by hand. Cutter can assist a shader writer by automatically generating both appearance and template slim files. |
|
a p p e a r a n c e s l i m s Edit->Show Preferences->Rman->User->shaders
By including user-interface hints within the comments that "accompany" the declaration
of a shaders parameters (instance variables) a shader writer can easily take
advantage of Cutters ability to "tune" the way a shader is presented by a
slim editor.
|
figure 1
figure 2 - setting the shaders directory |
|
To create a node from the custom template use the "Preloaded" menu item (figure 5). Alternatively, Cutter can "tell" Slim to read your template. In Maya enter the following command, commandPort -n ":2222" Cutter's execute command (keyboard short cut alt+e or control+e) will send a Mel command to Maya that will cause Slim to,
|
|
|
h y b r i d
Defining shading nodes with template slim files provides an artist with the flexibility to connect its inputs to a shading network. On the other hand, limiting an artist to using pre-compiled shaders prevents them from using the node as part of a shading network. Between these two "extremes" there is a hybrid approach in which the artist is given a custom node, defined by a slim template, but some of its parameters are hard-wired ie. pre-connected, to specific nodes. Using the "inline hint" shown in the above table ensures a parameter is pre-connected and that the connection cannot be broken. |
|
c o p i e s o f s h a d e r & s l i m d o c s
slim 1 appearance slim {
instance surface "foo" "//C/shaders/foo" {
This is fine when the shader (plus slim appearance file) is imported into Slim
and the Maya scene is rendered on the users local computer but
the absolute path causes errors when a Maya project directory is moved to
a render farm.
slim 1 appearance slim {
instance surface "foo" "rmanshader/foo" {
|
|
|
|
|
l i m i t a t i o n s
There's probably lots of them, but here are the known ones!
#include's
The first location in which the file is
found will be used as the specification of the full path given to the slim output
document. If the include file cannot be found it is specified "as is" in the
output slim document - this will almost certainly cause an error later if
the template is loaded into slim.
shader instance variables and their default values float foo = 5,
koo = radians(5);
but not these assignments, float foo = 1/(2 * PI); float pp = PI; Cutter can handle fixed length arrays but not the newer kind of variable length arrays. For example, this is acceptable, color nnn[3] = {1, (1,2,3), color(1)};
#define's |
|
s i g n a t u r e s The Languages->Slim preferences panel (figure 6) enables a user to set their "studio", "author" and "prefix" signatures. These items are used to identify the slim templates generated by Cutter. |
figure 6 |
© 2002-5 Malcolm Kesson. All rights reserved.