Cutter
|
Introduction
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.
|
|
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
Refer to the tutorial "Slim Quick Reference" for examples of slim "parameter blocks". Cutter can assist an artist by automatically generating both appearance and template slim files. |
Appearance Slim FilesWhen the renderer in the RmanTools->Options->Environment popup menu (figure 1) is set to Pixar, Cutter automatically generates an appearance slim document for the RSL source code file being compiled.
For example, if the source code for Pixar's classic cloth.sl shader is compiled, Cutter will generate an appearance file called cloth.slim. Cutter saves its appearance slim files in the same directory as the compiled shader file.
A users preferred shader directory, figure 2, can be set using the Edit->Show Preferences->Rman->User->shaders
By including user-interface hints within the comments that "accompany" the declaration
of a shaders parameters (instance variables) an artist can easily take
advantage of Cutters ability to "tune" the way a shader is presented by HyperShade
(RMS) or Slim (RAT).
Template Slim FilesCutter can generate a template slim document from most types of shaders or RSL functions - but not functions that return void or an array. For example, figure 3 shows the code for an RSL function, taken from the Advanced RenderMan book, being exported as a slim template. After saving the slim document it must be loaded or read by Slim.
|
HybridDefining 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 table 2 ensures a parameter is pre-connected and that the connection cannot be broken. |
Copies of Shaders & their Appearance Slim FilesA slim appearance file generated by Cutter specifies the full path to the shader that "accompanies" the slim file, for example,
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 locally but an absolute path causes errors when a
Maya project directory is moved to a render farm for remote rendering.
For example, if the user selects the "rmanshader" directory the path to the shader in a slim appearance document would be of the form,
slim 1 appearance slim {
instance surface "foo" "rmanshader/foo" {
|
|
|
Limitations
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 ValuesCutter can "read" these assignments,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 |
SignaturesThe Languages->Slim preferences panel (figure 9) enables a user to set their "studio", "author" and "prefix" signatures. These items are used to identify the slim templates generated by Cutter.
|
© 2002- Malcolm Kesson. All rights reserved.