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.
































No comments:
Post a Comment