Sunday, 14 December 2014

Rigging The Human

The first step for rigging the model of Captain Atom was to create the skeleton. The bones for the legs, the arms and the spine were created on their own, the legs were then parented to the pelvis bone and an extra bone was created as a clavicle for each arm to which the arm was parented. The clavicle was then parent to a bone part way up the spine. For the head, a neck bone, bone for the centre of the head, one for the top of the head and finally two for the jaw were needed. This was then parented to the top of the spine. The finger were also created individually before all being parented up to the arm.
The first part which I rigged were the legs. Three IK handles were created, on from the hip joint to the ankle, one from the ankle to the ball and one from the ball to the toes. I then created a controller underneath the foot and this was point and orient constrained to the ankle IK. This allowed the whole leg to be moved, and the ankle to be rotated. The last thing needed to make the leg work correctly was a locator for the need. By constraining the ankle IK to this locator with a pole vector it meant the knee direction could be easily set by the user.
     








Next, four attributes were added to the foot controller called Ball Lift, Toe Lift, Toe Roll Y and Toe Roll X. Set Driven Keys (SDKs) were then used to add different movements for the foot which are all shown below.

Ball Lift Attribute


Toe Lift Attribute


Toe Roll X



Toe Roll Y

The next part I rigged were the arms. Only one SDK was needed to rig the arm and was put between the shoulder joint and the wrist joint. A controller was created at the wrist and this was parented to the arm IK allowing the arm to move. This controller was also orient constrained to the wrist bone to allow the hand to rotate properly. Just like the leg, a locator was used to keep the elbow pointing in the right direction.



Next I rigged the fingers and thumb for the hand. Each finger needed to curl individually and all the fingers needed to spread out so another controller was created above the hand and attributes for controlling the fingers were added to it. Attributes were also added to allow the thumb to curl and move up and down. The fingers and thumb were then rigged using SDKs.

Finger Curl


Finger Spread

Thumb Curl and Up/Down


The next thing which I rigged was the spine. First a Spline Solver IK handle was added from the top to the bottom joints in the spine. Then two clusters were added, one to the top two control vertexes on the spine curve and one to the bottom two. The pivot for the top cluster was moved to the spine joint just below the pecs and the pivot for the lower cluster was moved to the pelvis bone. Two controllers were created around the torso, one at the pelvis and one just below the pecs and these were parented to the corresponding clusters. These controllers allow for a lot of move in the torso at two different points.
           

                Lower Spine Controller


















                                                             Upper Spine Controller

Next I added to bones between the spine and the arms to act as the clavicle, A clavicle was added between the clavicle bone and the shoulder bone. This was then parented to a controller created on the should and allows for a small amount of movement.


Next was the head and neck. These were more straightforward as they didn't require any IKs. The neck was rigged by parent constraining the neck bone to a control, allowing for a small amount of movement. The head was rigged by orient constraining the head bone to a seperate controller, allowing the head to rotate in all directions.

Neck Movement

Head Rotation

The jaw was rigged by orient constraining the jaw bone to the jaw controller. This was then limited so the jaw couldn't open unnaturally far.

The final bones which were added were loose bones above the eyes and were to be used to add expressions to the face. Controllers for these were created above the head and parented to the central head joint to make the controller always move with the head. SDKs were then used between the controllers and the loose bones to allow some expression to be added.

Loose Bones

The final thing that needed to be rigged were the eyes themselves. In order to make the eyes open and close a blend shape was used. This involved making a copy of the mesh and moving verts into the new places.

Once all of the movement rigging work was done, the final step was to skin the model. After the automatic skinning was done, there were many areas where the mesh didn't move correctly. In order to fix this I used the component editor and by selecting all of the vertices which needed work and changing how they were influenced by different joints I was eventually able to change most of the skin weight to a point where I was happy with how they moved. Below are a selection of images showing different parts of the model with the skin weightings fixed.









 Overall rigging the human was challenging, with many issues encountered along the way. The arms and legs were fairly simple to rig correctly, as was the spine. The head and neck area were fairly easy to rig after initial trouble caused by controllers affecting the wrong joints. The skinning was the single most time consuming part of this. Using the component editor change the influences on the mesh was difficult to work out how to use and first and required a lot of initial experimentation. However once i'd work out how to use it, actually getting the majority of the skin to look right went well.






Wednesday, 12 November 2014

Rigging The Car

The first task for the Rigging module is to rig up a model of a car. This included rigging the wheels, suspension, lights, doors, bonnet and boot.

Bonnet, Doors and Boot
After receiving the car model and fixing the majority of the errors it had, the first parts I decided to rig were the doors, bonnet and boot. The actual work required for all of these bits was fairly straight forward. For each I first created a controller and froze the transformations on it. Freezing the transformations on all of the controllers before applying constraints to them is vitally important to make them work as intended. Next I had to get all of the separate elements for each parts into groups so that each door, the bonnet and the boot could be rigged as a whole. The door groups I created were Bonnet_Group, Left_Door, Right_Score and Boot_Group. I also named their respective controllers to correspond with the group names. The next thing which had to be done was move the pivots of each group to the point where the model needed to pivot.




