Apple Shake 4 User Manual

Page 954

Advertising
background image

954

Chapter 31

Expressions and Scripting

Because the above script was created with a local filepath (in the

Tutorial_Media/

truck directory), the images can only be found if the script is
run from the truck directory. For example, a local directory for the truck image might be:

/myMachine/documents/truck/truck.iff

In order to run the script from any location—so the images can be found regardless of
the location of the saved script—the absolute path of the images is required. The
following is an example of an absolute directory for the same image (truck):

/Server02/VolumeX/Scene12/truck/truck.iff

To reset the filepaths to an absolute path:

1

To determine the absolute path of the images, go into the directory into which you
copied the tutorial media (using the command line) and type the Present Working
Directory command:

pwd

2

Enter the filepath before the image names to make the path absolute. Shake does not
prompt you to find the absolute path each time you paste it into the interface.
Changes are in bold.

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

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

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

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

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

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

Outside1 = Outside(truck, sign_mask, 1);
Over1 = Over(Outside1, bg, 1, 0, 0);

The left side is the variable name. You can change the variable name, but you must
change the names wherever they appear.

3

Change the variable names:

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);

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

Advertising