The Character Tutorial
Introduction to computer animation using Maya
Center for Advanced Digital Application
 


 Part 2: Texturing

 

Creating Animatable Eyes

Now we will create an eye assembly which will allow for animation of the direction the bee is looking as well as the ability to blink.  We want to build the eye assembly at the origin so we first need to hide the rest of the bee. Box-Select all of the Bee surfaces and press "display> hide> hide selection" ( hot key- cntrl h). The surfaces are now hidden.

Create a nurbs sphere. (this time you can reset the option box to use the defaults). In the channel box rename eyeball. Before we create aim-constrain the eyeball to a locator, however we need the put a texture on the eyeball surface so that we can tell which way it is looking.
 

The Eyeball Shader

To better see the texture as we work, select the sphere, and hit hot key 3 (smooth display) and 6 (show textures).

Open the multilister (window> rendering editor> multilister) .  B sure you are in the "general" section  (the tabs across the top indicate the section).  Press (create> material>)   A create render node box opens.  Blinn is the shiniest material, a good choice for an eyeball so click on that.  A new Blinn shader ball appears in the multilister.  With this shader ball selected, click on your sphere, and in the multilister click on assign.  Your sphere should now look shiny although still gray.   Double click on this shader ball (or use hot key cntrl a) to open the attribute box for the shader.  In the box for ramp rename it eyeball".  Under "common material attributes" there is a line called color.  You sill see a color box (grey by default) with a slider, and a small checker box to the right (fig.1). 

This little box is for mapping the attribute.  Click on this box.  The "create render node" box opens again.  This time we want to create a "ramp" map for the color, so click on "Ramp".  The attibute box for the ramp now appears, and your sphere should appear red, blue and green.  Change the ramp attibutes as folows:

Type - U ramp
Interpolation - none

This changes the direction of the ramp and makes the edges sharp.  We only need two colors for the eyeball.  The ramp color box still shows red, blue and green.  Each color has a square box with an x inside on the right side.  Click on the x-box for the blue color to delete it.  Each color also has a small circle to the left.  Click drag the red and green circles up or down to adjust the placement of the colors. (fig.2)

NOTE: The eyeball at this point should be looking straight up along the Y axis. This is correct for now - DO NOT rotate the sphere. This is important for when we do the constraint.

 


Fig. 2 The eyeball ramp attributes

Once you have the two colors properly placed, we want to change them to black and white (or whatever color eyes you character has) .  Select the green color (click on little green circle) then click on the green box next to "selected color".  The "color chooser" box opens.   Select a black shade in the color chooser by clicking on it, then press Accept.  Change the red on the ramp to white the same way.

The Aim Constraint

Now we have an eyeball with a pupil, and we can aim constrain it. Close the Attribute editor and the Multilister. Group the eyeball to itself, creating a group node. Name this new node eye_group. Switch to the "Animation" menu.  Click on (create> Locator). A green t appears at the origin, (which in this case is inside your sphere).  Move this locator along the X axis until it is in front of the eyeball.  Rename it eye_aim. When you aim-constrain something you can no longer rotate it directly with the rotate tool. Moving the locator will cause the eye to rotate. The aim-constraint and the pupil texture ramp are actually aimed in different directions. That is why we need to greate the extra node (eye_group). We can constrain eye-group to the locator, and still be able to rotate the eyeball because it is lower in the hierarchy.  Now select the eye_aim, then shift-select the eye_group (the order of selection is important) and press (constrain> aim). Now you can rotate eyeball so that the pupil is looking directly at the eye_aim (locator). Now select only the eye_aim, and move it - the eyeball should always look toward the locator. Try rotating the eye_group, and you will see that it is constrained and can no longer be rotated with the manipulator.

To review the steps:

1. Create Sphere (eyeball)

2. group eyeball to itself (eye_group)

3. create locator (eye_aim) and place it in front of eyeball

4. select eye_aim, shift select eye_group and >constrain>aim

5. rotate eyeball until it is looking at eye_aim.

6. test my moving eye_aim and the pupil should follow

*NOTE Please use a primitive sphere for your eyes, and for now DO NOT modify its shape. In order for the eye to rotate properly it must remain a sphere. later you can use a lattice deformer to change the eye shape.

To add an eyelid create another sphere and make is slightly larger than the eyeball.  (If your eyeball scale is 1 try 1.02 for the eyelid)  Name the new sphere eyelid.  Click on makeNurbShpere# in the channel box to open the attributes for the sphere creation, and change the end sweep to 270. (fig.3)

fig. 3

