Biped AutoRig Version 1

It’s been a while! I’ve been very, very busy with school, but I haven’t been idle with rigging.

I finished a complete biped auto-rig for a video game project I’m helping out on. Here are its features:

1. IK and FK arms and legs complete with Follow switching.
2. Stretchy spline IK back with “advanced twisting” from the shoulders and hips
3. Foot controls including a reverse ik foot, foot bank controls, toe roll, foot roll, and toe pivot.
4. IK to FK blending using a simple Blend Color node
5. Colored controls
6. World Follow orient options for the head, neck, ik legs and arms, and fk shoulders
7. IK clavicles

All this took a lot of trial and error, so here’s a little bit of documentation on what I learned. I do this for myself as much as I do it for you the reader, haha.

Let’s start with the arms. We have a three joint setup: ik, fk, and bind. The bind joints inherit the rotation attributes of their corresponding ik and fk joint. That is blended with a simple BlendColor node, a great trick shown by my rigging teacher Eric at SJSU. The ik arm is a rotate plane solver, and it is important to give a slight bend in the direction your arm should bend so that the trigonometry of the solver works correctly. Otherwise, Maya will just guess what angle it should bend at, which you obviously don’t want.

On the ik arm and fk shoulder controls we have a “Follow World” attribute that blends between 0 and 1. The hierarchy of follow controls like these works as follows:

“””

ctrl_ORIENT

• Ctrl_FOLLOW
• CTRL
• Ctrl_FOLLOW_ORIENT_CONSTRAINT

ctrl_ORIENT_PARENT_CONSTRAINT

“””

So you have your control with its normal orient group above it. Group the control again to make your follow group. This gets orient constrained to multiple transform nodes, and simple attribute connection with one of them connected to a Reverse node will do the trick to switch between the two follow types.

Here is what the code for that might look like:

```self.L_followSwitch = cmds.addAttr(self.myArm.getIKctrl(),at=&quot;float&quot;,ln=&quot;Follow_Clavicle&quot;,k=1,dv=0,min=0,max=1)
self.L_followSwitchReverse = cmds.createNode(&quot;reverse&quot;,n=&quot;L_followSwitchArm#&quot;)
cmds.connectAttr(self.myArm.getIKctrl()[0] + &quot;.Follow_Clavicle&quot;,self.L_followSwitchReverse + &quot;.ix&quot;)
cmds.connectAttr(self.L_followSwitchReverse + &quot;.ox&quot;,self.myArm.getIKgrp() + &quot;_parentConstraint1.&quot; + self.myBack.getGlobalCtrl()[0] + &quot;W0&quot;)
cmds.connectAttr(self.myArm.getIKctrl()[0] + &quot;.Follow_Clavicle&quot;,self.myArm.getIKgrp() + &quot;_parentConstraint1.&quot; + self.myArm.getIKclavicle() + &quot;W1&quot;)
```

I also have an IK clavicle that drives the IK clavicle joint. The user has the option to make the ik arm control follow the clavicle, which essentially makes it work like an fk control. Someone might find that useful, who knows.

Obviously, making the controls all depends on you correctly aiming and xforming the orient node.

A few useful lines of code:

cmds.joint(“myJoint”,e=1,oj=”xzy”,roo=”zxy”,ch=1)

This orients the joint its children to “xzy” and sets their rotation axis orients to “zxy”. Clean joints are very important!

or cmds.joint(“myJoint”,e=1,oj=”none”)

This is a fast way to null the joint orient values on an end joint.

I’ll have to continue this post another day because it’s getting late and I’ve been staring at screens all day. Gotta take care of my eyes!