This is a tutorial, demonstrating the different features of the acs script. You will create a new ACS node and use it to connect several attributes using both simple and more complex methods. In slight contrast to its title, the tutorial has become bigger than originally intended. Yet, it doesn't dig into the theories of the acs, nor does it cover all the features of the script. This is done in the manual.
At a first glance, the system is more complex than might seem appropriate for the purpose it serves. In the end, it just connects attributes. But I found that this complexity is what makes the system flexible enough to handle a great variety of problematic situations in a convenient way.
Simply stating one instruction after the other would be of little use for most readers. So I figured, writing down three different kinds of steps would be more helpful: Apart from the usual instructions, there are steps starting with "- Info -". These contain additional information for the previous or next step. "- Optional -" means that the step is optional and either doesn't contain any vital information or is meant for more advanced users.
To minimize confusion, I have sometimes included mel statements, which can be
executed as an alternative to the written instruction. These statements are
written in parentheses "()" starting with "mel:".
E.g.: (mel: select -r "wrist";
) means that you could execute:
select -r "wrist";
To follow the steps of this tutorial, you need some example scenes. They can be downloaded here: acsScenes.zip
Whenever I refer to a "scene" that you should open, it is one of the ".ma" files in the above download.
Now, let's start by opening the scene with the final setup: acsTutFin.ma
In case you missed it, the scene is part of this package: acsScenes.zip
- Info -
You will see a hand type of... "thing" and a white curve in the shape of a
hand with five fingers. The white hand curve is the control object. The
finger curves are separate objects. These six control objects have some
custom attributes set up.
Select the hand control, set the "natural" attribute to 10 and play around with the finger curl attributes.
Try the "spread" attribute to see its effect on the relaxed hand.
Make a fist and, again, try the "spread" attribute. You should see that the behavior is, sort of, context sensitive.
- Info -
This is one of my first hand setups, so please bare with me if it doesn't
seem very usable to you. Its only purpose is to explain the script.
This part will lead you through the basic steps of creating a new acs setup. Please note that, at the end of this part, the setup is not very advanced and could also have been created using SDKs. This will change in Part III.
We'll now build this setup step by step. Open the scene acsTut1.ma.
Open the acs UI by executing the mel script
DPK_attrCombinationSystemUI;
.
Select "Initialize->Create New ACS Node..." and click "OK". You've now created a new ACS node, the heart of the whole system.
- Info -
You will now define which attributes should be the controlling attributes.
I call this
importing inputs.
Select all objects in the "animationControls" object set
(mel: select -r "animationControls";
).
Put the mouse over the white space below the "Input" heading and do a "Right Click->Import...".
In the new window, select the attributes and click "Import". You have now defined the attributes which control the system. They are listed in the "Input" list.
- Optional -
You may check out the
scripting interface
to rename the inputs to much shorter names. Of course, you could rename
them manually ("Right Click->Rename..."), but the scripting interface is
much faster.
- Info -
You will now import the attributes which should be controlled by the inputs.
Select the wrist joint (mel: select -r "wrist";
) and execute the
following command:
select -r `listRelatives -path -allDescendents -type "joint"`;
You have now selected all child joints in the hierarchy of the wrist joint.
To import the attrs, put the mouse over the "Output" list and do a "Right Click->Import...".
Select all attributes in the new window and click "Import".
- Info -
These
output attributes
are instantly being controlled by the ACS node. This means they can not be
changed interactively anymore. One important thing to note is that there
is now an entry "Neutral" in the "Data Point" list. This is the neutral
data point which defines the values, the outputs have when all inputs are
neutral (usually when they're 0). For more information on how data points
work and what they do, see
Data Points Part 1
and
Data Points Part 2
in the manual.
- Info -
To understand the next steps, you should really have an idea of what data
points are and how they build the actual connections, so I recommend taking
a moment and studying the above mentioned parts of the manual before you
continue.
You will now create the first data points which create a simple one to one connection from the finger controls to the finger joints. To do this, select "thumb_upUpDown" in the input list and "thumb_1_rx" in the output list (by clicking on the attribute name).
Click on "Initialize->Quick Connection".
Select the thumb control in the scene and change the "upUpDown" attribute to see that it is now connected to the thumb joint.
- Info -
Notice that in the input list, there is now a plus sign ("+") in front of
the "thumb_upUpDown" entry. This means that there is a position for this
input (see
Input Positions
in the manual for more information). You can display it by double clicking
on the input.
- Info -
There is also a new entry in the data point list. This is not the data
point but its group (groups have a plus "+" in front of them). Double click
this group to expand it. There will be an entry "R: thumb_upUpDown(1)".
This is the data point. "Quick Connection" did three things:
It created a new input position for the selected input.
It created a new data point using this position.
It edited the data point so that the selected output got a value of 1.
The third step did the actual connection between the input and the output.
For a more visual way of creating connections, we'll now use a different method for the next data point. Select "thumb_upOpenClose" in the input list. Place the mouse over this input list and do a "Right Click->Create Data Point". The new data point will be selected automatically.
Double click this data point.
- Info -
A very important thing has just happened. You have entered the Edit
Mode (indicated by the text directly above the output list). In edit
mode, the output attributes are unlocked and show the current values of
the selected data point. Furthermore, the controlled attributes aren't
locked anymore, so that they can be changed interactively in the viewport
using Maya's manipulators.
Select the "thumb_1" joint (mel: select -r "thumb_1";
) and rotate
it -1 degree in the z-axis (mel: rotate -a 0 0 -1;
).
- Info -
Notice that the value of the "thumb_1_rz" entry in the output list is now
-1, too. You could also edit the values in the output list.
To leave edit mode so that the changes take effect, select any item in the data point list.
Once again, select the thumb control and make sure the "upOpenClose" attribute works as expected.
- Optional -
You could take the time and set up all the finger attributes, but for the
purpose of this tutorial, this is not advised.
If you didn't do the above optional step, just open acsTut2.ma.
Let's prepare for some data points for the more complex attributes. Select the seven "handCtrl_*" attributes, enter "10" in the field below the input list and click the "Create" button. The seven new positions are now selected in the input list.
With the seven new positions selected, click on the "Selected" option above the input list.
Click on the "Included" option above the data point list.
- Info -
These last two steps are very useful to keep the screen organized and avoid
redundant information. In "Selected" mode the input list shows just the
inputs that are selected in "All" mode. When in "Included" mode, the data
point list doesn't show any data points which use any input that is not
selected in the "All" mode of the input list. The inputs and data points
that are not visible are still there, they're just not shown.
Select the first input (or its position at 10) and create a data point.
- Info -
If you select an input when you want to create a new data point, the
highest position of the main group (groups are explained in
the manual under
Input Position Groups)
is used for the data point. When there's no position for the selected
input, a new one is created.
Create data points for the other inputs (skipping the "handCtrl_natural" input), but DO NOT select more than one input at a time. Otherwise, you would create a combination data point, which will be covered shortly.
Select the first six positions and make sure no inputs are selected.
Enter "-10" in the field below the input list and click on "Create". This will create positions at the value of -10 for the inputs.
- Info -
If you accidentally selected an input, there will be an entry "- Grp 1"
with the new position below it. In this case, delete the position (using
"Right Click->Delete"), select just the position at 10 and try again.
Create a data point for each "-10" position and, again, make sure you don't create combination data points by accidentally selecting more than one position at a time.
- Info -
Data points that share the exact same input combination belong to the same
data point group. Therefore, the two data points of each input will be in
one group.
- Optional -
We don't need to see all the positions of the inputs. To collapse all
inputs do a "CTRL+right-click->Collapse All" in the input list.
Double click on the second data point of the "handCtrl_spread" group to enter its edit mode (the data point at position 10).
Rotate the hand joints until the fingers are all spread apart in a natural way.
Double click the data point at position -10 of the same group and rotate the joints so that the fingers are close together and leave edit mode.
Select the handCtrl and try the "spread" attribute.
- Optional -
You could edit the other data points now, but I'd say you just open the
next scene, instead.
Until now, everything could have been done by using a simple SDK setup. These next steps will make the difference. ;)
Open acsTut3.ma.
- Info -
Try to curl your middle finger completely without moving your ring finger
and pointer even the slightest bit. Most people can't do this. We'll now
try to simulate the effect of the fingers moving together. Since we want to
be able to turn this natural movement off, we use the "natural" attribute
to blend between the pure and the more realistic behavior.
Select the position at 10 of the pointerCurl input and the position at 10 of the natural input.
Create the first combination data point by doing a "Right Click->Create Data Point".
Enter the edit mode for it and rotate the middle and ring finders a bit to bring them into a more relaxed, natural position.
Leave edit mode and select the handCtrl. Set all attributes to 0 and try the pointerCurl attribute. Now, set the natural attribute to 10 and, again, try the pointerCurl attribute. You should see that it now behaves differently.
- Optional -
You could now create combination data points which combine the natural
input with the other finger curl attributes.
Open acsTut4.ma to get a scene with the simple combinations of the natural input.
- Info -
When you set the pointerCurl and middleCurl attributes to 10 (with the
natural at 10, of course), you will see that the two combinations overlay
and create a movement that we don't want. The fingers are rotated too much
because they influence each other. To prevent this, we have to create
another combination data point which combines these two curl attributes
with the natural attribute.
Select the handCtrl and try out the different attributes in combination with each other. Work from small combinations (with only two attributes) to the bigger ones and create data points as necessary.
- Optional -
You might find it useful to use some of the more advanced features of the
acs UI to do the setup. In the
manual,
all these features are explained in detail, so that you should quickly
become more familiar with the whole process.
Try out different ideas and experiment with the system to get the behavior you want.
At first, you will sometimes find situations where you don't understand what the acs is doing. With a little experience, you will learn the reactions of this system and get to the point where you know exactly what you have to do to get the setup you have in mind.
I think that most of the concepts and rules of combination-sculpting apply to the acs as well, since, in essence, you do the same things with attributes that you do with blend shapes when you do combination-sculpting. These concepts are not simply covered in a quick start tutorial.
Copyright © 2008, Daniel Pook-Kolb