Tail rig

Moderator: BenChang

Tail rig

Postby BenChang » Mon Apr 16, 2012 5:57 am

(Also useful for long-necked creatures like dinosaurs, dragons, loch ness monsters, giraffes, etc.)

A tail needs to be able to bend in many directions, get good S and C curve shapes, and be easy to control. SplineIK provides the foundation for several methods of doing this.

Initial setup
First, set up the joint chain. Mine has 10 joints; use more or less depending on the length of your tail or neck and how smooth the curvature needs to be.

tailsetup1.jpg
tailsetup1.jpg (13.78 KiB) Viewed 547 times


Next, add a Spline IK. (Skeleton->IK Spline Handle Tool). Set the number of Spans to 3.

We'll look at two different methods for controlling the spline curve, but first let's set up auto-stretch, which will be useful for both methods.

1. select the curve that the Spline IK created. name it "tailCurve"
2. in the command line, enter this MEL command:
Code: Select all
arclen -ch 1;


'ch' is the 'Construction History' flag. Without it, the command just gives you the current arc length; with construction history on, you get a curveInfo node that will continuously update the arc length.

3. select tailCurve and open the Attribute Editor
4. go to the "curveInfo1" tab. Rename the node "tailCurveInfo".
5. note the current value of the "Arc Length" attribute. Mine was 10.0.
6. Create an expression to use the arc length to scale the tail joints
7. Open the Expression Editor (Window->Animation Editors->Expression Editor)
8. Enter this code in the Expression box, and name the expression "tailStretchExpression"
Code: Select all

$scale=tailCurveInfo.arcLength / 10;
joint1.scaleX=$scale;
joint2.scaleX=$scale;
joint3.scaleX=$scale;
joint4.scaleX=$scale;
joint5.scaleX=$scale;
joint6.scaleX=$scale;
joint7.scaleX=$scale;
joint8.scaleX=$scale;
joint9.scaleX=$scale;
joint10.scaleX=$scale;


replace the joint names with the names of the joints in your tail if you've changed them (tail1, tail2, etc...)
replace the '10' with the default arcLength value in your curveInfoNode.

9. Click "Create"

Method 1 : Clusters

Select the spline curve and go into component mode, showing the curve CV's. Since the curve is right on top of the skeleton, it may help to hide the joints first.

Select the first CV and create a cluster deformer for it (Create Deformers->Cluster)

Repeat for each CV in the curve. This will give you a set of cluster handles that you can use to shape the curve and control the joint chain.

tailsetup2.jpg
tailsetup2.jpg (15.58 KiB) Viewed 547 times


To make it easier to move the CV's, create NURBS circles or other objects to use as control handles.

You can make one control handle for each cluster. For a simpler setup, you can group multiple clusters under each handle. In this example, there are three handles. Each one has 2 clusters parented to it.

tailsetup3.jpg
tailsetup3.jpg (36.06 KiB) Viewed 547 times

With this setup you can control the tail using both positioning and rotation of the handles.

tailsetup4.jpg
tailsetup4.jpg (45.25 KiB) Viewed 547 times
User avatar
BenChang
 
Posts: 176
Joined: Mon Jan 17, 2011 4:48 pm

Return to Art and Animation

Who is online

Users browsing this forum: No registered users and 1 guest

cron