Tuesday, 10 May 2011

Weight Painting

Weight painting is used after you have bound the skin to the skeleton. With this tool you can affect the way that influence that each joint has over the skin and the way it moves. You can use it to make the movement of the skin look more realistic.

After selecting the mesh double click on the paintbrush icon shown in the picture above to open the weight painting menu shown on the left. 

Here you can select each joint in the list and it will show you how much influence each joint has. The more bright white an area the greater that joint has influence over the mesh. 

You can add paint by selecting add as shown above simply paint onto the mesh. You can smooth the paint so that it has less of a harsh start and finish and is more blended by selecting smooth or simply holding down the shift key as you paint. You can also change the strength of the brush in this menu.

In order to see how the painting is effecting the rig you can move it up and down, but an easier way to see without having to switch to the move tool is to set up a couple of key frames to make the leg bend so that while in weight painting mode you can simply move the slider  at the bottom of the window and the leg will move up and down.

Sunday, 8 May 2011

Rigging Tutorials

Here are some tutorials I found useful in understanding the process of rigging.


Reverse Foot Lock
http://www.rigging101.com/free/reversefootlock/index.htm
http://vimeo.com/11624192

Understanding Rigging
http://www.digitaltutors.com/11/training.php?cid=96&vid=5924

Problems I Had Whilst Rigging

A lot of the problems I had whilst rigging were mostly due to me making careless mistakes I made. I think the key to creating a good and problem free rig is to take things slowly and work in a very methodical way.

The importance of naming conventions is a really vital thing to remember, this can often cause problems in maya. Whilst rigging I had a problem with creating the joint for the centre of gravity and I realised it was because I had forgotten to name things properly. This is also important when exporting to put into a game engine, if things are named incorrectly or joints share names then there will be problems.

Another thing I had problems with was connecting IK handles and NURBS circles for the controllers. I had a lot of problems to begin with and my leg wouldn't move once I had connected the hip and ankle with an IK handle and used a NURBS circle to control it. I realised it was because I wasn't selecting the actual handle and was selecting the joint by accident. It's very easy to get confused when trying to select the IK handle, it's very fiddly and small.

Another problem I had was with pole vectors. I created my pole vector correctly, but because I didn't fully understand what it was for or that you had to move it to control the knee as well as moving the leg from the foot, the leg looked like it was twisting in on itself. Once I understood pole vectors and the knee controller I realised that actually there wasn't a problem at all I just wasn't moving the knee controller properly.

Taking your time to make sure you're doing everything correctly may seem like it's taking a lot longer but actually it saves time in the long run because it saves you from having to correct errors. Most problems I encountered could have been solved by taking my time and being more careful.

Reverse Foot Lock


The reverse foot lock is a set up of joints which drive the movement of the foot. It makes it easier to move and position the foot rather than having to position each joint. It's called reverse because of the way that you order the joints, in the opposite way to when you make the normal foot joints.

To prepare for the reverse foot lock you need to make IK handles for each joint in the foot. Double click the IK handle tool and choose IKSC solver  in the drop down menu. Then make handles from the ankle joint to the ball and from the ball to the toe joint.

Now using the joint tool make joints as shown above. Start with the joint under the ankle in line with the ball joint. Create the joint here then at the toe and then backwards to the ball and finally the ankle.

