Finishing up the car, we are going to add some lights and control them through the use of Set Driven Keys or SDKs.
To start with, place some spotlights around the area where the headlights are and set the colours. White at the front and Red at the back. Now, create a controller for the light. I tried making mine look like a lightbulb.
On the controller, we want to add some attributes. In my case, I have Headlight Switch and Brakelight Switch although you could have more or less.
To add attributes, select the controller and go to Modify > Add Attributes...
Give your attribute a name that describes what it will do. Here it's "Headlight Switch" as it will control only the headlights being on or off. Forget everything else until the 'Min/Max' values. Here, put 'Min' as 0. This will be our 'Off' number. Set 'Max' to 1. This will be our on number. Default is the number you want it to start on. In this case, 0.
Add this attribute and now, in the Channel Box you should see your new attribute beneath all the transform information. Currently, changing this number doesn't do anything since we haven't linked it. We need to use an SDK.
Firstly,
SDKs allow for an event to happen when another event elsewhere occurs.
In the case of the light we will have them turn on when the attribute on
the light_control is set to 1 and off when set to 0
Select the light_control and go to Animate > Set Driven Key > Set. This will open the Set Driven Key window.
You will have 'Driver' and 'Driven'. Since we want the attribute to control the light we need the control to be the Driver. Press 'Load Driver'
Now, we want to load the 'Driven'. In this case, the lights. Load the lights in as the 'Driven' by selecting them and clicking 'Load Driven'.
NOTE: By grouping the lights, you can set the visibility of the group to 'off' instead of the individual lights.
By default the Light controller is set to 0 so in the Channel Box, set the visibility of all the lights to 0. Now in the SDK window, select the Light_control's Headlight Switch and the Headlights visibility.
Press 'Key'. Next, set the light_control Headlight Switch attribute in the Channel Box to 1 and turn on the Headlights visibility. Key this again.
Now whenever you type '0' or '1' in the Light Control Channel Box, the Headlight group visibility will turn on and off creating working headlights.
Using all these techniques throughout the tutorial allowed me to add some smaller details such as the bonnet, boot and doors opening. See what else you can add.
Wednesday, 12 November 2014
Lesson 5 - Move Control
A move control is a controller that allows the user to move the entire rig and objects around without them seperating or breaking. This is useful when it needs to be placed in a scene or moved out of the way.
Start by creating a large controller under the car. This can be as simple as a square or circle. Don't forget to freeze, center and delete.
Next, in the outliner, highlight the wheel group, all the controls and then the main control. When parenting it's always Child before Parent which is why the main control is last.
Press 'P' to parent them together. The result should be as follows:
Finally, the Rear_suspension_control and Front_suspension_control need to be parented to the Main_suspension_control.
The final outliner should look like this.
Now when you move the main control, the whole car should move along with all the controllers.
Start by creating a large controller under the car. This can be as simple as a square or circle. Don't forget to freeze, center and delete.
| The large cyan arrows are the main control. |
Press 'P' to parent them together. The result should be as follows:
Finally, the Rear_suspension_control and Front_suspension_control need to be parented to the Main_suspension_control.
The final outliner should look like this.
Now when you move the main control, the whole car should move along with all the controllers.
Lesson 4 - Suspension
The next stage is the suspension of the car. For this we will need a rear, front and full body suspension. Start by creating three CV curves and place them at the front, back and middle of the car to act as the controllers, remember to make them look like the action they control. In this case I used double headed arrows.
Next group the geometry of the car (minus the wheels) twice. You should now have 3 groups for the car like below:
Rename the groups similarly to how they are in the example. To make it so the car rotates when the controller is translated up, we have to use an expression.
Select the "Front_suspension_group" and open the Expression editor (Window > Animation Editor) then select the "rotateX" attribute. Add the following expression:
Front_suspension_group.rotateX
What does this do? This links the "Front_suspension_group" with the "Front_suspension_control". Furthermore, it states that when the controller translates on the Y axis, the group will rotate on the X.
Next group the geometry of the car (minus the wheels) twice. You should now have 3 groups for the car like below:
| The highlighted groups are the body geometry. Notice the wheels are seperate. |
Rename the groups similarly to how they are in the example. To make it so the car rotates when the controller is translated up, we have to use an expression.
Select the "Front_suspension_group" and open the Expression editor (Window > Animation Editor) then select the "rotateX" attribute. Add the following expression:
Front_suspension_group.rotateX
=
Front_suspension_control.translateY
;
It should look like this:
Do this for the rear suspension too.
NOTE: One of your suspension controllers will rotate the car when moving down the Y instead of up. To fix this add *-1 as seen in the above example. This will reverse the direction.
Lastly, we need a controller for the full body suspension. This is a simple point constraint from the main_suspension_control to the Body_grp.
Don't forget to limit the controllers if you need to.
Locking Controllers
Limitting controllers allows you to control how far a controller will go before it stops meaning it can be restricted. Locking controllers is different.
Locking allows you to disable certain axis and tools from being used allowing you to essentially block anyone from breaking the rig by doing things they aren't supposed to.
To lock a controller, click it and go to Window > General Editor > Channel Control. Switch to the Locked tab at the top and in the Non-Locked section find anything you want to restrict.
Here, I've selected the main_suspension_control and since it only needs to move on the Y to control the suspension, I've chosen to lock the Rotate and Scale tools and also the other translate axis. This now stops you from moving the controllers.
Keep in mind. This will also lock you out so make sure you do this at the end of the rig.
Locking Controllers
Limitting controllers allows you to control how far a controller will go before it stops meaning it can be restricted. Locking controllers is different.
Locking allows you to disable certain axis and tools from being used allowing you to essentially block anyone from breaking the rig by doing things they aren't supposed to.
To lock a controller, click it and go to Window > General Editor > Channel Control. Switch to the Locked tab at the top and in the Non-Locked section find anything you want to restrict.
Here, I've selected the main_suspension_control and since it only needs to move on the Y to control the suspension, I've chosen to lock the Rotate and Scale tools and also the other translate axis. This now stops you from moving the controllers.
Keep in mind. This will also lock you out so make sure you do this at the end of the rig.
Subscribe to:
Comments (Atom)