Monday, April 26, 2010

How to Rig a Chain in Maya - Rigging Tutorial

This tutorial explains how to rig a closed loop chain like that found on a motorcycle or a bicycle but this can also apply to other things like tank treads. This process includes creating a curve and deforming it to the shape of the chain. Joints are then attached to this curve and skinned to the individual links of the chain. Rotating the curve results in rotation of the chain. So lets begin...

This is the chain geometry I'll be using in this tutorial.



Step 1) Create a nurbsCircle with a high number of spans. The reasons for using high number of spans is so that the nurbs circle can hold its shape while rotating after it has been deformed. Using less number of spans may not result in a smooth deformation. I am using 32 spans here.



Step 2) Select the circle and create a lattice with enough lattice points. Now shape the circle using the lattice to match the shape of the chain. The aim here is to make sure the circle runs through the middle of the chain geometry. The closer you can get the curve to run through the middle of the geometry the better result it would give while rotating.


Step 3) Now create a single joint. Select the joint and then Shift select the circle and attach it through a motion path. In the motion path options set the world up type to object rotation up. Also set the world up vector to the axis that points outwards from your chain. In my case this was the X axis. Setting up the motion path in this way would prevent from joints from flipping over once they have rotated 180°.



The step above creates a node on the input of joint (and the output of the circle) called motionPath1. This node has a channel called U Value. This channel is currently connected the time line, but we need to break this connection. Now if you enter a value in this channel you will notice that the position of the joint on the curve would change. So input a value manually so as to align the joint in the middle of a link geometry. Remember that this channel is 0-1, which means that 1 is the maximum value that can be entered and to place the joints you have to use values between 0 and 1.


Step 4) Do this for all the links in the chain and skin the joints to the respective link geometry.

Now if you rotate the circle, you will notice that it holds its shape due to the lattice and rotates the joints attached on it which in turn moves the geometry.

3 comments:

aNIL kUMAR said...

Nice technique... It helped me a lot... Thnx... Anil Kumar (INDIA) aniljay10@gmail.com

3d Studio UK said...

thank you !

Dotun Ogunsakin said...

Thanks very much for this.