beautypg.com

How to set slider ranges – Apple Shake 4 Tutorials User Manual

Page 237

background image

Chapter 8

Working With Macros

237

If there is nothing at all, you have made an error in your ui file. Check the error
messages for an indication.

If the icon is there, but nothing happens when you click the button, check the
spelling, capitalization, and number of arguments of the call to the RotateBlur
function. Make sure there are no extra commas.

Make sure you saved your ui file in the ui directory, and that it ends with a .h
extension.

How to Set Slider Ranges

This section discusses how to test the sliders created in your macro.

To test the sliders:

1

Add the new RotateBlur node.

2

Move the angle and blur sliders.

Notice that the angle slider values range from –360 to 360, but that the blur slider
ranges from 0 to 1, forcing you to use the virtual sliders (Control-drag in the value field)
to go beyond 1. Set your own slider range with a bit of code already included in the
example from above. On the last line of your ui file—and only the last line—delete the
double forward slashes: //. When “commented out” by double slashes, a line of code is
not read by Shake upon startup of the application. By removing the comment
characters, you reactivate the line.

To uncomment the slider definition:

1

Remove the // from the last line in your ui/rotateblur_ui.h file.

The code should now look like this:

nuiPushToolBox("Filter");
nuiToolBoxItem("RotateBlur", RotateBlur(0,0,0));
nuiPopToolBox();
//These set the slider ranges for the blur parameter
nuiDefSlider("RotateBlur.blur", 0, 400 );