This is part 2 of a demonstration of the zooTriggered tool. In part 1 I showed how to use zooTriggered to make any object trigger an action when you click the object in the viewport (ie when you select it). However that was only half the story. Look at the first couple of lines from the zooTriggered Help menu again.
zooTriggered has two major functions. Firstly, it allows you to create "trigger" objects in your scene, and secondly, it lets you add custom menus to an object's right click menu.
I am now going to demonstrate the second part. I'm still using the example of a hand skeleton that has a nurbs sphere as a control object. I will use zooTriggered to create a right-mouse-button menu that appears when you right-click over the control object. The menu will contain a list of preset poses for the fingers.
This time I use the View menu and select edit zooObjMenu commands as shown below
I select my control object, hand_R_controller then right-click in the upper-left pane of the UI and choose add select scene objects to list. (see below)
Then I select all the bones in the right hand, right-click in the upper-right pane of the UI and choose add selected to connects. (see below)
In the next picture you can see the current state of the UI. The <empty cmd> indicates that it is waiting for me to add a zooObjMenu command string.
I right-click in the lower-left pane of the UI and choose connects setAttr preset. (see below)
This preset generates the zooObjMenu command string (which is a special syntax based on mel code). In this case the command contains the data required to return my hand bones to their current pose.
I then rename the menu label to "neutral" which describes the pose. (This name is the name that will appear in the control objects right-mouse-button menu).
Now if I right-click while my cursor is over the hand_R_controller sphere, you can see from the following picture that the usual RMB menu now contains an extra item called "neutral".
This one extra menu item can be very useful just like that. While animating I sometimes like to zero out my joints and start from a neutral pose as a way to keep those rotations tidy.
zooTriggered makes it very easy to build a list of preset poses which can be especially handy (ehm!). In the next picture I right-click in the lower-right pane of the UI and choose new cmd...
I then pose the fingers of my character's hand before doing the connects setAttr preset.
The data from the new pose is turned into another zooObjMenu command string and I name the menu label "pointingIndex"
The next picture shows the context sensitive viewport RMB menu with the new item added.
One thing I should mention is that these right-mouse-button object menus do not need the trigger to be "loaded". Once created the menus are associated with the object and saved in the maya scene file. zooObjMenu commands (and therefore the obj menu items) can be removed by right-clicking in the lower-right pane of the UI and choosing delete cmd.
IMPORTANT NOTE: The ability for zooTriggered to add items to the RMB menu depends on a mel script called dagMenuProc.mel which is part of the standard maya installation, but which is overridden by a modified version when you install the zooToolbox. Please read here for more details.
But there's still more...
An interesting extra feature that you may consider using is the ability to turn poses into sliders that can then be animated. (see below)
When you do this, for each zooObjMenu command string an "extra attribute" is created on the zooObjMenu object (in this case hand_R_controller). The extra attribute is named the same way as the menu label.
In the image above (a snapshot of the channel box) you can see two extra attributes, called "Pointing Index" and "Fist". (NOTE: Only poses that cause some non-zero transformation of the joints are included, so in this case the "neutral" pose is ignored, since it would be redundant).
The value of each "slider" ranges between 0 (no effect) and 10 (full effect). You can think of them a bit like blendshapes but for joints (or other transforms). The thing you will notice is that the effect of each slider is additive, so if, for example, I was to animate between a fist pose and a pointing pose I would need to make sure that the combined effect of the halfway values still looks ok.
I'll finish here with the same reminder as in part 1 - I have only touched on some of the basic features of this very powerful tool. There is plenty more to discover.