Join Adam Crespi for an in-depth discussion in this video Creating normal and bright headlight controls, part of Vehicle Rigging in Maya.
The next custom attribute to add onto the car are controls for headlights and high beams. I'll add this control on the master so that I have all my control in place. Right now I've got overspin and drift on that control master on the transform node. And we can see it here in the attribute editor pressing Ctrl + A and scrolling down into the extra attributes. Making sure we're in the transform node first, and there's over spin and drift. Each node can have it's own attribute. So here in the shape node, there's an extra attribute's roll out with it nothing in it currently. It's important to watch where those extra attributes go when you're adding them on, so we're not hunting for controls.
So I'm making sure that I am in the transform node to add these on. So in my channel box, pressing Ctrl + A again, those things show up right here at the top in Ctrl + Master. Now adding an extra atrribute for the headlights and also for the high beams. And what this will do is control a spot light for the headlights. And also the intensity of the material. By default it will be at 0, meaning I will be multiplying those values by 0, so it is not on. When I turn them on then, I will be multiplying the intensity of the light and the material's self-illumination to make it look like the headlights are on. I'll choose Edit, and Add Attribute.
In here first, I'll put in a headlights control. I'm going to leave it as a float with a minimum of 0 and no maximum, and a default of 0. The reason to leave the maximum off is because we may use this in a mental ray rendering solution. With a mental ray photographic control, depending on how we're seeing it through the exposure control. How stop down the aperature is and what our ISO is and our shutter, we may want the ability to brighten up those headlights considerably. So we don't want to put in a maximum here and artificially cap how bright we can go. We want to give our visual effects artist, or our lighting artist, let's say, the flexibility to brighten up this attribute on the car to make the beams look right. I'll add this in by clicking Add.
And now I'll put in one more for the brights, or the high beams. I'll name this high beams. Noting that I've inter-capped here the big b in beams. And again, I'll put a minimum of 0, a default of 0 and no maximum. This is a place, if you'd like to customize, to put in a maximum of, let's say 2 or 3. Whatever percentage brighter the high beams should be over the regular. In this case we'll assume that the regular headlights are on, and we switch over to the high beams by increasing this attribute up to a fix point.
Or we can simply leave it alone and again have that flexibility and rendering to really boost up those high beams. I'll click Okay. And now I've got two attributes here in the Control Master. I'll get the material on, and then I can think about connecting once I have any other attributes done. I'll zoom in on my headlights, and select and isolate those pieces so I can see what I've got going. In each headlight, there's a lens, a trimring, and then the body of the headlight, we'll call it. I'll choose Show and Isolate, and View Selected, and I can see them fairly clearly.
I have the outer lens, and its pivot is actually over here. There is the trim ring which is going to get a chrome, and then this inner backing. If you have more detailed headlights, you may actually have Bulbs and reflectors and lenses in there, and you just need to watch out, which material goes on which piece. So that the bulb looks bright inside the glass of the headlight. What I'll do for this car though, is put this glass on with its own self illumination, so it looks like glass until it gets bright.
I'm going to pick that glass. And make sure I grab the other one. I'll exit the isolation. And hold Shift and pick the other headlight. And assign a new material. Right-clicking and choosing Assign New Material. In my new materials under mental ray, I'll use my MIA material x-passes. I'll slide the nameless slider, and that sizes up the material so they're easier to read. I'm going to use an mia_material_x_passes so I have the compositing flexibility of the x_passes, putting out extra render passes such as velocity and broad diffuse color for a compositing solution later. In my x passes then, the first thing I'll do is I'll scroll over and name that material.
Calling this Headlights. In my presets, I'm going to choose Glass Thick and replace. I went in my presets and tried to apply a Glass Thick and I got an error at the bottom. That's a Maya error. Occasionally it forgets we're dealing in this material. What I'll do then, is just try it again, choosing Presets, and Glass > Thick and Replace, and now it works. Once in a while, Mental Ray seems to forget it has a preset, and you just have to reapply it. This is thick glass, meaning it is refractive if we need. It's made for, typically entry and exit normal, but it'll give us the right refraction on our lenses.
We can also take these lens objects, and clone them, making inside faces, if we really need to get close in the headlights. But this'll look correct, like, well glass headlights for now. I'll scroll down, go into the advanced section. In the advance section, in the additional color, I'm going to put in an MIA light surface node. I'll click on the texture for additional color and in the create render node dialogue under mental ray texture, I'll put in my MIA light surface. What this does is let that material emit light.
Although we may not need it to emit light, Because we are going to put in actual lights to cast light out on the road. It also has final gather and reflection contribution sliders. So that we can correctly dial up and down for the look we want, the intensity of the self illumination of the material and the color. If we want the reflections of the headlights to show up more on a wet road, for example, we have an attribute right here, reflection contribution to over crank that brightness. If we need this to actually cast light in the scene we can by using the final gather contribution, alternately, we can take this material and leave the final gather contribution of those bright elements out.
So that they don't affect our final gather, casting final gather from small objects all over a large object, giving us possible splotches and final gather artifacts. It has a separate intensity, and in our expressions, then, will get the intensity of this material wired to that headlight control. So we can turn on the intensity of our headlights. There's one more thing I need to add here. And that's the actual light. I'll choose Create > Lights > Spotlights. I'm going to create a standard spotlight for now. And if we need, we can add in mental ray properties later. I'll take this spotlight and align it onto that headlight. Holding Shift and taking the headlight geometry.
And choosing from my Hotbox Modify Align tool and aligning this into the center. Here's center, and in a top view or close to centered. And then I'll bring it forward. I may need to slide around so I can see this clearly. Alternately I can just deselect and go find that light, which looks like it's way off in the distance. I'll hold control and deselect the geometry, press W to move and slide that light forward. I'll focus in on the light and it's very very tiny. Typically lights are drawn in Maya with a locator scale of 1. What I'm going to do Is leave that locator scale alone under object display. I may want the possibility of scaling the light using the actual object's scale to scale up the admission area of that light so the shadows come out spread. I also may want to leave the shadows crisp and so I want to see the actual scale of the light if I need to scale it.
So I'll leave the locator scale alone. I'll rotate this light around by pressing e, making sure my discrete locate is on, by pressing and holding e and left-clicking and holding anywhere, and spinning this light. There's a 180 degrees, and I'll put this light just in front of the headlight. Then I'll parent it to the geometry after I clone it. I'll name this light, calling it headlight left. Clone it, and parent to that headlight lens. With the light named, I can press Ctrl + D to duplicate, hold Shift and pick the next lens and align it. As these headlights don't need to turn, I can simply parent them straight in. Picking the lens, and pressing p for parent, and doing it on the other side. I'll make sure I name that last light, so I can find it when I get to my expressions, calling it headlight right.
With the headlights in place,and the attributes to control them, I need to think of anything else in those custom attributes to add in. As I'll be putting the expressions to control these lights in that same tyres expression. So all my expression are together and being evauluated at the same time.
Note: Some experience with polygonal modeling in Maya and beginning knowledge of rigging and constraints will help you get the most from this course.
- Opening and accessing the model
- Scaling a model uniformly
- Creating and cloning controllers
- Parenting the tires and hubs
- Controlling the suspension
- Stitching the rig together
- Writing expressions for the wheels, steering, and body
- Adding brake lights and turn signal controls
- Creating chrome, rubber, and glass shaders
- Applying interior finishes