beautypg.com

Apple Shake 4 Tutorials User Manual

Page 233

background image

Chapter 8

Working With Macros

233

To test the macro:

m

Go to the command line in Terminal.

You might be saying to yourself right now, “Hey, why am I testing this in a Terminal?” All
you have done so far is create the macro—you have not plugged it into the Shake
interface. You have not written anything that tells Shake to build this function into the
interface. You do that in a moment.

m

Test the function by typing in Terminal:

shake -help rotate

If everything worked properly, you should get a listing of all functions that contain the
word “rotate,” including the new function, RotateBlur.

Note: The command line is the only place where capitalization does not matter,
because it saves you the effort of having to press Shift all the time.

-rotate [angle] [aspectRatio] [xCenter] [yCenter] [motionBlur] [shutterTiming] [shutterOffset]

-rotateblur [angle] [blur]

If you do not get this help message, Terminal returns an error message that tells you
what went wrong.

Note: When working in Terminal, error messages are printed in that window. When
working in the interface, error messages are printed in the terminal that launched
Shake. If you launched Shake with the Dock, the messages appear in the Console. The
errors generally detail where you have a mistake or if you have a variable that is
incorrectly named.

If you cannot tell what is wrong from the error message, check the following list of
possible problems:

Match the capitalization and spelling of the variable names to where they are
plugged in. For example, did you declare the variable blur but use bluramount by
mistake later on?

Use normal parentheses for the variable declarations.

Use braces—{}—for the body of the macro.

Include a semicolon at the end of the return statement.

Do not include an extra comma at the end of your variables on the last line of the
variables. If you did, remove it.

Make sure the .h file was saved in your startup directory.

Make sure the saved file has a .h extension on the name, and that it is not named
nreal.h or nrui.h.

If you are still unable to figure it out, copy the finished macro from above into your
startup directory and save it as my_macro.h.