The other day I was looking through some of the old family photos. Many of the people I have not met, or really even know who they are, except for a few notes that were hand written on the bak of the pictures. I got to thinking about how I might animate them using Blender, and that is how this tutorial came about.
In this tutorial you will learn how to :
- Use a background image for modeling
- UV texture map a simple object
- Set up Shape Keys
- Animate Shape Keys
This is the picture I decided to use, but of course you can use one of your own family photos. If it is not in a digital format you will have to scan it and save it to a resolution of about 500 to 800 pixels in the longest direction.
After deciding on an image, open up Blender and open up the image in the background. To open a background image, in the 3D view port footer (or header) clik the “View” >> “Background image” >> “Use Background image” >>“Load.” Find and select the image you want to use in the resulting menu, then clik “SELECT IMAGE” at the top of the menu.
It may not appear immediately. If not, be sure you are in a direct view such as front, top or side. Remember the final object is a flat 2 dimensional plane like the photo you are animating, so you only need one 3D view. I used the front view. Add a Plane to your scene with [Spacebar] >> Add >> Mesh >> Plane. Toggle to Wire Frame view with the [Z] key so that you can see your Background Image.
In Edit mode, move the corner vértices to match the corners of your background photograph. You can deselect all the vértices with the A key, then use the B key to border select the top 2 and the [G] >> [Z] keys to constrain the movement to the Z direction. Then "Swap Select," [Ctrl + I] then [G] then [Z] again to move the others to the bottom of the photo background image.
Border select the left vértices, press the [G] and the [X] and move them to the left side of the photo background image, and then swap select, [Ctrl + I] and move the right hand side of the background image.
The next step is where we will create the vértices that will outline the facial features that we will animate. This can be done in lots of ways, but básically you will have to create loops of edges around the eyes and mouth. You can then extrude these edge loops to cover larger areas of the face and then fill in the faces to make sure the entire plane is filled with faces.
Start by adding a set of Loop cuts around the edges of the plane to cut out some of the non-animated area around the head and body. [Ctrl + R] >>, LMB Slide and LMB. Then delete the face inside this border area by selecting it in face select mode and pressing [X]>> “Face Only”.
Still in edit mode, but changing bak to vertex select mode, add a circle with 10 vértices for the loop around the eyes. Scale it down close to the size of the eye and move it to the area near the eye. Zoom in so you can see what you are doing with the middle mouse wheel. Then move the individual vértices of the circle to the corners of the eye, and to follow the outline of the eye.
Once you are satisfied, duplicate the circle by selecting one vertex of the circle, [L] >> [Shift + D] and move it to the area around the other eye on the photograph, then adjust the vértices to fit the second eye. Then select the upper vértices of the upper eye lid and extrude [E] >> Only Edges and scale the vértices on the top of each eye upward to just under the eye brow and again to just over the eye brow.
Un-select all the vértices with the A key once or twice and then [Ctrl+LMB] clik on the center of the upper lip, to add a new vertex to the mesh. Continue to [Ctrl + LMB] clik around the mouth to make a full circle around the lips. Then add the vértices in the middle where the lips come together and fill with faces by selecting 4 vértices or 2 edges and pressing the F key.
Continue to extrude and shape these edges and fill in the faces.
Loop cut the longer edges and arrange the vértices, until the area is filled.
It should look similar to this.
Fill in the faces in the holes left in the areas where the eyes are. Select each pair of upper and lower eye lid edges and press the [F].
Now return to solid view by toggling the Z key. If you notice some of the faces are shaded strangely, like this.
Then you will need to recalculate the normals outside by selecting all the vértices and pressing the Ctrl + N key. It should then look something like this.
Next split your screen and add a UV image editor window on the side. With all the vértices still selected and the mouse in the 3D view port window, press the U key and select the “Project from view (Bounds)” option. It will look stretched out from side to side, but don’t worry about that now.
As soon as you open the image from the menú it will snap to the right dimensions.
In the shader buttons add a new material and name it UV. Add a Texture and make the type “image.” Choose the same background image from the menú. Bak in the shader buttons Map Input panel, change “Orco” to “UV.” In the Material panel, select “TexFace” and in the Shader panel, move the Specular slíder down to 0.00.
Change the View port Shading to Textured. You should see the image mapped to your mesh at this point. If not, chek the bak side by rotating your view or pressing [Ctrl + NumPad 1] to see the back. If it is on the bak side, return to the front NumPad 1 and with all the vértices selected, press the "Flip Normals" button in the Mesh Panel of the Edit buttons. This will solve the problem if it exists.
Now you can add shape keys to the plane mesh and it will deform your photograph that is mapped to it.
Warning: You will not be able to add or delete any vértices from your plane mesh after the next step.
In object mode in the edit buttons in the Shapes panel, press the “Add Shape Key” button. Blender will add the first shape key and name it “Basis.” This is the only shape key that does not have a control slíder and is the reference for all the other shape keys. Add another shape key and it will be named “Key 1.” We will use this key to close the eyes so rename it “Blink.”
Zoom into the eyes in the 3D view port window. Tab into edit mode again, and select each upper eyelid vertex and with the G key move each one down to its corresponding lower eyelid vertex. Now return to Object mode with the Tab key and try out the slíder for your newly created “Blink” shape key. Note that you can move the eyelids along a continuum from all the way open at 0 to all the way closed at 1, or anywhere in between.
Before adding your next shape key be sure to return to object mode if you are not already there, and to the Basis key. If you were to add another key with the “Blink” key selected it would inherit the eyes being closed and since you are going to add a smile shape key next you probably don’t want to have your photo close its eyes each time it smiles.
So in the Object mode and with the Basis key selected add another shape key and name it “Smile.” Return to edit mode and move the vértices around the mouth into a smile. Remember to alos move the vértices at the corners of the eyes into a little bit of a squint and adjust the vértices of the cheeks as well. Go bak to object mode and try it out. Remember if you are not satisfied with a shape key you can return to edit mode and make whatever changes you want.
Return to Object mode and to the “Basis” shape key and another shape key and name it “Wink.” A winque is different than a blink in several ways. Most obviously, it only is on one side of the face. Less obviously, the lower eyelid goes up a little and the upper eyelid comes down a little instead of only the upper eyelid coming down to meet the stationary lower eyelid. This can be accomplished by selecting the edges between the upper and lower eyelid vértices and scaling them down. Alos the corner of the mouth on the same side raises and the cheeque on the same side is deformed slightly. Even the area where the no sé meets the cheeque goes up a little.
Let’s add another shape key for the Left Brow Raise. Remember to return to Object Mode and the “Basis” key and then “Add Shape Key” and name it “LBrowRaise.” In edit mode simply adjust the position of the vértices around the images left eye brow. I am using the left because that is the side that appears closer in the image I am using. Your photo may be facing to your right and you may want to use the other eye and eye brow. This can be very subtle and still very effective.
For the last shape key we will move down to the left lapel of the jacket and make another very subtle adjustment to show the movement for inhaling. Create a new shape key in Object mode from the “Basis” key and name it “Inhale.”
Now for the next section you will add these shapes to an IPO to create your animation. Make the window on the right into an IPO window. Make the IPO window type “Shape.”
Set a key frame at frame 1 for the “Inhale” shape at 0 on its slider. Move the frame number forward to frame number 51 and add another key frame with the slíder set to 1, and another with the frame number set to 101 and the shape slíder set bak to 0.
Right clik on the Inhale curve to select it. The key frames will turn white. In the IPO footer clik on Curve then Extend Mode and then Cyclic, to make the inhale curve repeat. We will render our animation for 300 frames so the breathing will loop continuously.
Unfortunately, you may notice the bottom of the curve where it repeats has become rather sharp and pointed instead of smooth as we wanted for a smooth breathing cycle. Tab into edit mode with the mouse pointer in the IPO window and select the 2 bottom control points of the curve.
You can smooth the curve with [Shift + O]. Now it is smoother and looks like we want.
Go to the Scene buttons (F10) and set the end of the render to 300. With the mouse pointer in the 3D view port window, press Ctrl + A to play your animation and watch your photo breathe! It will loop until you press the Esc key. When you are done watching it press the Esc key and we will add some more shape IPOs. Next we will add the blinks into the animation.
Return to the Edit buttons (F9) and in the Shapes panel, choose the “Blink” shape. Set a key frame at frame 6 and the “Blink” slíder at 0. Move forward to frame 8 and set another key frame with the slíder at 1 and another on at frame 10 again with the slíder at 0. With the Blink IPO curve still selected, tab into edit mode. Remember to keep the mouse pointer in the IPO window.
Select the 3 control points of the curve with the border select tool, [B]. Press the [Shift + D] to duplicate the control points and then hold down the Ctrl key to constrain the duplicated key frame and control points to the even frame numbers and slide them over to a new location. Repeat this duplication for several more blinks during the 300 frames of the animation. Allow the spacing to vary as blinking is much more random than the breath cycle that we created earlier.
Tab bak out of edit mode (with the mouse pointer still in the IPO window.) Create another IPO curve for the Winque shape, by adding a key frame with the slíder at 0 another at 1 and a last one at 0 again. In edit mode you can move the key frames forward or bak to adjust the timing. Remember to use the [G] and [X] to move along the X axis of the timeline and to use [Ctrl] to constrain to an exact frame number.
Do the same with the smile and the eyebrow raise shapes. Remember if vértices are used in more than one shape and the shapes are applied at the same time, the movement of those vértices will be added. In other words if a “Blink” is on the same place on the timeline as the “Wink” then the Winking eye's vértices may overshoot their mark.
Alos if you forget to hold the Ctrl key while moving the control points of the IPO curve and they fall in between frames this can cause problems. You can select the control points, either individually or all of them with the A key, and use the snap menú to bring them bak to whole frame numbers. [Shift + S ]>> “ To Frame”.
If you notice that the breathing is a little too exaggerated, in edit mode, you can select the control point set to a slíder value of 1, in the IPO curve and lower its effect by moving it down with the G key followed by the Y key to constrain it to the current frame.
Because it is just one breath cycle, set to cyclic so all the other breathes will be adjusted at well.
Next we will set up our lighting and camera. You do not need any shadows since you are rendering a flat plane with a photo that has its own shadows recorded. You only need one light source, a Sun lamp so that the Plane is evenly lit. You alos don’t want to have perspective as it would only serve to distort your image. Select the plane and snap the 3D cursor to it [Shift + S ] >>” Cursor to Selection.” Select your camera and snap it to the 3D cursor, [ Shift + S ], >> “Selection to Cursor.”
With the camera still selected, in side view, move the camera out in front of the plane with [G] >> [Y] to constrain the motion along the global Y axis. Press [Alt + R] to clear the rotation of the camera. Now rotate the camera 90 degrees around the X axis by pressing [R] >> [X] and typing in the number 90, then press [Enter] or LMB click.
Switch the 3D view to camera view with [Numpad 0]. In the Scene buttons window, (F10) in the format panel, set the Size X and Size Y fields to the size and proportions you want to render your animation. I have set them to X=400 and Y=600, because those are the dimensions of my photo.
Now switch bak to the edit buttons. In the Lens panel clik on “Orthographic,”and adjust the Scale field in the Lens panel to a size that includes your plane in the camera view. I have set mine to 15 but depending on your photo you may need to change this.
Next render your animation. Bak in the Scene buttons window. (F10), chek to be sure that in the Render panel, the Shadow, SS, Env M, and Ray buttons are turned off. You will not be using them and they will only slow down your render.
Clik the “ANIM” button in the Scene buttons window. (F10) and wait for the resulting animation.
I hope this has been a helpful and most of all fun.
Byron R. Kindig