|
Introduction
When Cutter writes an appearance or template slim file it parses the data
for each shader/function parameter. Cutter reads the datatype, name, default
value and any commented text that accompanies a parameter. Converting
a parameter datatype, name and value to the appropriate Slim file format is
straight forward. However, Cutter uses certain items of information "embedded"
within the comments as a guide to how it should define the GUI of a node.
Cutter determines what information to put into a slim file
in a two step process.
Step 1
First, it guesses what each parameter should look like when they
are displayed by the Slim editor. The guesses are based on the data type and name
of each shader parameter or function argument.
Step 2
Next, Cutter looks for a user-interface hint (ui-hint) within the comments
associated with a parameter. Cutter considers any text it
finds within "[" and "]" brackets as possible sources of information that it
can use to refine the "look" of the GUI.
Table 1 gives a full listing of the rules that it applies when making a guess
about the "look" of a GUI. Table 2 lists what Cutter considers to be valid ui-hints.
Table 1 Guessing
|
float param
If param begins with "K",
for example,
float Kz = 0;
or the param name is either,
roughness, blend, mix,
smooth or step
The slider will have the range 0 to 1.
|
If the name of a parameter matches the names shown on the left,
or if its initial character is "K", Cutter will write a slim document
that will assign a slider. This occurs only if the
parameter is of type float
|
string param
A guess is made about the type
of popup menu that should appear
next o the text field based on
a partial match of param with
the following,
tex, tra,
env,
filter,
shad,
refl,
world, shader,
camera, current or coord
|
The list of partial names on
the left are associated with
the following Slim subtype's.
Subtypes configure the popup
menu that appears next to a
text field. Sub-types are,
"texture"
"environment"
"filter"
"shadow"
"reflection"
"spacename"
"spacename"
|
Table 2 UI-hints
|
float param
Examples
/* [-2 5] */
/* [-2 5 1] */
/* [0 or 1] */
/* [low med high 1 2 3] */
|
"slider" range from -2 to 5
"slider" 1 unit increments
"switch" on or off
"selector" popup names/values
|
string param
Examples
/* [texture] */
/* [environment] */
/* [filter] */
/* [shadow] */
/* [reflection] */
/* [spacename] */
|
A Slim popup will match th ui-hint.
In the case of filter a "selector" will be assigned
with following values,
box
gaussian
disk
radial-bspline
|
ANY param
Examples
/* [collection foo] */
/* [group foo 0 or 1] */
/* [collection foo pixar,FNoise]*/
|
If a hint begins with collection or group the parameter is bundled
into a Slim collection . The collection is displayed in a "closed" state.
|
ANY param (but not strings)
Examples
/* [inline pixar,FNoise] */
|
The connected node will appear (inline) with a parameter. Can only be used when converting a shader or a rsl function to a
Slim template.
|
ANY param
Examples
/* [exp {lerp(0.0,1,$pct)}] */
/* [expr {lerp(0.0,1,$pct)}] */
/* [expression "lerp(0.0,1,$pct)"] */
|
A hint beginning with exp, expr or expression followed by text bounded by "{" and "}"
or by double quotes defines a Tcl expression.
|
ANY param
Examples
/* [Label "Hello World"] */
/* [label "Hello World"] */
|
|
ANY param
Examples
/* [default "1 1 1"] */
/* [Default 1.2] */
|
Multiple values, the components of a color for example, must be quoted.
Can only be used when converting a shader or a rsl function to a
Slim template.
|
|