After this was done it was a simple case of creating an orient constraint with each controller as the parent and each group as the child. The boot and bonnet were given orient constraints in the Z axis while the two doors were constrained in the Y axis. I then set limits for how much each controller could rotate with the maximum rotations for each shown below. The boot, doors and bonnet were all a simple enough start to rigging and thankfully all worked correctly first time.


Rear Wheels
The rear wheels were relatively simple to rig as I already done wheel rotation on a practice model and the suspension was a simple translation constraint. After grouping all the separate parts of the two rear wheels into two groups I created a single controller for the rotation of both wheels and a controller underneath each wheels to give them independent suspension. An orient constraint was applied to both wheels allowing only Z rotation from the same controller so they can be rotated together. A point constraint in Y axis was applied between each wheel and it's own controller to create the suspension.



Front Wheels
Despite first appearances, the front wheels proved much trickier to get working than the rear wheels. Originally I had the front wheels set up in the same way as the rear wheels, with an orient constraint for the wheel spin and a point constraint for the suspension. However, the issue came when adding an extra element to the front wheels, steering. Due to the way Maya works, you cannot have two different orient constraints applied to the same groups as one will simply overwrite the other, causing the earliest constraint to stop working. Eventually I discovered that a way around this was to use parent constraints for certain bits instead of regular constraints. To get my front wheels working I first used an orient constraint on the Z axis for the wheel spin for both wheels, then I point constrained each wheel to a separate controller to translate on the Y axis for the suspension. The bit hat differed from my first attempt was that then I applied a parent constraint to rotate only in Y to both wheels. Doing this meant the the front wheels could be moved up and down, turned left and right and rotated in any order without any issues.

The wheel spin controllers for front and back wheels.

Suspension controllers for front and rear left wheels and below the two controllers in use.


The steering control and the steering in use.


All of the front wheels controllers, steering in purple, suspension in red and wheel rotation in white.

All three controllers used together.

Expressions/ Body Suspension
Perhaps the most complicated part of rigging the car was the front and rear body suspension controls which could only be created with the use of expressions. The first step involved creating a group containing the entire car body and the controllers attached to it called FrontSuspension and the putting this into a second group called BackSuspension.The pivot for the FrontSuspension group was moved over the front axle and the pivot for the BackSuspension group over the rear axle because to make the suspension rise at one end of the body it would need to rotate from the other.



The next stage was to go into the expression editor and create an expression which when applied to the individual controllers above the car would raise the body at that end. The basic principal for this was that translate the controller in Y should make the body rotate in X. For the read suspension, the group pivoted over the front axle needed to rotate when the RearControl was translated upwards in Y.





The front suspension worked with the group pivoted at the back rotating when the FrontControl was translated upwards in Y. However, at the first the body would rotate in the correct direction only when the front controller was moved down not up. This was fixed by adding an extra line of code to the expression, *-1, which fixed this issue.



The large rectangle controller in the middle is an overall control for the body suspension, created using a simple point constraint in the Y axis and an orient constrain in the X and Z axes. This makes it possible to raise the entire body equally, and to add a small amount of body roll to the car either front and back or sided to side.

 Body roll left and right


Body roll front and back


SDKs/Headlights
The headlights for the car were made to work using set driven keys. Once the lights were in place a controller was created and an attribute called 'Headlights' was added to it. For my rig I set the minimum value for this attribute to 0 and the maximum to 2. The next step was to open up the Set Driven Keys windows, load the attribute on the controller as the driver and the visibility of the headlights as the driven before pressing set. Pressing set the first time set it so that when a value of 0 was put into the Headlights attribute all of the headlight would be visible, or on. By changing the attribute value to 1, turning off the visibility of the inner lights and setting a key again I was able to add a dimmed headlight mode to the car and by turning off all of the lights and keying it again with the attribute at 2 I was able to set all lights to off.




Final Polish
The last controllers that needed to be added to the car was an overall position controller which would be used to move the car into the correct position. The was done easily enough by creating a group with everything in it, a single large controller underneath the car and by then orient and point constraining the group to the controller in all axes with no limits on them.




Final Polish
The final step in the car rig was editing all of the controllers so that they would be easier to use and difficult to break. This was done by removing all of the attributed from the controllers other than the ones which they actually needed to do and by adding limits to all translation, rotation and scale axes which should be used by each controller.



To make the controllers easier to distinguish I also coloured them with orange for the body suspension controllers, light blue for the door, bonnet and boot controllers, red for the wheel suspension controllers, white for the wheel rotation controllers, purple for the steering controller, yellow for the headlight controller and green for the position controller. Below if my final rigged car.

Summary
Overall the car wasn't too difficult to rig with most bits being straightforward once you've been told how. The only issues I has with it were the front wheels not being able to rotate in multiple axes, which was fixed through the use of parent constraints and the expression for the front body suspension not working in the correct direction which was fixed by multiplying the expression by -1.