3D Rigging


In this blog I will be documenting the progression of my 3D rigging and including all of the in depth analysis as to how i create my Maya projects. I will be documenting it in the style of something similar to a manual on how to actually achieve rigging, the aim is that someone would be able to read this and learn from my progress as I have. 

So what is rigging?

Rigging is the more technical approach to creating a underlying skeletal mesh that sets up a character model for the animators, rigging is applied to vehicles props and characters, and depending on the character, the more difficult the rig can become, for example, a organic rig is going to be a lot more sophisticated than a human rig because you have to interpret where realistic joints would be even if the character doesn't make any sense. 

25Th Sept
Today is a new start to an excellent sounding module and for the majority of this lesson the class has been run through the basic principles of character and vehicle rigging. We created a basic leg and used that to demonstrate parenting but it was short lived as we only had a small amount of time to produce anything of value. But I have now been enlightened quite a lot so come next lesson I think I will be ready to take on some challenges



27th September
Today we have gone through further principles of rigging such as parenting, constraints, grouping, limitations and much more. All of which I found thoroughly intriguing , today we will be manipulating an arm and parenting bones to pivot points to see if we can portray realistic movement of the human arm.  

2ND October
In today’s lessons we have been working with our car models which we had to provide ourselves. The purpose of today’s lesson was to understand the principles of constraints and cleaning/neatening up our rigging and grouping work.
Before we made any changes to our cars, firstly we had to clean it up, we did this via the “Outliner” this is a great tool for conventionally naming model parts and organising them in a convenient way so they are easily accessible when the model is a lot more complex in the latter.
Below is a screen shot of some of the grouping before and after. 

 4Th October
Today I have been rigging up my car model, and I'm starting to get into the hang of constraints and making body parts of the car functional and intractable. I have been mainly focusing on the wheels today. I created a Double ended arrow which I then applied a bend deformer to, to make it warm around the front of the car. I will be using this as a controller to steer the front wheels left and right using the rotation tools. To find the bend deformer, i first created a CP curve arrow then i wen to animate tab, hit 'Create Deformer's > Non linear > Bend' , this allowed me to bend the arrow and i changed the strength of the bend in the channel box. 

Tip: Remember to delete the history to get rid of the deformer and keep the arrow curved. 



