Apple Shake 4 User Manual

Page 925

Advertising
background image

Chapter 30

Installing and Creating Macros

925

The new lines list the normal button, followed by the focus button. The icons directory is
automatically scanned, but notice you have specified the ux subdirectory. The value
returned is always 0 for the first entry, 1 for the next entry, 2 for the third entry, and so on.
You can have as many entries as you want. Each button click moves you to the next choice.

4

Save the file and start Shake again.

5

Create the VidFormat node again.

The vidFormat parameter has a PAL/NTSC toggle.

The button created in the above steps is a single button that toggles through multiple
choices. This is fine for binary (on/off ) functions, but less elegant for multiple choice
toggles. In the next example, create radio buttons. Radio buttons are similar to toggle
buttons, except that you simultaneously see all available buttons. This code lists only
one button name. Shake automatically assumes there is an on, on.focus, off, and
off.focus version of each button in the directory you specify. If you copied the vr_
buttons earlier, you indeed have all of these buttons. The code looks like the following
in “

Using Parameters Controls Within Macros

” on page 379.

6

Again, edit the VidResizeUI.h file:

nuiPushMenu(“Tools”);

nuiPushToolBox(“Transform”);

nuiToolBoxItem(“@VidResize”,VidResize());

nuiPopToolBox();

nuiPopMenu();

nuxDefExprToggle(“VidResize.keepAspect”);

nuiPushControlGroup(“VidResize.Background Color”);

nuiGroupControl(“VidResize.bgRed”);
nuiGroupControl(“VidResize.bgGreen”);
nuiGroupControl(“VidResize.bgBlue”);

nuiPopControlGroup();
nuiPushControlWidget(“VidResize.Background Color”,

nuiConnectColorTriplet(kRGBToggle,kCurrentColor,1)

);

nuxDefRadioBtnControl(

“VidResize.vidFormat”, 1, 1, 0,
“0|ux/vr_ntsc”,
“1|ux/vr_pal”

);

Advertising