Action Constraints tutorial made easy

This tutorial has been updated.

After so many years I will soon loose all data hotlinked to my Rutgers University account, meaning this tutorial will soon be gutted.

The new tutorial is at:
http://home.comcast.net/~michaelthomasgreer/blender/ActionConstraintsMadeEasy/

Please give me feedback!

The original tutorial starts here:

Action Constraints are a powerful animation feature in Blender. However, I’ve not come across anything that directly addresses the issue of making and using action constraints. Nozzy’s famous rig makes use of them, but it is a fairly advanced setup for the newbie. This tutorial aims to strip out everything but the topic at hand…

Objective

We will tackle animating a spine. Those of you who have tried to do this with IK notice it is very difficult to control that way, and introduces “jumpy” behavior whenever the spine is nearly straight.

Instead, we’ll construct our spine without IK solvers and manipulate it with action constraints. This will give exacting control on exactly how the spine bends.

Assemble your mesh, armature, and views

Here is one of those handsome fellas from MakeHuman 1.8, with an elementary rig. I purposefully left the arms off in order to unclutter this tutorial.

http://clam.rutgers.edu/%7Emgreer/blender/1.jpghttp://clam.rutgers.edu/%7Emgreer/blender/1-side.jpg
I’ve highlighted here the bones we’re interested in. The Sway Spine bone is the one we will use to control the curvature of the spine when we’re done. For now, however, we’ll ignore it.

Once you’re done setting up your armature, assigning weights, etc., switch over to Pose Mode (Ctrl-Tab).

Action Editor

Open up the Action Editor and add a new action block:
http://clam.rutgers.edu/%7Emgreer/blender/action_add_new.jpg

One thing to note is that whenever you add a new action it automatically makes a duplicate of the current action. For this, and one other reason we will make note of shortly, let’s add another new action.

The action name should now read “Action.001”
http://clam.rutgers.edu/%7Emgreer/blender/action_001.jpg

Change it to “Sway Spine”
http://clam.rutgers.edu/%7Emgreer/blender/action_sway_spine.jpg
It is not required to have a name matching any bone (or anything else in Blender) --you could have named it “fooey kablooey”. My preference is simply to name the actions --and the bones that control them-- as descriptively as possible. For me that means that they’ll have the same name.

Adding the first key

Adding an action is just like normal key animation. Since our ‘swaying’ action is to sway between the left and the right, our central, ‘neutral’ pose should be somewhere in the middle.

Pressed the Up-Arrow key to move to frame 11. There’s nothing special about frame 11, it’s just where I’m putting my center key. Select the bones of the spine and press ‘I’ --> Insert Loc/Rot.
http://clam.rutgers.edu/%7Emgreer/blender/2.jpg

The Action Editor will display the new keys:
http://clam.rutgers.edu/%7Emgreer/blender/action_1st_key.jpg

Additional Keys

Let’s bend the spine right, shall we?
Set the frame to 1 and play with the spine until it’s somewhere you like it.

http://clam.rutgers.edu/%7Emgreer/blender/3.jpg

You’ll notice that I’ve kept his head up. All this action is designed to do is curve the spine. Not bend over at the hips. We can use the Spine A bone for that later.

Press ‘I’ and insert another Loc/Rot.
http://clam.rutgers.edu/%7Emgreer/blender/action_2nd_key.jpg

Next I changed to frame 21 (the last frame in the action), adjusted the spine bones appropriately, and inserted the final key.
http://clam.rutgers.edu/%7Emgreer/blender/4.jpg

http://clam.rutgers.edu/%7Emgreer/blender/action_3rd_key.jpg

You can, of course, use all the normal action editing techniques here to test your frames. Go to frame 1, press Alt-A, and watch him sway from his right to his left. Add, delete, and rearrange keys until you are satisfied with the motion.

The center key

Since this action is centered at frame 11, set the frame number to 11. Now select the “Action” action from the combobox. You can now change the frame number back to 1.

http://clam.rutgers.edu/%7Emgreer/blender/action_empty.jpg

The location of the frame index is important for an action. In most cases, you can leave it at 1. But for an action like this we want it in the middle of the action.

This is the other reason for having an empty Action block from which to build new actions. It just makes life a little easier to not have to worry about those things.

Applying the Action Constraint

Now to make our boy dance.

Select the bone labeled “Spine A” and press F7 to display the Object Buttons. Under the Constraints tab, add an action constraint.

http://clam.rutgers.edu/%7Emgreer/blender/add_action_constraint.jpg

Target
For “Target” type in the name of your armature.
A new box will display. Type in the name of the bone which will control the spine: “Sway Spine”.

Action
In the box that says “AC:” type in the name of the action “Sway Spine”.

Don’t be concerned that the armature deforms in the 3D View. We’ll fix that.