In the above images you can see me steering the front wheels.I have also been working on spinning the back wheels, I created two more arrows and applied bend deformers to make them represent the shape of the wheel. When I had created the actual controllers, I named them conventionally and selected the controller, followed by the back right wheel and I used an orient constraint. I did this with the back left wheel (i want one spin control for each set of wheels, back and front. 

Here you can quite easily see the rotating arrows, these control the wheels, which are oriented to the controller to make them spin. When the controller is manipulated and rotated in its X axis, the wheels then spin because both components are orient constrained. 

Tip: Remember to place the pivots on the Axel of the car so they rotate correctly.

As I progressed with the rigging I decided to look into suspension, I discovered how fun this actually was, and it was quite simple too. This procedure required a few things, firstly the controllers, (the Nurb circles under the wheels), a point constraint and conventional grouping. 


Basically for rear suspension, we want it to be separate form the front, so obviously multiple groups are required, you can see below how I arranged my group names, by having the rear wheel suspension in a separate group, I was able to use the groups pivot point to manipulate the wheels themselves, but first you need to set the wheels up so they can be manipulated. 

That is where point constraints come in, by point constraining each controller to each wheel, I would then be able to manipulate the controller group to change the angle and height of the suspension itself. Thus altering the suspension.

Tip: Remember to freeze transforms on the nurb circles before constraining them so you can then alter the suspension later on and switch to default positioning.

Once all of the wheel suspension was created, I then moved on to creating the suspension of the back of the cars body itself. Basically, if the car was to be driving fast and the driver pushed on the breaks, the rear of the car would raise itself vertically. This is part of the suspension and I achieved this through a process of basic scripting.
Once I made the controller for the body's suspension, I set the pivot point to the front of the car so that when the rear end ellivates vertically, its orientation is based of the front pivot. Once I did this the car didn't move as I wanted it to, so I changed it by adding an expression to the rotate X axis.
The code i typed in is as follows:-
"Rear_suspension_grp.rotateX = Front_suspension_control.translateY *-6"

This basically means that when I move the controller up and down, the rear suspension will follow in the Y axis (vertical) instead of X axis.

This allowed me to manipulate the main body suspension so the car would tilt forward and backwards. The strength of the tilt was quite slow and the car itself barely tilted, so I                                                                                                        increased the strength by adding the "*-6" value at the end of the expression. This simply multiplied the strength of the translation in Y.

Once I had completed all of the main tasks with the car rigging, I decided to venture off and apply my skills to more parts of the car body, so I extracted parts of the mesh and decided to make the bonnet go up and down, this was very enjoyable, because i was starting to finally get the hang of expressions and wanted to challenge myself some more.

I applied the same expressions as I did with the suspension, but it allowed me to create a operational bonnet and I created a different controller to manipulate it, I did the same with the car boot.

I was actually quite annoyed with the controllers I made for the boot and the bonnet so I decided I wanted to change what they looked like, and the colour of the controllers too. Once I was happy with the controllers I realised I could add a lot more to my car

I extracted more areas of the mesh such as the doors and started to add orient constraints to the,, the trick with this is to get the pivot points in the correct areas. To get the door swing perfect i moved the pivot from the middle of the door to the part which connects with the body of the car, where the hinges would supposedly be. I did the same with the controller and this made quite a nice effect. I simple needed to hit 'Constrain > Orient(check box)' and I set the axis to Y. This allowed the door to swing open nicely.

I also did some work with the seats, this was easy too, I created a simple square nurb controller and placed it on the head of the seats, hit point constrain and this allowed me to move the seats backwards and forwards. Annoyingly though I had to do some tweaking because i was able to move the seats out of the car body itself so i decided to do some research into locking controllers and applying limitations onto translation and rotation axis.

Limitations, Locking Controllers and Colour

Once i had created all of my controllers and positioned and constrained them correctly, i wanted to make the rig 'fool proof' as it were, so I decided to look into limitations.

Limitations is pretty self explanatory  its the process of restricting movement in controllers so you and  specify movement and rotation in the controllers themselves, for example on the image above, you can see the seats go forward, that is as far as they go because I applied limitations, before i applied them, they just moved through the bonnet which obviously... isn't possible.

So how do you access limitations?
On the left you will see an annotated image i have created, this is a step by step on how to access limitations and change the values.
No.1: Firstly Select your controller
No.2: Open up the 'Attribute Editor'
No.3: Select the controller itself (if it doesnt appear)
No.4: Select 'Limit Information' and seeming as we are moving the seats forward instead of rotating or scaling, we open the 'Translate' tab.
No.5: Make sure you select the correct axis, you will see two boxes unticked like the others each side with a value in the middle. usually saying '0.00'

The value in the middle stands for its current translation so if its at '0.00' its in its default position. The two tick boxes are the max and minimum translation allowed for that controller, if they are unticked it means the controller can move as much as it wants.

Tick the Minimum (left check box) and set it to the current default value '0', this means the chair will move back as far as it is now. Then check Max (right check box) and move the chair where you want it when its pushed forward fully. When you are happy with its position, the 'current value' in the middle will have changed to something like '0.19'; that is now your maximum value, so copy and paste that into the maximum value box. 
Now when you move the seat, it should go backwards and forwards between those two values, you can change these at any time.

This also applies for doors, I used limitations on the rotate Y axis for the door controllers and it worked a treat. I did this with ever single controller.

Changing Colour

This is a very useful tool, I didn't like the default colour of my controllers which were blue, so I decided to change them to green, and the process if very simple. Do the same steps as the limitations, to go 'Attribute Editor' after selecting your controller.
No.1: Instead of clicking 'Limit Information', hit 'Display'. 
No.2: Hit 'Drawing Overides'
No.3: Check the box saying 'Enable Overides'
No.4: Change the colour to whatever you like.
This tool is very useful, not only is it easier to see, its aesthetically pleasing and more conventional for the animator when the rig gets handed over to him. Making the rig as user friendly and self explanatory as possible is key. 

Locking Controls

This is an optional thing but personally I think locking controls is a vital part of creating a rig, if a controller only rotates in Y axis, why enable all other axis? It can become misleading and the animator will use these controls only to find out they they are useless, so if we eliminate all of the obsolete attributes, the animator will know when he clicks a controller that it only works in specific translations and rotation axis.

I am going to show you how I locked my steering control on my car as I only want it to rotate in the  'Y Axis'.
This is probably the easiest thing to do in the world, and there are two ways to do it.
Either click the controller and open the channel box, then right click each attribute and hit 'Lock Selected', this will turn them grey so you know they are locked and you will not be able to interact with them.
The more professional way, is to select a controller, and go to 'Window > General Editors > Control Editor'. When this is open hit 'Locked', this will bring up a list on the right of the attributes you can lock and on the left the locked attributes will appear there. Currently none are locked, So with the controller selected, scroll down the list selecting each attribute you don't want to be tampered with by Ctrl + Left Clicking each individual one. When you are happy with your selection, simply hit
 'Move <<' and you have locked those controls.

Now my car rig has working doors, bonnet  boot , wheels, suspension, seats, steering i want to try and add a tiny bit more to push up my grade. To do this I decided to create a light controller and a Master controller so i could move the entire car itself.

So first things first Lets create some lights!

This was a little time consuming but very easy none the less and worth the extra effort as it looks good. I started by creating my lights, I wont go into too much detail about tweaking the lights because that's a different subject matter, but I went to 'Create > lights > Spot Light'. This is basically a target light, you can aim where the light is facing and what it is hitting.

I placed the lights at the front of the car where the headlights would be, and hit 'T', I'm not sure what T stands for but it basically allows you to select the secondary component of a light and it controls where the light itself is glowing or hitting. So I aimed it quite far ahead of the headlights because in real life, lights from the headlights travel quite far. 

The image above shows me altering the direction of the light by hitting 'T', I also changed the intensity of the light to quite bright.
Tip: To light up the scene a bit better just throw a basic directional light in, this will add some global illumination  go to 'Create > lights > Directional Light' The positioning doesn't matter it will light up the scene regardless, don't have the light intensity too high. 

So we have our lights, now we need the controller, I locked the lights so they can't be tampered with. For my controller i created a text curve, simply hit 'Create > Text (check box', type what you want adn you will get something like this.
You can see the text has appeared, I positioned mine in obvious sight, above the car, but text is a bit of a wierd thing, each letter was separate when n I created, so to connect all of the letters so its just one controller, I clicked 'Surfaces tab > Edit Curves > Attach Curves'. This made all of the text one control. Next select the controller and go to 'Modify > Add Attribute' Set the value from '0' to '1' and name it "Lights On/Off" then hit apply.

Here is the channel box for the Lights controller, as you can see there is now an added attribute for the lights, this is what will manipulate the lights themselves when we have set everything up.

To change the intensity of the lights, we are now going to set up a set driven key. I wont go into this because I have already done this and it was explained later on in the blog, so if you need to recap, feel free to scroll down to when I added set driven keys to the fingers..

Open up the set driven key menu 'Animate > Set Driven Keys > Set', load the lights controller as the 'driver' and the headlights as the 'driven'. Now before you load the headlight as the driven, the only thing you need to do is go to 'Options > Load Shapes' this is crucial. otherwise the light intensity will not show when you load the headlight and you will not be able to apply a set driven key.
Now simply do as we always do when you set a driven key, and change the intensity of the light to '0' and change the controller value to '0', Hit key. Now change both the light intensity and the controller value to 1 and key again. 
Now when you select the lights controller, you should be able to slide the 'Lights On/Off' value between 0 and 1 which in turn will affect the intensity of the brightness. 

I was very pleased with the result when I did this it created a nice effect of the the headlights turning on and off. In addition you could add a plane and some terrain to see the effect of the light on objects.

Tip: Make sure you lock the control and do not lock the light intensity as it is constantly being altered. 


Human Zoe Rig!!!


20th Nov
In this half of my biog I will be going through the fundamentals of what is involved to create your own human rig. I have thoroughly enjoyed creating my Zoe rig, is consists of creating joints, controllers, set driven keys and attributes  blend shapes  constraints, skinning and over all creating a believable lifelike rig. I will be trying to illustrate each and every one of these points. 

So where do we start? 
Before rigging is initiated, most people firstly create a character model, or find a mesh from a secondary source such as a free model website such as turbosquid.com or 3dmodels.com. These are very handy sources because if you just want to learn principles of rigging and not have to go down the more convoluted path of setting up a character ready for the rig, you can just buy or download for free a character online and manipulate that mesh instead. 

Professionally and typically in the industry, 3D modellers will create a character, then the riggers will allow the model to be animated and manipulated, it is then passed onto the animators who will create wonderful animations for the world to see.

So anyway, you have a character mesh right? so now you want to create a series of joints which will look like an underlying skeleton which will inevitably allow the mesh to be controlled and skinned, Firstly the skeleton needs to be prepared before a skin cluster is applied to each joint.

Tip: It can be quite difficult to go back on yourself and you can incur lots of problems which you wont actually realise until your right near the end of the rigging process, I have discovered this the hard way.  

I was required to go back deleting all of the controllers and IK handles I  had created so that I could rectify tiny little problems affecting the character mesh. So I suggest that when you firstly create all of you joints, you make sure the joints are all correctly oriented in the YZX axis (Y going down the arms and legs), also, Freezing transforms and deleting history is a MUST, this can give you lots of issues when you are trying to Zero things out in the attribute editor and you realise that you have given yourself a lot of problems. 

24th Nov
Below you will see a basic skeleton that I have created inside my Zoe mesh, I have positioned it perfectly where I want it to under lye and I have frozen its transforms and deleted its history so nothing could possibly affect it. 

Here you can see that I have created a basic skeleton for my model made with bone joints.
I have temporarily put the actual Zoe mesh on a layer and hidden it so you can fully see what it looks like, this fits within the mesh itself.

You can also see that on the left there is an image showing the joint orientation, i have set it so the Y axis goes down the all of the joints, this will be the main axis that each joint revolves around.


So how did I create this skeleton?
I started out with the arms first, seeming as these were the most complex I thought I would start by trying to challenge myself and tackle these joints first.
The trick is to start form the centre of the body and work your way outwards, trying to keep in mind how the basic skeleton works. So the joints would protrude like this.
Clavicle > Shoulder > Elbow > Wrist > Phalanges. Creating these in the top and side                             view port ensure accuracy and translation in the view space.

In the series of images on the left, you can see the process involved step by step to change the joint orientation. The first image illustrates the joints badly orientated (you can see joint orientation by clicking  Display > Transform Display > Local Rotation Axis. The second image shows the 'Orient Joint' option, to get to this you click 'Skeleton > Orient Joint (check box)' and I set the rotation from XYZ to YZX. The final picture shows Joints oriented down the Y axis.

In this image you can see that I added a leg to the scene, using the Zoe mesh as a guide I put the view port into side view and tried to plot joints along the curvature of the leg. (I changed the drawing override so the leg  is more visible to see)

We almost have one half of the body already, all we need to do is mirror the joints, connect the legs to the spine we will be creating, and rinse and repeat with the arms, we will then create a neck joint from the top of the spine.

Make sure that when you create the legs, you freeze the transforms, delete the history and enable the Local Rotation Axis. Once you have done this, orient the joints like I did with the arms and it should turn out like the image on the left, You can clearly see that the Y Axis follows the contours of the leg toward the foot.

Next we will mirror the joints!

On the left you can see that I'm starting to mirror the joints now, i selected the base joints so the right arm, right leg (characters perspective) and mirrored them on the XY Axis. there are also  input boxes which are quite useful. One says 'Search for' and the other 'Replace with'.

This allows you to search for specific naming conventions and replace them with another. For example... the 'Rgt_Wrist' could be replaced and renamed as 'Lft_Wrist', this would correspond to whatever joint you select.

Here you can see that i have started rigging the spine, using the Zoe mesh as a guide line for curvature. I started creating the spine using the joint tool and then i made sure that everything was zeroed out by freezing transforms and deleting history.
Once I had done this I repeated the previous steps where i made the local rotation axis visible, and Joint oriented the bones down the Y axis making everything uniform. The spine itself consists of the Upper > Mid > Lower > Root Joint.


Almost there!!!
All we need to do now is make a basic neck joint, this consists of a Jaw joint and a head joint, the head joint will allow the head of the mesh to be rotated and translated when its skinned and the jaw will manipulate the chin.

Now that we have the arms, legs, spine and neck we can now start parenting things. Parenting basically means that the parent will drive the child, so in terms of anatomy, the spine is the parent of the body and the other limbs are the child attribute because the spine drives the body forward and the rest follows.
To do this I simple click on the parent, then the child and hit 'P' on the keyboard. Remember selection is key!

Things you will need to parent are:-
Clavicle > Upper Spine
Legs > Root Joint
Neck > Upper Spine

30th Nov
When this was done I made sure that I conventionally named all of my joints, because I was new to doing this at the time, I realised I didn't like this rig so i started all over again with the knowledge I had learnt and I grouped and named everything nicely and sensibly.


Here you can see the outliner, this shows all of the joints that i have created, visually it doesn't look like there are many, but when you break it down, you can see that there is quite a few.
When i created my first rig joints were named as
'Spine1, spine2, spine3' instead of
'Upper Spine, Mid Spine, Lower Spine, Root Joint' So when i created my new skeleton I made sure everything was named nicely, this also makes life a lot easier if I were to give the rig to an animator, they would know what they were looking at. Another thing i changed which was a major problem was the naming of the fingers, I made sure that I correctly named each joint to its realistic term, 'Proximal Phalanges, Intermediate Phalanges, Distal Phalanges and Fingertip'. Its more professional and a lot easier when you are trying to problem solve.

We now have a skeleton, this pretty much concludes creating a skeleton itself.

Tip: Regularly freeze your transforms and delete the history, its can destroy your precious work!
Keep in mind that the joint orientation also needs to be set in the YZX axis. When everything is parented, do this procedure one last time to be on the safe side and you will be on a roll!

Also make sure you name everything carefully, when you have 10-20 joints named joint1, joint2, joint3, things can get a little bit perplexing. It seems obvious but a lot of people forget!


IK Handles and Controllers
2nd December
So what is an IK handle?
Well first of all IK stands for Inverse Kinematics its polar opposite is FK for Forward Kinematics. Both of these entail two very different principles but give a similar outcome. IK is most common in the industry.

Forward Kinematics when animating is easiest remembered as 'Target' animation, you manipulate each joint separately to create a particular motion. So for example, if you were swinging a bat, you would have to rotate the shoulder, forearm and hand joints as separate entity's in the rotation axis of your choice. This is excellent if you want to create seamless animation which involves curves its less choppy.

Now Inverse kinematics revolves around the assistance of IK Handles which is what I will be using on my rig. Each IK handle has a start and an end IK handle. Everything that is within the IK handle itself will move accordingly to how the IK end has been positioned. The computer works out where the joints themselves move as you manipulate an IK.

So basically if i put the start IK on the shoulder joint and the end IK on the wrist. As i manipulate the end IK handle, it will move the wrist joint itself along with every other joint leading up to the shoulder, so the forearm and elbow would move with the wrist.

Breakdown:-
FK involves the manipulation of individual joints in the rotation axis, you can achieve excellent curvature with this method.

IK involves the creation of an IK handle which you manipulate and in turn it moves all other joints between the handles for you. This is a more complex method but works magnificently when done properly.

IK needs a little more attention though, it requires you to create pole vectors so you can manipulate the angle of the elbow when you move the arm because when you use IK, you cant then manipulate the rig like you would using FK.

Using IK allows you to manipulate handles with Controllers.


So first of all you can see an image of my arm from the top down view with an IK handle attached. To do this you need to go to 'Skeleton > IK Handle (check box)'. Make sure you set the Solver Type to an 'ikRPsolver' instead of an 'ikSCsolver'. You also want to tick the 'Sticky' Label, this will allow everything to move nicely as one.


Tip: This is extremely important, so make a mental note to select RP solver and Sticky when making IK handles for the legs and the arms, for other models this may vary. 
In the image on the left, you can see that I am now manipulating the arm itself using the IK handle on the wrist, this is the end IK.

The joints are moving between the two points.
When this was done, I did the same for the opposite arm.
In the outliner, make sure to rename the IK handles, 'ShoulderIK' will do.


Now it is time to do the legs, at this stage both of the arms should have IK handles attached to them. To create IK's for the legs, we need to attach an IK handle from the apex of the leg to the ankle.
Before we do that though, we need to consider our grouping, we want to be able to more the ankle group so the ball and toe follows accordingly.

So to do this, if you have been naming your Ik's correctly you should have the following Ik's...Ankle, Ball and Toe. You will probably find that when you move the ankle IK that the movement is very messy, and you want it to look like the picture on the left right?

Well this is where grouping comes in its all about hierarchy, here's how you should group them. Ctrl + G = Group to group the following:

CTRL + G > Lft_ToeIK > Toe_Lift_Grp
CTRL + G > Lft_BallIK > Ball_Lift_Grp
CTRL + G > Toe_Lift_Grp + Ball_Lift_Grp > Toe_Roll_Grp
                                               CTRL + G > Toe_Roll_Grp > Lft_Ankle_Grp

6th Dec
Now when all of the above IK handles have been grouped properly, your foot should move like the picture on the left, this will allow you to now create a controller for the legs. This is what we will move onto next.
To make a controller for the foot, firstly we must position all of the pivots of the groups to the right areas of the foot. We do this now because if we change the pivots after a controller is attached, it will change the position of the IK handles.

So the pivots for each group should be positioned like so:

Toe_Lift_Grp + Ball_Lift_Grp pivots are positioned at the Ball Joint.
Toe_Roll_Grp pivot is positioned at the Toe Joint at the tip of the foot
Lft_Ankle_Grp pivot is positioned at the Ankle Joint. 

Okay almost there! Now we can create our controller, its best to start out with something simple such as the preset circle CV curve, but when you have time, you can change the perspective to bottom view and get the outline of the foot using the CV curve tool.

Controllers are important because if you try to imagine giving your rig to an animator, they will expect the foot controller to be to shaped so they can easily tell which controllers do what.

Tip: Make sure after you are happy with your controller and it is positioned nicely, that you freeze its transforms and delete history.


Now that the controllers are in place, we can start attaching them to the IK handles, once the controllers transforms have been frozen and the history is deleted your channel box should look like this.

This is important, the reason being that if you put the character in a odd pose, or you get gimble lock, or any mistakes happen, you can type '0' in all of the attributes and it will put the controller in its default position.

Once you have made the feet controllers, its basically a rinse and repeat process, for the wrist, i created a circle which would control the translation and rotate, but we will come to that next.


In this image, you can see that I have done the same as the feet and created a controller, making sure that i have snapped the pivot onto the wrist joint. When this is orient and point constrained I will be able to rotate and translate the hand, whilst your making all of the controllers its a good idea to make sure everything is FT'd and there is no history.

Create controllers for the neck, wrists, feet, waist and so on, OR do it as you go along, that's what i did, some people like to work differently though. I started from the feet and worked my way upwards as this helped me the most, and i could keep track of where i was.

Constraints
7th Dec
This is where things get interesting! You have been staring at your static skeleton and you really want to get digging into the more complex stuff and bring your character to life? well this is where constraining comes in.

So what are constraints?
Constraints allow you to apply translation, orientation and scale to target objects or IK's the main ones we will be looking at, and the most commonly used are:-

Point: This is a translation constraint, this will allow us to select the controller and translate the movement of the arm without selecting the IK handle itself, its visually more aesthetic and it is visually more helpful. 

Orient: This type of constraint allows you to translate the rotation and orientation of an object through the rotation axis of a controller.
Scale: this is pretty self explanatory, it will alter the size of an object or the movement of the IK.

Parent: Last but not least, the parent constraint, this will be used a lot, this allows for there to be a parent and a child, so the spine would be the parent of the rest of the body as it drives the body forward.

Pole vector: This controls the direction of the IK, this is used for elbows and knees. 

Another example would be by having a Master Controller such as a Nurb circle around the character, allowing you to move the entire rig where you want, but for this to be possible, you would need to parent all of the controllers to the master control. 

To make it seem more simplified I have shown an image of the hierarchy of my rig, all of the controllers are driven by the master controller. 

Well lets get constraining then, so we want the arm to move? well the most important thing to remember when constraining, is your selection, remember to always select your curves and IK's through the outliner, if you click the joints visually you may end up attaching constraints to them which will mess up your rig, ideally you want to select the IK through the outliner, this will ensure accuracy and will minimise defects. 

Start by selecting the driver...'Rgt_Wrist_Ctrl' curve and then your secondary selection needs to be the target, 'WristIK'. The parent is the driver and the child is the target, make sure you always select the parent first when constraining. 

Tip: When rigging, there is a general rule that most people know of and follow, when you are constraining an IK or an object, the parent comes before the child but when you are parenting, the child comes before the parent.


Lets constrain a controller to the wrist; open up outliner (Window > Outliner) and search for your control curve and select it, secondly select the Shoulder IK and go to the 'Constrain' Menu. 
Now we want to point and orient constrain this IK, so to do this click on the check box next to point, and check All and Maintain Offset, this is important. 
If you deselect the controller then select it again, you will find that if you translate the control curve you will see the IK move the arm joints, there should be a natural bend in the elbow. 
Now we need to orient constrain the wrist, so select the curve then the IK and do the exact same process as the point constrain, but click orient instead. You should now have a working arm!

Do this to the legs too, it is the exact same process, but instead of selecting the IK handles for the feet, you select the control curve, then the 'Ankle_Grp' as these contain all of the IK's as one.

This method applies to all controllers, you will rarely apply specific orient and translations on the axis,  constraints are usually made on all axis.

When doing the jaw make sure you have a jaw bone which you can point constrain a jaw controller too, this will allow you to manipulate the chin separately to the actual head base controller.

Set Driven Keys
10th Dec
Set driven keys are very useful and powerful methods of creating fluent looking animations, we will be using them to drive the joints in certain areas of the body, such as the fingers/phalanges and the feet. 
Why do we use them? 
Set driven keys are used to load a particular controller or shape as a driver which will control the outcome of another. It is a powerful tool when it comes to manipulating objects, they work particularly well with blend shapes. 

The reason they are useful in this scenario is because we can create attributes on controllers and apply a set driven key to them. By giving the attribute a set number range using 0 as the default;  we can control how the fingers curl using key frames. 

So for example, hypothetically, if we animated a finger curl using the index finger, we could create an attribute named Lft_index_finger on the wrist control. 
We could set the attribute from 1 to 10 and set 0 as the default. in the animation 0 would be set to default joint location (this is why its important controllers are freeze transformed you can zero out all rotation and translations); 1 would be curl finger up, and 10 would be curl finger round into the palm. This would create a nice seamless animation, but just because we have created the attribute doesn't mean the hard work is done. 
We need to use the set driven keys to put key frames on each of the different numbers. 
It sounds convoluted but its a lot easier than it seems.


I will go through the steps of how to do this now.
Firstly you want to select the wrist controller and add an attribute to it as demonstrated on the left, Click Modify > Add Attribute. 
Create an attribute for each finger curl and set the maximum value to 10, the minimum to 1 and default value as 0. 

Next you need to select your bone joints for the fingers from the outliner and make sure you select the Proximal, intermediate and Distal Phalanges. (see the image below for reference)
Now we have them selected we need to start key framing each joint movement. So lets hit the Animate drop down > set driven keys > set, a pop up window will appear.

With the phalanges selected, click 'Load Driven' at the bottom of the pop up window. Next select the wrist controller and click 'Load Driver'. This setup basically means that the wrist control (driver) will influence the phalanges(driven).

When all three phalanges are selected, select each one and highlight 'rotate Z' in the driven attributes, also make make sure you select the correct finger curl on the driver wrist control attributes too. Next hit Key, this will key all of the phalanges in their default positions at 0 on the finger curl control on the wrist.

Tip: To tell if an attribute is keyed, the value will appear red in the channel box

When this is done, change the finger curl value to -1 and change the rotation of the phalanges so they are facing upwards, Key this and that's another value out of the way. Now change the phalanges rotations so the fingers are fully curled with the value set to 10 and hit Key.

Great! the fingers are now keyed, which means when you click on the wrist control then on the finger curl attribute, by altering the value between -1 to 10, the fingers will start to animate.


Here you can see the three extremes of the finger movement.

-1 = Bend fingers upward
0 = Default
10 = Curl fingers into palm.



Now that this is done, we will do the same with the feet, these are the same principles but are a little different, we want to be able to do the following with the feet.

- Bend the foot at the ball, by lifting the ankle
- Lift the foot at the toe so it rolls forward
- Raise the toe itself so they point in the air
- Create a toe roll on the Y axis allowing you to turn the foot as if you were putting out a cigarette


All of these are achievable because we created specific groups for each foot movement as you can see on the left image.

So as by now you should have a foot controller point and orient constrained on the ankle.
Next we want to add attributes to the foot control, copy the ones labelled on the right side of the image. Toe roll Y and X are optional but very useful.


The next step is to literally do what we did before with the set driven keys and the values, if you need to refresh your mind, scroll up to how we animated the fingers and this is exactly the same process.
We want to Key each group in the outliner which corresponds with the attribute on the wrist.
For example, 'Lft_toe_roll' corresponds to 'Toe Roll Y and Toe Roll X' on the foot controller.

The only difference is that we will set the values on the attributes from 0 to 10 and on the Toe Roll Y we will set the value from -10 to 10 with 0 as default.

Below I have made a video of my rig without the Zoe mesh so you can see how the movement of the feet should work, you see me manipulating the the attribute slider which drives the movement of each joint.

Tip: Clicking the attribute name (E.g. Toe Roll X) then clicking middle mouse on the view port and dragging will change the value, its easier and quicker as opposed to typing in specific values.


Please take your time to visit this link
It will show you my personal rig and how the foot controls work, I do apologise for the average quality in the video, but I have had issues trying to encode the video file, and when I upload it to Blogger, the quality takes a huge step down form its original quality so do have a look. 
It demonstrates how to do this part of the rigging too.

Blend Shapes & Gooey

This is optional and i was not required to do this for the brief, this was an independent study but proved itself very beneficial and useful. 

Blend shapes are a type of deformer, they are extremely powerful and very effective when trying to manipulate the shape of a base mesh without actually effecting its geometry. They are the sort of thing that make more sense when you see visually what is happening. 

The major rules to follow when creating blend shapes are:-
- The shape you a deforming has to have an identical amount of vertice's as the other otherwise it wont work. 
- You must always have a base mesh. (base mesh is the target)
- You must not freeze the transforms of the object.
- Never delete the history, because it will delete the deformer history and the blend shape wont translate to the base mesh properly.

So how did I approach mind? well seeming as the Zoe mesh is all combined I had to do some tweaking. Firstly I decided where I  would have a seam in the mesh. and i decided to have it just above the throat. 
Once I had selected the edge loop, I selected the polygons tab and hit 'Edit Mesh > Detach', this basically detached the edge and split it in two separate edges. I then proceeded to go to 'Mesh > Separate  This allowed me to separate the head mesh itself and it turned out to look like the image at the bottom. 

Now that the head is separated, you want to make sure a few things are covered. 
First make sure the head is re-added to the Zoe mesh layer itself, it has been pulled out of the layer due to it being separated and having a new mesh name. We now have a head and a body mesh so they need to be together. 

Make sure you Freeze the transforms and delete the history of the characters head. 

Now that we have done this, select the head itself and make plenty of duplicates of the base mesh itself.

Now make the expressions you wish to make, keep in mind that expressions aren't preset usually, you don't use a slider and then the character create an entire expression using their eyes, mouth and nose;  you have to individually manipulate each controller so you maximise your potential to make as many expressions as possible. 

When you have made all of your expressions, select them all and and then select your base mesh last, when this is done, go to the 'Animate' tab and hit 'Create deformers > Blend Shapes'

Now put all of your blend shapes on a separate layer and hide it. To access the blend shapes go to 'Window > Animation Editors > Blend Shapes'

A window should pop up, this is sort of like the Outliner, but it story all of your deformer information and when you manipulate the sliders if should change the expression on the face to whatever bland shapes you designed.
 By altering the sliders, you should be able to manipulate each facial expression. Now that we have created these blend shapes, we ideally want to attach them to a series of controllers. For this sort of operation a 'Gooey' Would be best suited. This is the common term for a Character User Interface. 


The best way to do this I find , is to make it look as human like as possible, instead of having tonnes of Nurb circles with text labels, I created a gooey which looked self explanatory.

I created the head outline, eyebrows, nose and eyes using the CP curve tool and i simply put the face in the front view and traced over it, then scaled up the controller itself.

Its a very easy process and can earn you brownie points on the aesthetic frontier.


                                                                                             Make as many controllers as you can and think about how you would like them to work, so for the eyebrow to move up and down, you would have one brow as opposed to having two individual ones for up and for down.  Think how you will position the controllers and how the limitations will work, so will some controls overlap?

Tip: Make sure you scale up the controllers because you want plenty of movement space within the gooey when it comes to moving facial features. 
Also make sure that you freeze the transforms on everything and delete the history. 

Now lets get keying, make sure you select the right controller for a facial feature, so for my example I chose the smile controller.

First of all you want to select the mouth controller as displayed in the image animation on the left, after that, open up the blend shape editor along with the set driven key > set menu. 


Once this is done, load the driver, by selecting the smile control and hitting 'Load Driver'.
Now to select the blend shapes, you need to click on the 'Smile' blend shape in the editor, then hit 'Select' which is found to the left underneath all of the blend shapes. When selected, hit load driven.

Select the smile blend shape which appears when you load the driver, and seeming as you will be moving the control up and down, set the driver to 'Translate Y', Hit key and then move the control curve to where you want, then change the value of the blend shape to 1 (maximum) or change it via the slider and it key again. When you move the control curve you should see an animation in the face of the lips smiling.

Do this for all controllers, its exactly the same for everything else, the only difference with my rig is that one of the blend shapes is not attached to the gooey, its attached to the jaw controller as shown on the left. This is the same process using set driven keys, its just not within a character UI.


Warning!...Remember, never alter the mesh on the head for the base mesh, and never delete the history or freeze transforms of the other blend shape heads, they can be put onto a hidden layer now and locked until you decide to make more. 

The only thing you need to do now is put limitations on your controllers if you want things to remain within the gooey, I did this in the attribute editor, I also changed the colours of my gooey and made sure everything looked nice. I made things that aren't intractable black, the controllers are white, text is green and the outline is indicated as yellow so you can move the gooey around. Make sure everything is parented properly too, here is a screen shot of the hierarchy of my custom UI.

If you have forgotten how to use limitations I covered it in the car rig of this blog so go take a look if it is useful to you.

This character UI is parented to the Master Controller of the main rig, so the UI moves with the character. This saves you having to move the character, then the UI. Make sure you attach the UI to a separate layer so you can have the option to make it visible or not. Sometimes it can get in the way or be too distracting.

 Tip: A faster way to lock attributes on a control is by right clicking the attribute in the channel box and clicking 'lock selected', Alternatively, you can go to 'Window > general editors > Channel Control.

On the left are a few basic expressions I made using my rig.




Skinning

Now we have all the blend shapes ready, we can now start skinning. This is the process of binding a skin cluster to the finished skeleton when you are happy with it. Maya will try to work out how the Zoe mesh itself moves with the rig, but there may be a few snags and its very common, so we will be looking at a few things. 

- Adding/painting skin weights
- Using the component editor (this is a lot more accurate but more complex)
- Posing the character using key frames so you can switch between default pose and advanced pose to spot any problems you may have. 

Before we do this, make sure your skeleton is centred and snapped to the grid, with the mesh positioned on top of the rig. Make sure you are happy with the positioning and freeze the transforms. 


Select the root joint (this will select the whole rig), and proceed to select the body mesh. 



Next, we want to create a smooth bind skin weight so, in the Animation tab go to Skin  > Bind Skin > Smooth Bind (check box) look at the image and make sure the settings are the same.

Make sure Max influences is set to 2, and everything else should be defaulted but the main things to check are 'Max influences' and the 'remove unused influences' check box

Now we have done this we are going to look into painting skin weights.


So what is a skin weight?
A skin weight adds influence to the vertice's on a mesh that is binded to a specific joint, so if you painted skin weights on the leg, it would allow the leg to be moved by manipulating the joints. So by manipulating the controller (which by now should control the joints) you can make the leg move up and down and it looks quite effective.

There are always snags though with skin weights because it can't always be accurate, Maya doesn't compute all influences perfectly. So for example, if you moved the wrist and it affects the vertice's in the elbow, this would mean that the vertice's on the elbow are being 'influenced' (driven) by the wrist.

There are ways to combat this, and that is by using the 'Paint Skin Weights' tool, it allows us to interact and paint the vertice's on the Zoe mesh and try to get rid of some influences that are being affected by the wrist.

We do this by going to 'Skin > Edit Smooth Skin > Paint Skin Weights Tool (check box)' 
When this tool is selected, the mesh should turn black like the image on the left, and you will see white and black shading. Before we start the main things we want to focus on are.


-Value: This changes the paint form black to white, white means that the vertice's in the mesh will move because they are influenced by whatever joint is selected and has the paint on.
Black means nothing will happen, vert's are influenced by nothing, and grey means there is only 50% influence. You can be more specific with values.
- Opacity: This changes the transparency of the paint.
- Joint Selection: As you can see in the pictures on the left, there is a small box containing all of the joints, by selecting these you can see the paint change, that's because different joints have different influences painted on them.
- Replace: You always want to select replace as your paint type, adding influences can mess up your mesh so replacing is the best option, if you replace some black with white, it will figure out the rest for you so either way each vert will have the correct amount of influences.



We need to start selecting joints now and cleaning up some of the influences which are incorrect, the first joint i have selected is the 'Lt_Wrist' and as you can see there are influences on the elbow, (painted in white) because i have selected the wrist joint, when i move the wrist itself, those white influences will follow the wrist, so to fix this, take the value slider down to '0' and start to paint out the white until everything is black. this can take time but its good to get everything perfect. You can see in the image that slowly I'm starting to get rid of the white and the influences are more focused on the wrist. This will resolve the issue that you can see in the above image with the moving wrist. 

The next thing we are going to concentrate on is the component editor, this is used for more precise influencing of vert's, and its very useful but more time consuming and it revolves around trial and error.

  On the image on the left you can see an arm in shaded view which is creased at the inner elbow, this is quite messy and doesn't look natural and painting skin weights isn't going to help here so we need to ideally use the component editor to clean this up.

So open up the component editor by clicking 'Window > General Editors > Component Editor'. When this is open, go to wire frame mode on the mesh and select X-ray so you can see which vert's are overlapping and are offset.

The way it works is you select a vertice, and go to smooth skins tab on the component editor, different values will appear.



  In my example, an elbow value of 0.410 and a shoulder value of 0.590 had appeared when I selected a vert, by altering these values it changed the location of the vert because the influences had been tweaked, eventually i cantered the vert,

  I also did this with the others and within time it allowed me to create a nice natural crease as you can see in the last image.

Tip: the lowest influence is '0' and the max is '1' so '0.5' would be half way, everything is done using decimals  By typing '0' you remove the entire influence and this means you need to select another vertice so you can bring up more influence boxes.

  Here you can see a rather odd pose, basically its purpose is to look for errors in the mesh, I key framed the default controller positions on 'Frame 1' and on 'Frame 5' I created a crazy looking pose, trying to find problems. So when i switch between frame 1 and 5 you see the progression of movement.



  The reason I did this, is because you can quite simply and very quickly change the key frame slider at the bottom of Maya and it will play back this pose. It saves time and allows you to look for snags.

  My work flow was literally edit skin > slide frame > edit skin > slide frame and so on. I was switching back and fourth so much that I needed an easy way to be time efficient. It was the best way to check my Zoe mesh as i was tweaking my work. It is far easier that moving controllers to areas in 3D space, then zeroing out the channel box and resetting the controllers back to default positions.

Extras
12th Dec

These last few steps were optional but very useful, I textured the eyes and added an iris to the material, this brought the character to life a bit. I then created a nice eye controller using two nurb circles for each eye, and a locator in the middle which can move both eyes at the same time. 
  I then selected the controller and then the eye one at a time and hit 'Constrain > Aim' to add an aim constraint. This meant that the eyes will follow the controller wherever it is moved.

  Remember to parent the eyes to the neck, so when you rotate the head controller, the eyes will follow.  Overall I thought this was a nice addition to the rig, it adds a little more realism to it.

Towards the end of creating my rig, I realised I have forgotten 4 fundamental controllers, these are the locators used for the knees and the elbows. These are incredibly simple to make, you simply create a locator by hitting 'Create > Locator'. Once you have created these position them in front of the knees and behind the elbows on each side, but make sure there is some distance between the joints and the locator. 

  Next simply freeze the transforms and select the Lft_knee_locator and the leg IK handle. After that go to 'Constrain > Pole vector'. Now when you move the Locator, the knee should follow. Rinse and repeat this method for the other knee and the elbows.

The Last thing I did, was create a master controller, in the image above you can see a large nurb circle, that is the master controller, it moves the entire rig along with the character UI, I found this very useful and it was very easy to do.

Simply put all of the controllers in a Controller group, keep the 'Master Controller' outside of the group and at the top in the hierarchy in outliner. Select the controllers group and parent them to the master controller. This allows you to move everything in unison.

Finally here are a few poses that I have created to demonstrate the power of the rig! I have really enjoyed creating this character set-up and will definitely use it when I create my own character designs in the future. 


Thanks for reading my blog!



No comments:

Post a Comment