beautypg.com

Apple Shake 4 Tutorials User Manual

Page 142

background image

142

Tutorial 4

Working With Expressions

You can’t edit this curve in the Curve Editor because each value is generated by the
expression. However, you can create additional variables, which are “local” to the Fade1
node, then use them to control the values generated by your original expression. The
result will be a curve or “envelope” that shapes the random values.

To help control the expression:

1

Right-click inthe Fade1 Parameters tab, then choose Create Local Variable from the
shortcut menu.

The Local Variable Parameters window appears.

2

Enter “rndVal” as the Variable name.

When you create a new variable, you also need to choose the type of information you
want to store in the variable:

float: A number with a decimal place (0.0, .1, .5024, 1.00, and so forth)

int: A rounded number (0,1, 2, and so forth)

string: Characters (“Hey, what’s up?”)

3

Set this variable to float, to specify a decimal value.

4

Click Next to create the next variable.

5

Replace the rndVal name with animVal, set this variable to float also, then click OK.

A new subtree named localParameters appears at the bottom of the Fade1
parameters list.

6

Open the localParameters subtree to access the new local variables.

If you adjust the rndVal slider, you’ll see that absolutely nothing happens. Why? You
need to make a few more changes before this parameter becomes active. If you
adjusted the rndVal slider, set it back to 0 now.

7

Turn on Autokey for the animVal parameter.