The eyelid sphere is now "open".  Rotate the eyelid until the opening is in the right place for the pupil (try x = 90, Y= 0, Z= - 45).  You have completed the left eye set-up.  Now we want to duplicate this set-up for the other eye.  To see the Bee surfaces again press (display> show> all). Shift-select eye_group, eyelid and eye_aim, and position them on the characters left side, then press (edit> group) (*Note do the selecting in the outliner or hypergraph rather than box-selecting in the panel view, and be sure you pick eye_group not eyeball to maintain the grouping you did earlier)  (Hot key cntrl g).  Name this new group eyeset.    Move the eyeset into place.  Now press (edit> duplicate> option box). In the duplicate option box click on "duplicate upstream graph".  This ensures that all connections (such as the aim constraint) are included in the duplicate.  (*NOTE: Due to an apparent bug in Maya your new eyeball may have a funky looking color or texture - simply reassign the shader and it willbe OK(fig.4)

Fig. 4 New eyeset with funky shader

We now have eyeset2. You can rename each item in a hierarchy with a prefix. select eyeset and >modify>prefix hierarchy names and type L_ in the box. Now each node in L_eyeset has an L_ infront of it. Select eyeset2, and prefix R_. Then scale R_eyeset2 to -1 in X to place it on the right side of the head. We can now control the eyes independently, however we will certainly want to control both eyes with a single control.  to do this shift select the two locators (L_eye_aim and R_eye_aim) and group them.  Rename this group Eye_Control. Since this is a new group the pivot point is at the origin, we want it to be at the center of the group (that is between the 2 locators) Select the Eye_control group and >modify>center pivot .

We now have a single node for both eye_aims to control the eyes , however there is nothing to see in the view panels to represent this node.  We can choose it in the hypergraph or outliner but it is much handier to use a visual handle in the view panels when animating.  Everything in Maya is actually born with such a handle - it is just invisible by default.  In order to make the Eye_Control handle visible, select it, and  press (display> object component> selection handle) A very small t icon appears at the pivot center of the group, this is the selection handle. (fig.5) Choosing this handle chooses the Eye_Control node.  If you plan on only controlling the eyes as a team (which is typical unless you want your bee to cross his eyes) you can hide the locators (select L_eye_aim and R_eye_aim) by pressing (display> hide> hide selection).


Fig. 5 eye control handle

(*note: To animate the eyelids for this excercise, we will be using the "makeNurbSphere" section in the channel box and animating the sweeps)

 

Test Rendering

Although you can see the shaders somewhat in the viewports, it is a good idea to test render as you add textures to see what you really have accomplished.  To set up for the IPR (Interactive - Photographic - Rendering) maximize the perspective window and tumble and dolly in to get a good view of the surfaces.  Since these renders are just tests we will reduce the quality in order to speed things up.

Open Render Globals - (window> render globals), and change the folowing attributes:

Resolution: Render resolution:  320 x 240  (this is about half size so the rendering will be quicker)
Anti-Aliasing Quality: medium quality

Set up the perspective window to get a good view of the surface and press (Render> IPR Render into new window).  Click drag a select box aroung the area you may adjust in the render window to identify the region for the render to update.  Now as you make texture changes - such as color, transparency etc. they are quickly updated in the render window. DO NOT CHANGE THE VIEW IN THE PERSPECTIVE WINDOW. .  When you are satisfied, close the render window.   

Texturing the rest of the surfaces

(Once again, I'd like to remind you that this tutorial covers just the basics.  You may embellish your model textures to your heart's desire.  In class I will be showing you more information about texturing such as bump and displacement maps, as well as how to animate textures.)

We are now ready to texture the bee.  You have already textured the eyeballs and we will use the same method to texure the other parts of the bee.  Open the multilister (*note: texturing can also be done in the hypershader but for this excercise we will use the multilister).  Be sure that all you surfaces are in smooth display mode (3) and that all views indicate show hardware textures (6).

First, the most simple shaders for the arms and hands: in the multilister, under the general tab, create a new shader (create> )under material tab choose Lambert Lambert creates a matte (non-shiny) surface.  Open attribute box for this Lambert shader (cntrl a), and click in the colored box under common materials attribute.  The color chooser opens, select a color  - a sample of the color appears in a color box in the  upper left of the color chooser.  When you are happy with the color, click on the small arrownext to this box to save it to use again, then click accept.  The Lambert shader ball now appears the selected color.  In the attribute box click on the tab called LambertSG and rename it armSG.  With the armSG ball highlighted, shift select the arms of your bee and in the multilister, press (edit> assign).Create a new Lambert for the hands and make it a different color.  Save this color as well, and assign the shader to the hands and thumbs.  Do the same for the antennae, and eyelids.

For the Wings, you may also modify the transparency attribute - just move the slider to the right to add transparency.

Since the legs and feet are a single surface we can use a ramp to make them two colors.  Create a Lambert shader and assign it to the legs.  In the shader attribute box click on the map for color (just like we did for the eyeballs), and select "ramp".  Change type to U ramp and interpolation to none.  Now just like the eyeball shader, delete a color, and move the remaining color up or down until in you perspective the leg and foot are two different color.  (Maybe you can keep the third color and give him socks!)  When you click on the "selected color" color block to open the color chooser you can now use the colors you saved when you did the arms.

Image File Textures

Maya also allows for the use of texture maps created in other packages (Photoshop, Corel, Illustrator etc.).  You can use any JPEG, TIF, GIF, IFF, SGI or TGA to name the most common formats, as a texture map.  You may download the .jpg I created for this tutorial here (right click and save target or link as):

Bee face image

You should place any image you intend to use in the "source images" folder of you BEE project.  We will use this image as the texture for the bee's head.  In the multilister create a Lambert shader and assign it to the head.  In the attribute box of the shader click on map next to color.  This time be sure that "with texture placement"  and "normal" are checked, now click on file.  Browse to the correct file by clicking on the folder to the right of the blank space for image name.  When you have found your image file,   press select.  The smile image is now the shader for the entire head. (*Note: if the texture is too fuzzy or dificult to see - go to "Hardware Texturing" in the shader attribute box and change "texture quality" to high.) The image currently is too large and oriented incorrectly. (fig 6) To correct these things double click in the image file in the Mustilister, and click of the Place2dTexture tab. First re-orient the image by typing 90 in the Rotate Frame box. Now the smile is facing the the correct way but it is still way too big (fig.7) . Click on the "interactive placement" button in Place2dTexture. A red outline appears all around the edge of the image file on your surface (fig.8) . With your middle mouse button select one of the the small red symbols (U, V and a dot for the center) and move it around. Select the U or V to resize in those directions and the center dot to move the whole image. Try to place the mouth as shown in fig 9. (It may be easier to first chand the coverage size to .3 or so in each direction before interactively placing the file.)

.

Fig.6 Fig. 7 Fig. 8

Fig.9 Fig. 10

Now all that is left is to make the rest of the surface the same yellow color as the image file. In the attribute editor for the Image File itself open the area called "color balance". Click of the color box next to "default color" to open the color chooser. In the color chooser, select the eyedropper and click it over the yellow color in your image file to choose it as the default color (fig 11) then click "reload file texture". In the final texture, the smile image blends seamlessly with the default color. (fig.10)

.

Fig. 11

Bump Mapping

Let' try a slightly different method for the body.  Create a Phong shader (that is somewhat shiny like plastic)and assign it to the body.  Under color click the map box and choose "grid".  In the grid attribute box change the V-width to 0, so we are working with stripes across his body, and change the the U-width until the black and white bands are about the same size.  Click in the white color box and change it to yellow.  In order to increase the number of stripes, in the grid attribute box, click on the place2Dtexture tab, and change the number of U repeats to 8.  Play around with these attributes until you are satisfied with the bee's  body.  (fig. 12)

Fig. 12

Set up an IPR render now if you have now done so before. See "Test Rendering" above

Now we are going to give the surface a texture. (don't use a Lambert for this - bumps show better when there is some specularity) So far all of the shaders, though different in materials and colors have all be perfectly smooth. We are going to give the bee's body a "bump mapped" texture. A bump map is just a black & white image mapped to the surface. The areas of white seem to protrude from the surface and the black to recede. In the Shadergroup attribute box click on the mapping icon (little checkerboard) next to the blank area at Bump Mapping. Select a Fractal for the bump map. In your IPR render you should see that the updated body surface has a texture. In the Multilister, open out each area of the shader by clicking the tiny arrow at the bottom of each box until you reach the Place2DTexture box after the Fractal. (Fig 13)

Fig. 13

To modify the bump there are several variables to play with. To open the attribute for any box in the multilister, just double click it. To soften the bump, you can select the attribute box for the bump itself (the 3D-looking checkerboard), and decrease the Bump Depth. You can also double click on the Fractal and decrease "Alpha Gain" in the Color Balance section. To make the texture a bit smaller, double click on the Place2DTexture and increase the number of repeats. Continue to modify your bump while watching the updates in the IPR render until you are satisfied with the texture.

Fig.14 Body before and after bump-mapping

Your bee is now ready to be rigged for animation.

Go to: Part 3. Rigging