Adding pop-up menus – Apple Shake 4 User Manual

Page 383

Advertising
background image

Chapter 14

Customizing Shake

383

Even though the sliders are in relatively the same position, there are different numbers
in the value fields. You can set slider ranges and precision with this function. The first
line assigns a slider range just for the yPan parameter of the Move2D function. Note the
use of the height variable so the range adjusts according to the input image. The
second line assigns a range for the angle parameter in any node. The third line also has
optional precision parameters, which are granularity and notch spacing.

granularity represents the truncation point. Shake cuts off all values smaller than your
truncation value, that is, if your granularity is .01, a value of .2344 becomes .23.
Granularity is a “hard” snap—if granularity is set to 0.001, you cannot get anything
but multiples of 0.001 when you slide. Also, granularity cannot be anything but a
multiple of 10 (+ or -).

notch spacing represents at what value interval the magnets appear. A value of .1
means the magnets are at .1, .2, .3, and so on. The default value is .1. Notch spacing is
a “soft” snap—the slider tends to stick longer to multiples of notch spacing, but does
not prevent the selection of other values. Think of it as a tiny notch in a flat line
where a ball rolls: The ball tends to get stuck in the notch, but if you keep pushing, it
eventually gets out.

Adding Pop-Up Menus

In the ui directory:

nuxDefMultiChoice(“Defocus.shape”,
“fast gaussian|fast box|circle”
);

This pop-up menu, from the Defocus function, allows you to use a pop-up menu for
strings. Note this only supplies strings and not numbers, so you have to do some tricky
math inside the macro itself. For more information, see Chapter 31,

Expressions and Scripting

,” on page 935.

Advertising