Using parameters controls within macros, Assigning a color control – Apple Shake 4 User Manual

Page 379

Advertising
background image

Chapter 14

Customizing Shake

379

Using Parameters Controls Within Macros

These are commands typically assigned to help lay out your macros by setting slider
ranges, assigning buttons, and so on. These behaviors are typically assigned to specific
parameters. They can be applied either globally (all occurrences of those parameters)
or to a specific function. For example, if there is a trio of parameters named red, green,
blue, Shake automatically assigns a Color control to it. However, for a parameter such as
depth, you want to specify actions based on whether it is a bit depth-related function
(and therefore assign a button choice of 8-, 16-, or float-bit depth) or a Z-depth related
function (in which case you probably want some sort of slider). To assign a parameter
to a specific function, preface the parameter name with the function name, such as
MyFunction.depth.

All parameters, unless overridden by Shake’s factory-installed rules, are assigned a slider
with a range of 0 to 1.

Assigning a Color Control

In the ui directory:

nuiPushControlGroup(“Color”);

nuiGroupControl(“Func.red”);
nuiGroupControl(“Func.green”);
nuiGroupControl(“Func.blue”);

nuiPopControlGroup();
nuiPushControlWidget(

“Color”,
nuiConnectColorTriplet(

kRGBToggle,
kCurrentColor,
1

)

);

This assigns a button to three sliders so that you can scrub across an image and
retrieve color information. You can select the current color, the average color, the
minimum color, or the maximum color values. You can also assign a toggle switch to
select the input node’s color or the current node’s color. For example, for pulling keys,
you probably want to use the input node color since you are scrubbing (usually) blue
pixels, rather than the keyed pixels. You can also choose to return different color spaces
other than RGB. Assigning a Color control creates a subtree of those parameters.

Advertising