Apple Shake 4 User Manual

Page 915

Advertising
background image

Chapter 30

Installing and Creating Macros

915

Notice that the default parameter value is optional, so if you use this particular
function, all four values must be supplied:

float angle(

float x1,
float y1,
float x2,
float y2

)
{

return atan2d(y2-y1,x2-x1);

}

Because the macro is so simple (one function), there is no Macro Body per se; the
function is attached to the return statement, which indicates what is spit out of the
macro. To use this function, use something like the following:

myAngle = angle(0,0,100,100);

that returns 45.0.

The following is an example of an image function. It adds that “vaseline-on-the-lens”
effect. The following represents the node tree, with a split-screen example of the effect.

Advertising