Sunday, 11 April 2010

Post Twelve

Summary

In this post I needed to do some research on the rigging process for the upper body and conducted a thorough search in Google, the most in-depth tutorials I found were four quite brilliant ones and from them I have managed to complete the rig for my character. I will list these tutorials before trying to explain what happened for the rest of the rig.

Tutorials:

http://34bit.blogspot.com/2008/01/tutorial-ik-setup.html

http://software.intel.com/en-us/articles/character-animation-skeletons-and-inverse-kinematics/

http://www.3dhaze.com/tutorials/char_model/rig.html

http://www.clevislauzon.qc.ca/arts/DOCXSI50/XSIPortal/de614853.htm

And now for the rest of the rig;

I wanted to place a gyro (control object) at the wrist to rotate the hand, move the wrist and move the arm too. To start with I created an IK chain from the upper arm bone to the palm bone, and then I aligned the position of the control object with the IK chain at the wrist of my character then linked the chain to the control object. Now my arm moves by using the control object at the wrist. But to make the hand rotate with the control object I will have to link the palm bone with the control object and this will break the IK chain already made, causing the control object not to move the arm.

To sort this problem out I will use an orientation constraint this will make the palm rotation match the rotation of the control object. This is a useful alternative to linking when linking is not at all possible. I just must remember to align the orientation of the control object’s pivot point with the palm bones pivot point.

To start with I selected the upper bone and selected animation > IK solvers > HI solver to create the IK chain and renamed it, and then I aligned the position of the control object to the newly created wrist IK chain. Now I aligned the orientation of the control object’s pivot point to match the pivot point of the palm bone, and then linked the IK wrist to the Control wrist object.

I selected the palm bone and chose animation > constrain > orientation constraint then clicked on the wrist control object and tested the procedure by rotating the control object, and the hand rotated too.

For the Fingers and thumbs I had decided to create some custom attributes for each of the fingers, a flex would have a number representation of -20, 0 would be the default hand position, 100 would make the fingers pose as if it were going to grasp an object and lastly 200 would make the fingers clench in a fist. With my fingers and thumb set up this way my hand should be able to do anything a real hand would.

To start this complex process I had to change the reference coordinate system to local, as all the fingers rotated on the y axis when set to local. I selected the wrist control object and added an attribute modifier then chose animation > Parameter Editor from the list, this opens a panel where I can edit my new custom attributes that I will use to move the fingers. I have made four custom attributes one for each finger, these will be called; CurlThumbL, CurlIndexFingerL, CurlMiddleFingerL and CurlPinkyL. Each has a range of -20 to 200, and after renaming each custom attribute I clicked the add button and closed the parameter editor when I was finished. These custom attributes show up now on the modifier panel when the wrist control object is selected.
The next step was to use the Reaction manager to set up the master and slaves and create states for the rotations of the fingers, to get to the reaction manager I chose animation > Reaction Manager. In the panel I clicked on the big black plus sign to add a master then I clicked on the wrist control object and chose modify object > attribute holder > custom attributes > CurlIndexFingerL from the pop-up box. The next step was to add the slaves; I selected the two bones that make up the index finger selected the’ add selected option’ from the reaction manager, then chose from the pop-up box transform > rotation > y rotation. This would add the y rotation track for both bones as slaves and creates the initial state with default values.
Now for the fun part; I select the wrist control object and pin the stack on the modifier panel so we can see the custom attributes that have been made all the time, I set the CurlIndexFingerL custom attribute to -20 and turned the create mode on, then I rotated the base finger back 10 degrees on the y axis and then clicked the create state button on the reaction manager. This creates a state for the y rotation for that finger.
The next state will be at 100 so I change the custom attribute integer to 100, rotate the base index finger back 30 degrees and then rotate the index finger tip to 70 degrees, this makes the finger move to a grasp pose. Now I click the ‘create state’ button on the reaction manager.
The last stage is when the finger will be in a clenched fist pose, so I set the custom attribute integer to 200, and rotate the base index finger to about 90 degrees so that the tip of the index finger is touching the palm of my characters hand and create the last state, and now turn off create mode and test. Just by changing the custom attributes integers moves the fingers pose from flex to default, and then grasp to fist. When all the custom attributes have been created (masters and slaves and creating states) animating the fingers should be really easy.

There was just a slight change in the way I did the thumb curl, as my own thumb is able to rotate in all directions, when setting up the slaves for the two bones that make up the thumb I added rotations on the x,y and z axis, thus making the thumb able to move in all directions.
The last part to rig were the shoulders, knees and elbows; I had copied the wrist gyro before hand as I had wanted one for the shoulders, once properly aligned positional to the upper arm bone in the hierarchy panel I click affect pivot only and align the pivot of the left clavicle both positional and its orientation. Then turning off the ‘affect pivot only’ option I link the clavicle to the control object.
To test I simply rotate the control object to move the shoulder, with this simple process the control object is the parent of the clavicle so it may be selected easier.

The elbows and knees are added to make these parts of the rig point in any direction should any twisting of the bones occur, I need to be able to make these move independent of the rest of the body. To accomplish this a small box was created in front of the elbow/knee and was renamed an appropriate control object name, the control object knee was linked to the control object foot to keep it near the character what ever he does. I then select the IK chain at the ankle, go to the motion panel, find the Pick target button in the IK Solver Properties rollout and select the knee control. This basically causes the joint between the calf and the thigh to point at the knee control all the time. The process was then repeated for the shoulder control objects.
The last thing to do is to create a box for him to stand on and name it body control object so moving the whole rig is made easy, this is done by linking the leg, and feet control objects to the body control object then testing the object by moving it; the whole hierarchy should move too.
This concludes the rigging process, which has been in-depth to say the least now I can get on with the skinning part.

No comments:

Post a Comment