Typical errors when creating macros, Setting default values for macros – Apple Shake 4 User Manual
Page 918
918
Chapter 30
Installing and Creating Macros
Typical Errors When Creating Macros
The following table contains a list of typical errors in macro creation. When diagnosing
a macro, first run the macro in the command line: shake -help myFunction. If nothing
appears, there is a problem with your startup .h file. If it works fine, move on to the
interface, and read any error messages in the Console tab. The Console tab is your
number-one diagnostic tool.
Setting Default Values for Macros
There are two places to set default values for your macros. The first is in the startup .h
file when you declare the parameters. The following is from the example above:
image SoftGlow(
image In=0,
float blur=0,
float lowClip=.3,
float hiClip=.9,
float percent=100
)
...
Error Behavior
Probable Cause
In the command line, the
function doesn’t appear when
you type the following:
shake -help myFunctionName
•
The file is not saved in a startup directory. See above.
•
The file does not have a .h file extension, or it has an improper
extension.
•
The name of the macro (the second word in the file) is not the
same as what you have called in the help command.
Function does not appear in the
interface.
•
The ui file is not saved in a ui directory. See above.
•
The ui file does not have a .h file extension, or it has a .txt
extension.
•
The name of the macro (the second word in the file) is not the
same as what you have called in the ui file, possibly because of
capitalization errors.
In the interface, the button
appears without an icon.
You have not removed the @ sign in your ui.h file. Otherwise,
follow Tutorial 8, “Working With Macros,” in the Shake 4 Tutorials.
The icon appears as a dimple.
The icon cannot be found.
•
Make sure the icon is saved in an icons directory. See above.
•
The icon should be named TabName.FunctionName.nri.
•
The ui code should say:
nuiToolBoxItem(“FunctionName”,Function());
NOT
nuiToolBoxItem(“TabName.FunctionName.nri”,Function());
•
Check capitalization.
The icon is fine, but nothing
happens when you click it.
•
Check capitalization errors.
•
Check that the correct function is called in the ui file and that the
function exists. (For example, type shake -help functionname in
the command line.)
•
Check that default arguments have been specified.