Now attach the ankle,ball and toe of the reverse foot lock to each IK handle by first selecting the handle and whilst holding shift select the joint. (this is easier if you hide the layer with the actual foot joints on so that you don't select the wrong one.) 
Once both are selected chose parent from the constrain menu to parent the handle to the joint. 
Parent the handles starting with the ankle, then ball, then toe, once this is done you should be able to control the foot using the joint at the back under the ankle.


The foot should now move as shown.

Creating a Controller .

To be able to easily select and move the leg using the reverse foot lock joint we can create a controller which is larger making it easier to select.
Create a NURBS shape and move it to under the foot as shown in the diagram. If you hold the V key and drag the shape it should snap to the joint. When it's in the right place freeze transformations so that you can easily get the joint back to the zero positions. First select the shape and holding shift select the reverse foot lock by the back joint. 
Select the constrain menu and then point. By constraining the NURBS circle to the joint it can now be easily selected and moving the circle moves the leg.

Pole Vectors

To create a pole vector first create a NURBS circle just in front of the knee joint. Now freeze transformations and select the IK handle from hip to knee and holding shift select the NURBS circle. 
Select Pole Vector in the constrain menu. A line should appear from the hip to the circle. The pole vector should now function. You will now be able to move the knee from side to side without moving the foot and you'll be able to position the knee separately from the foot allowing for more exact positioning of the leg. 







Saturday, 7 May 2011

How to create a rig for legs.

Creating the joints.

Before starting make sure that maya is set to the animation settings in the drop down menu  below the taskbar and in the toolbar settings. This is shown in the screenshots below.

The first step to creating a rig is to import the object you are going to rig for animation.


In order to place the joints for the leg it's much easier to look through the side view
to be sure that you are placing the joints right. Perspective view makes it harder to see exactly where you are placing them.

Creating a new layer for the leg mesh makes things easier later on as this enables you to 
hide the mesh and see what's going on inside and select joints more easily.
Make sure to label the layer so that you know what it is.

Turning on X-ray joints will enable you to see where you are placing the joints
whilst still having the mesh visable for placement.
Select the joint tool to create the joints for the rig.
Create joints at the hip, knee, anke, ball and toe as shown.
When creating the toe hold shift and drag from the ball joint you created. 
This will make sure that the joint is straight.
 
Go back to perspective view to position the leg joints within the mesh.
Using the move tool move the joints into the correct position within the mesh.

Before mirroring the joints you need to make sure that all the joints are oriented the right way. To check which way the joints are oriented simply press F8 and click on the question mark shown in the diagram.

If a joint has it's axis facing a different way from the others you can fix it by clicking the orient joint option in the skeleton menu. 

In the options box you can change which way the axis is pointing.


Now that the joints are in the right position and are oriented the same way we can mirror the joints to create the other leg.
Before doing this though be sure that all your joints are named properly. 

Bring up the outliner in saved layouts so that you can see all the joints you've made.

Here you can rename the joints and see the order in which they flow.


Now to mirror the joints simply click the mirror joint option in the skeleton menu. 
Click on the small box next to it to edit the mirroring options.
Here you can select which axis to mirror and you can also tell Maya to change all your naming conventions to finish with R instead of L to signify the right leg.
Create new layers for each leg and name/colour them appropriately.
Next is the joints for the centre of gravity to join the legs together. 
Make a joint between the two hip joints then holding shift drag upwards to create a spine joint.
In order to set up the joints correctly we need to make the centre of gravity joint the parent of the legs.
To do this first select the leg and then holding shift select the centre joint and then press P on the keyboard. You should now be able to select the whole rig by click on the centre of gravity joint.
Take this opportunity to rename the joints to something appropriate in the outliner.

IK Handles.

Now that the joints are all set up correctly we need to create the IK handles to make sure that the leg bends properly. Double click the IK handle tool to bring up the options. (The IK handle tool is situated next to the the joint creating tool)  
Make sure that in the drop down menu IKRP solver is selected. Then click the hip joint and then the ankle joint. This should create a line between the two joints. To test that the handle works move the leg up and down from the ankle and the leg should bend realistically. Repeat this for the other leg.

Binding the skin

Binding the mesh to the skeleton can be done at this point. Simply click the mesh, hold shift and click the skeleton (make sure it is all selected by clicking the spine joint).

Now from the skin drop down menu choose bind skin and there you can choose which kind of bind to use. For a human body we want a smooth bind so it moves organically but if we were creating a rig for something mechanical we would use a rigid bind so that the mesh would move more like a machine.

To test that the mesh is bound correctly move the leg and the mesh should move with it. If it doesn't it's probably due to the order in which you selected the mesh and skeleton as I had this problem a couple of times. Make sure to select the mesh first.