After Effecs Tutorials: Series 2 - Character Rigging with Puppet Pins

Part 3: Rigging the Upper Body

Part 3 is in two installments. In the first installment we will rig her arms and hand positions with Duik’s help. The second installments adds a slider controller so Angie can place her arms behind her back. We’ll also write expressions to enable a cloth response to her shirt when she bends her arms.

What you should know before beginning this tutorial

You should have completed Parts 1 & 2 if you plan to follow along with these installments.

2.3a Rigging Angie’s arms and hand controls

The arms are a basic Duik rig with the added feature of switch layers for the hands. The rigging of the arms is very much like the previous rigging of the legs.

2.3b Shirt position and cloth response

We’ll be working with transparency of the shirt layers to allow Angie to place her arms behind her back. Unlike Stickman’s rig, we’ll be using a slider controller instead of checkboxes to achieve this. Then we’ll create special masks to enable a cloth response in Angie’s shirt as she moves her arms upward.

More about the cloth response expression in tutorial 2.3b

I used the linear expression in tutorial 2.3b to create the cloth response of Angie’s shirt when she moves her arms. The resulting expression for the left arm shirt cloth was:

R=thisComp.layer(“B_L Upper Arm”).transform.rotation;

if(R>=180.8 && R<=258.3){

X=linear(R,180.8,258.3,-50,0);

Y=linear(R,180.8,258.3,-25,0);

P=[X,Y];

}else{

P=[0,0];

}

P

As I’ve mention before, I don’t try to compress my expression code to it’s simplest form. Instead, I try to lay it out so it it is very clear what’s going on in each line. It’s easier, at least for me, to find coding errors when they pop up – and they will pop up. However, I want to mention that the above code could be written with fewer lines. The last two variables (P1, P2) in linear(V, Vmin, Vmax1, P1, P2) don’t need to be written separately. These variables, as with all JavaScript variables, can hold arrays as well.

So, instead of separating the (X, Y) values for the puppet pin that controls the cloth location, we can enter them in as arrays, or (X, Y) coordinate pairs.

This:

X=linear(R,180.8,258.3,-50,0);

Y=linear(R,180.8,258.3,-25,0);

P=[X,Y];

Can be compressed into this:

P=linear(R,180.8,258.3,[-50,-25],[0,0]);

[0, 0] is the starting position of the cloth puppet pin when the bone rotation is at 258.3; and [-50,-25] is the X, Y position of the puppet pin when the bone rotation is at 180.8.

So the script could be written like so:

R=thisComp.layer(“B_L Upper Arm”).transform.rotation;

if(R>=180.8 && R<=258.3){

P=linear(R,180.8,258.3,[-50,-25],[0,0]);

}else{

P=[0,0];

}

P

*Don Q Media  and Jared Mark Graham have no affiliation with Adobe Systems Inc.