Apple Shake 4 User Manual

Page 955

Advertising
background image

Chapter 31

Expressions and Scripting

955

Therefore, the left side of the above lines is the variable that you assign a value. The
right side is the value, usually coming from a function such as SFileIn, Outside, or Over.
The function is called by its name, followed by its arguments between parentheses. The
arguments, called parameters, are very specifically organized and always specify the
same thing. For example, the third parameter of Outside is 1—a numeric code to
determine whether you take the foreground or background resolution (see “

Outside

on page 466). The line ends with a semicolon.

4

Feed the modified script back into the Shake interface.

The following steps illustrate how variables can help you. Insert the Mult color-
correction node to change the truck color. The script format for Mult (in “

Mult

” on

page 644) looks like the following:

image Mult(

image In,
float red,
float green,
float blue,
float alpha,
float depth

);

To add the Mult node, assign a variable name (here, MaryAnn) and then the parameters.
Since Lovey is the variable name of the truck, it is fed in as the image. The numbers turn
the truck yellow. Since Thurston (the Outside node) previously loaded the Lovey node,
switch it to MaryAnn, the new Mult node.

Note: The premultiplied state of the truck image is ignored for this example.

5

Insert the Mult node into the script:

Gilligan = SFileIn(“/Server02/VolumeX/Scene12/truck/

bg.iff”, “Auto”, 0, 0);

Skipper = SFileIn(“/Server02/VolumeX/Scene12/truck/

sign_mask.iff”, “Auto”, 0, 0);

Lovey = SFileIn(“/Server02/VolumeX/Scene12/truck

truck.iff”, “Auto”, 0, 0);

MaryAnn = Mult(Lovey, 1, 1, .2)

;

Thurston = Outside(MaryAnn, Skipper, 1);
Ginger = Over(Thurston, Gilligan, 1, 0, 0);

Advertising