Rotation Axis
The degree we rotate our bone around the Z-axis is what controls the action. You can make it any axis you want, or change it later if needed or desired.

Start and End
Our action begins at frame 1 and ends at frame 21.

Min and Max
I like the greatest range of motion possible, so it’s 90.00 to -90.00 degrees.

http://clam.rutgers.edu/%7Emgreer/blender/constraint_data2.jpg

At this point you can grab the Sway Spine bone and rotate it to see what happens. I had initially set my min and max to -90 to 90, which made him sway left when I rotated the bone right. So I swapped them to make it do what I want.

The only thing remaining is to repeat the process of applying the action constraint to Spine B and Spine C. Notice how we never did anything to the Sway Spine bone?

In Blender, constraints are applied to the controlled bone, and target the controller bone.

The Null Constraint
One important thing that should be mentioned here concerns the use of a Null Constraint. In our example each bone of the spine (A, B, and C) has only one Action Constraint applied to it.

However, it is often convenient to apply multiple action constraints to the same bone. The next logical step for our spine would be to create another action called “Bend Spine” which makes the spine curve forward and backward (slouch and stretch, as it were). We would then need two bones to manipulate the spine: “BO:Sway Spine” and “BO:Bend Spine”, and two corresponding actions that do each one: “AC:Sway Spine” and “AC:Bend Spine”.

Each bone in the spine would then have two Action Constraints applied to it: one targeting the “Bend Spine” bone and action, and one targeting the “Sway Spine” bone and action.

In Blender, if two or more constraints of the same type are applied in sequence, the result is an average of the constraints. This is useful for doing something like constraining an object to track the point between two or more other objects. In the case of Action Constraints, however, the average result is usually undesireable.

To solve the problem, place a Null Constraint between each Action Constraint to prevent them from being averaged together. The result should look something like this:
http://clam.rutgers.edu/%7Emgreer/blender/constraint_data3.jpg
To move a constraint up or down in the list, collapse it (click the little triangle), and click the name to get a pop-up dialogue to move it up or down.

Using the Action

The only thing left to do is play with the new action constraints.

Since we’ll never need to mess with Spine B and Spine C, Tab into edit mode and hide them. Now Ctrl-Tab back to Pose mode. The action editor should read “AC:Action”. Good.

Animate as usual. You can rotate the Sway Spine bone left and right to control the entire spine, and rotate the Spine A bone to make him bend at the hips.

Here’s my animation doing just that. (DivX 328KB)

I hope this helps. If I’ve left anything out, or have been unclear, let me know.
:smiley:

Added information about Null Constraints (18 Sep 2005)

Nice…
Very detailled tutorial here.
psss, Animation workshop? :wink:
I also did a small tut on action constraint here

Hey, there’s never enough nice tutorials! You should somehow link it with Animation Workshop, to keep this kind of valuable information in one place.

Anyway, lot of thanks for this!

yea, keep this near, such tut is worth incorporating in the 2.4 manual.

Wow! Thanks! :smiley:

yes, very informative. Thanks.

As more people like myself become aware of the animation re-code tutorials like this will become worth their weight in gold pixels.

I find alot of tutorials try to do too much, rather than focus on 1 or 2 main tasks. This one was nice and comfortable, without straying.
Thats important.

For those listening, we need more on constraints.
Wait for the new IK code first though.

I might have a go at some simple tuts myself, but i’m not a blender native.
Migrating in from A:M which has a great constraints system, when you are not re-starting the damn thing :<

Blender is looking more like a new 1 stop shop for animators.

Duoas, great tut! I don’t think I even knew about action constraints really, except for the blurb Gabio put up in the workshop… I can’t wait to get home and give this a try!

You know, I never realised that this is how nozzy was using a bone to close and open the hand of his skinny_guy rig… Of course it all makes sense now!

Thanks!

I know this is old, but I don’t want to go without interjecting my own little thank you. Thanks for the helpful tutorial! :smiley:

wow!!! I would like to say thanks a lot, cause ive been so confused for so long but now it all makes sens. I had no clue how an action constraint worked, all i had been able to figure out was the copy location… now that i know how to do that, il be able to do a lot more. Realy great work.

Yes this is old but I wish someone would explain the ADD NEW Feature on both the actions,IPO,Material and other windows better. After 7 years that still confuses me.

AFAIK, it just makes a new unique copy of whatever you’re adding, or a new blank item if you first press the “X” to disconnect the current item. Is there something more to it that I’m missing? Mike

This is very helpful indeed…thnx a lot…

That is great, cheers!

thank you very much

very detailed and very usefull

this is exacly what i wodnered about and needed. i appreciate your work:)

Thank you everyone for your kind comments and questions. Please see the first post for a link to the updated tutorial (WIP).

–Michael

Thanks for the tutorial :slight_smile: