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.
No comments:
Post a Comment