From BlenderWiki

Jump to: navigation, search
User Manual: Contents | Guidelines | Blender Version 2.43

Your First Animation in 30 plus 30 Minutes Part I

This chapter will guide you through the animation of a small "Gingerbread Man" character. We will describe each step completely, but we will assume that you have read the interface chapter, and that you understand the conventions used throughout this book.

In Part I of this tutorial we'll build a still Gingerbread Man. Then, in Part II, we will make him walk.

Note: For a much more in-depth introduction to Blender that focuses on character animation, check out the

Blender Summer of Documentation Introduction to Character Animation tutorial.


Just like the "Gus the Gingerbread Man" tutorial you see here, the BSoD Intro to Character Animation tutorial assumes no prior knowledge. It guides you through the process of making a walking, talking character from scratch and covers many powerful features of Blender not found here.

The BSoD Intro to Character Animation also has a downloadable PDF version (3.75 MB) for offline viewing.

Warming up

Let's start Blender. On the screen you should see, from the top view, the default set-up. A camera, a light, and a cube. The cube should already be selected, as indicated by its pink color.(Default Blender screen as soon as you start it.).

Default Blender screen  as soon as you start it (small).
Default Blender screen as soon as you start it (small).

We will organize our working area by placing objects on different layers where we can hide them; we can also bring them back in the current scene whenever we need them. Here is how layers work:

Layer visibility controls.
Layer visibility controls.

Blender provides you with twenty layers to help to organize your work. You can see which layers are currently visible from the group of twenty buttons in the 3D window header (Layer visibility controls). You can change the visible layer with LMB Image:Template-LMB.png and toggle visibility with Shift LMB Image:Template-LMB.png. The last layer that is turned on becomes the active layer. The active layer is where all objects that will be created are stored.

So let's clean up the place.

Layer control toolbox.
Layer control toolbox.

Select the camera and the lamp with Shift RMB Image:Template-RMB.png and press M. A small toolbox, like the one in (Layer control toolbox), will appear beneath your mouse, with the first button checked, which means that the selected objects are stored in Layer1. Check the rightmost button on the top row and then click on OK. This will move your camera and lamp to layer 10.


Now make sure that only Layer1 is visible, because we wouldn't want to erase the lamp or the camera ; select everything on that layer using A and erase it with X >> Erase Selected Object(s). This leaves all the room we can wish for to begin our modelling job.

Building the body

Change to the front view with NumPad 1 and add a cube --if one is not present-- by pressing SPACE >> Add >> Mesh >> Cube. A cube will appear and it will be in EditMode. (Our cube in EditMode, all vertices selected).

Our cube in EditMode, all vertices selected.
Our cube in EditMode, all vertices selected.

EditMode is a mode in which you can edit the vertices of the mesh. By default, all vertices are selected for every new object created (selected vertices are highlighted in yellow - unselected vertices are pink).

We will call our Gingerbread man "Gus". Our first task is to build Gus's body by working on the vertices of our Cube. To see the Blender tools that we'll use for this purpose, press the button showing a square with yellow vertices in the Button window header (The Edit Buttons Window button), or press F9

The Edit Buttons Window button.
The Edit Buttons Window button.

Now locate the Subdivide button in the Mesh Tools panel and press it once (The Mesh Tools panel in the Edit context (F9)). This will split each side of the cube in two, creating new vertices and faces (The cube, subdivided once).

The Mesh Tools panel in the Edit context (F9).
The Mesh Tools panel in the Edit context (F9).
The cube, subdivided once.
The cube, subdivided once.

With your cursor hovering in the 3D window press A to deselect all elements. Vertices will turn pink.


Box Select: On many occasions you may have vertices hidden behind other vertices, as is the case here. Our subdivided cube has 26 vertices, yet you can only see nine because the others are hidden. A normal RMB click selects only one of these stacked vertices, whereas a box select selects them all. But beware that by default this is true only for the wireframe drawtype : in any other mode, Shaded, Solid or Textured we can only select visible vertices, even with box select. To select vertices that are hidden behind others uncheck the Limit selection button. The button is selected in the image at the right.

You must have the Limit selection button unselected Image:Tutorial-unchecked-limit-selection-button.gif to continue this tutorial.

Now press B, the cursor will change to a couple of orthogonal grey lines. Move the cursor above the top left corner of the cube, press and hold LMB Image:Template-LMB.png, then drag the mouse down and to the right so that the grey box encompasses all the leftmost vertices. Now release the LMB Image:Template-LMB.png (The sequence of Box selecting a group of vertices).

The sequence of Box selecting a group of vertices.
The sequence of Box selecting a group of vertices.
The pop-up menu of the Delete (X) action.
The pop-up menu of the Delete (X) action.

Press X and from the popup menu select Vertices to erase the selected vertices (The pop-up menu of the Delete (X) action).

Mirror modelling

To model symmetrical Objects we can use the Mirror modifier. It allows us to model only one side of Gus while Blender creates the other in real time. Go to the Edit context (F9) and find the Modifiers panel, (The modifiers panel).

The modifiers panel.
The modifiers panel.
List of modifiers.
List of modifiers.

It is pretty empty for the moment. Clicking the button marked Add Modifier opens a list from which you'll choose Mirror(List of modifiers).

Nothing much seems to happen; that is because the modifiers offer quite a bit of control over what's displayed and what's not. In our case we will check the Cage Mode button so we can see the transparent faces in EditMode, (Cage Mode button).

Cage Mode button.
Cage Mode button.

We choose the axis that will run from the modelled side of our character to the side Blender is completing by checking either the X, Y or Z button; the mirror plane is perpendicular to that axis. In our case it is the X-axis, (Axis perpendicular to the mirror plane).

Axis perpendicular to the mirror plane.
Axis perpendicular to the mirror plane.

The Merge Limits button (Merge Limits button) acts as a safety net. Any vertex closer to the mirror plane, than the limit we set, will be placed exactly on the mirror plane. The limit can be set from 0.000 to 1.000 units and how big it should be depends on the nature and the scale of the current job.

For modelling Gus, a vertex that would be more than 0.1 units away from the mirror plane would be noticeable but anything closer might not. Our mesh could end up ripped in the middle if vertices that should be on the mirror plane aren't. To avoid inadvertently neglecting a wandering vertex that can cause some problem we should set the Merge Limits to 0.1.

Merge Limits button.
Merge Limits button.

Finally, with the Do Clipping button checked (Do Clipping button), our mirror becomes a frontier that no vertex can cross. If this were to happen it would cause quite a mess. Also, when Do Clipping is active, every vertex that is on the mirror sticks to it.

Do Clipping button.
Do Clipping button.

As you can see, the Mirror modifier gives us a lot of features to make our lives easier.

Arms and Legs

Let's create Gus's arms and legs. Using the sequence you just learned, Box Select the two top-right-most vertices (Extruding the arm in two steps), left) which will actually select the other two behind them, for a total of four vertices. Press E and click on the Region menu entry to extrude them. This will create new movable vertices and faces which you can move with the mouse. Move them one and a half squares to the right, then click LMB Image:Template-LMB.png to fix their position. Extrude again with E then move the new vertices another half a square to the right. (Extruding the arm in two steps) shows this sequence.

Extruding the arm in two steps.
Extruding the arm in two steps.

Undo/Redo

Blender has two Undo features, one for EditMode and the other for ObjectMode.

In EditMode press Ctrl Z to Undo and keep pressing Ctrl Z to roll back changes as long as the Undo buffer will allow; Shift Ctrl Z re-does changes. Alt U opens a menu with a list of possible undos so that you can easily find the point you want to revert to.

Two things to remember:

  • Undo in EditMode works only for the Object currently in that mode.
  • Undo data is not lost when you switch out of EditMode, but it is as soon as you start editing a different Object in EditMode.

In ObjectMode the same shortcuts apply. Ctrl Z to undo, Shift Ctrl Z to redo and Alt U to see the history. If you made changes in EditMode that are not lost for that Object, they will all be undone in one single shot with Ctrl Z when this step --marked as Editmode in the ObjectMode (Alt U) history-- has its turn.

Another way to get out of trouble is to press ESC in the middle of an action. This cancels the action reverting to the previous state.

Coincident vertices

If you extrude, and in the process of moving, change your mind and press ESC or RMB Image:Template-RMB.png to cancel, the extruded vertices will still be there, in their original location! While you can move, scale or rotate them by pressing G,S or R, you probably don't want to extrude them again.

The simplest means of getting rid of them is to go back to prior steps before you created them with Undo Ctrl Z.

Body.
Body.

Gus should now have a left arm that you modelled (he's facing us) and a right arm that Blender added. We will build the left leg the same way by extruding the lower vertices. Try to produce something like in (Body). You will need to uncheck "Do Clipping" if you were using it before (otherwise Gus will end up with a skirt rather than pants).

Note: If you are using Extrude - Region, you will have to clear the transformation constraint (by clicking with MMB) if you want to move around freely.
Note: We use the Extrude tool three times to make the leg. We don't care about elbows, but we will need a knee later on!

We're done with mirror modelling. In the next steps we will experiment with other techniques. We need to make the right part of our model real since nothing done with modifiers is permanent unless we apply the changes. With Gus being in ObjectMode (press TAB), click on the Apply button of the Mirror modifier.


Moving the cursor: To place the cursor at a specific grid point, position it next to where you want it and press SHIFT+S to bring up the Snap Menu. The entry Cursor to Grid places the cursor exactly on a grid point. Cursor to Selection places it exactly on the selected object. The other options don't apply to the cursor.

The Head

Gus Needs a head.

Change back to EditMode (press TAB)

  • Move the cursor to exactly one square above Gus's body (leftmost image of (Adding the head)) and add a new cube (SPACE>ADD>Cube).
  • Press G to switch to Grab Mode and move the newly created vertices down, constraining the movement with MMB Image:Template-MMB.png, for about one third of a grid unit (rightmost image of Adding the head.).
Adding the head.
Adding the head.

SubSurfaces (subsurf)

The Subsurf modifier in the Modifiers panel of the Edit context (F9)
The Subsurf modifier in the Modifiers panel of the Edit context (F9)

So far what we have produced is a rough figure at best. To make it smoother, locate the Modifier panel (F9(Editing) and add a Subsurf modifier, (The Subsurf modifier in the Modifiers panel). Be sure to set both Levels NumButtons below or at 2. The first Level is for what you'll see in the 3D Window area, the second for the renderer.

SubSurfaces: SubSurfacing is an advanced modelling tool, it dynamically refines a given coarse mesh creating a much denser mesh and locating the vertices of the finer mesh so that they smoothly follow the original coarse mesh. The shape of the Object is still controlled by the location of the coarse mesh vertices, but the rendered shape is a finely smooth mesh.


  • Switch out of EditMode (TAB) and from the current Wireframe mode to Solid mode using Z to have a look at Gus. He should look like (Setting Gus to smooth, left).
Setting Gus to smooth.
Setting Gus to smooth.
  • To make Gus look smooth, press the SetSmooth button found in the Link and Material panel of the Edit context (F9). Gus will now appear smooth although he may wear some funny black lines in his middle. This is usually avoided if you used the Mirror Modifier but it might happen when extruding and flipping, as it was done before the modifier was introduced. (Setting Gus to smooth., middle). These lines appear because the SubSurf's finer mesh is computed using information about the coarse mesh normal directions, which may not all point in the right direction, that is, some face normals might point outward and some inward. To reset the normals, switch back to EditMode (TAB), select all vertices (A), and press Ctrl N. Click with LMB Image:Template-LMB.png on the Recalculate normals outside box which appears. Now Gus should be nice and smooth (Setting Gus to smooth, right).

Press MMB Image:Template-MMB.png and drag the mouse around to view Gus from all angles. Oops, he is too thick!

To fix that, switch to side view NumPad 3. Now, switch to EditMode (if you are not there already), then back to Wireframe mode (Z), and select all vertices with A.

Constrained Scaling

(Slimming Gus using constrained scaling., left).

Slimming Gus using constrained scaling.
Slimming Gus using constrained scaling.

Let's make Gus thinner:

  • Press S and start to move the mouse horizontally. (Click MMB Image:Template-MMB.png to constrain scaling to just one axis or press Y to obtain the same result). If you now move the mouse toward Gus he should become thinner but remain the same height.
  • The three numbers on the 3DWindow toolbar show the scaling factor. With constrained scaling, only one of these numbers will vary. Press and hold CTRL. The scale factor will now vary in discrete steps of value 0.1. Scale Gus down so that the factor is 0.2, then set this dimension by clicking LMB Image:Template-LMB.png.
  • Return to Front view and to Solid mode (Z), then rotate your view via MMB Image:Template-MMB.png. Gus is much better now!

Let's see what Gus looks like

We're just about ready to see our first rendering, but first, we have some work to do.

Making both layer 1 and 10 visible.
Making both layer 1 and 10 visible.
  • Shift LMB Image:Template-LMB.png on the top right small button of the layer visibility buttons in the 3DWindow toolbar (Making both layer 1 and 10 visible.) to make both Layer 1 (Gus's layer) and Layer 10 (the layer with the camera and the lamp) visible.
A Tip: Remember that the last layer selected is the active layer, so all subsequent additions will automatically be on layer 10.
  • Select the camera ( RMB Image:Template-RMB.png) and move it to a location like (x=7, y=-10, z=7). Do this by pressing G and dragging the camera while keeping CTRL pressed to move it in steps of 1 grid unit.

Precise Location and Rotation

The Panel for numerical input of object position/rotation etc.
The Panel for numerical input of object position/rotation etc.

If you prefer to enter numerical values for an object's location you can do so by pressing N and modifying the NumButtons in the Panel that appears (The Panel for numerical input of object position/rotation etc). Remember to press OK to confirm your input.

Camera setup

To make the camera point at Gus, keep your camera selected then select Gus via Shift RMB Image:Template-RMB.png. The camera should be magenta and Gus light pink. Now press Ctrl T and select the Track to Constraint entry in the pop up. This will force the camera to track Gus and always point at him. This means that you can move the camera wherever you want and be sure that Gus will always be in the center of the camera's view.

Tracking: If you choose the option Old Track and the camera has a rotation of its own, as is often the case, it could point in an unexpected direction. In that case select the tracking object (in our example the camera), and press ALT-R to remove the object's rotation. Once you do this the camera will really track Gus.

(Camera position with respect to Gus) shows top, front, side and camera view of Gus. To obtain a camera view press NumPad 0.

Camera position with respect to Gus.
Camera position with respect to Gus.

The Ground

Now we need to create the ground for Gus to stand on.

  • In top view (NumPad 7), and out of EditMode, add a plane

(SPACE>>ADD>>Mesh>>Plane).

Note: It is important to be out of EditMode, otherwise the newly added object would be part of the object currently in EditMode, as it was for Gus' head when we added it. If the cursor is where (Camera position with respect to Gus) shows, such a plane would be in the middle of Gus's body.
Set the reference center to Object center.
Set the reference center to Object center.
  • Switch to ObjectMode TAB and Front view (NumPad 1) and move (G) the plane down to Gus's feet, using CTRL to keep it aligned with Gus.
  • Switch the reference center from "3D Cursor", where we set it at the beginning, to "Median Point" by pressing the highlighted button (Set the reference center to Object center).
  • Go to Camera view (NumPad 0) and, with the plane still selected, press S to start scaling.
  • Enlarge the plane so that its edges extend beyond the camera viewing area, as indicated by the outer white dashed rectangle in Camera view.


Lights

Now, lets add some light!

  • In Top view (NumPad 7), move the existing Lamp light (if you do not have a Lamp light in your scene you can add one with SPACE>>ADD>>Lamp>>Lamp) in front of Gus, but on the other side of the camera; for example in (x= -9, y= -10, z=7) (Inserting a Lamp.).
Inserting a Lamp.
Inserting a Lamp.
The Lamp Buttons window button.
The Lamp Buttons window button.
  • Switch to the Lamp Buttons in the Shading context via the button with a lamp in the Button Window toolbar (The Lamp Buttons window button.) or F5.


  • In the Buttons Window, Preview Panel, press the Spot toggle button to make the lamp a Spotlight (Spot light settings.) of pale yellow (R=1, G=1, B=0.9). Adjust ClipSta: to 5, Samples: to 4, and Soft: to 8.
Spot light settings.
Spot light settings.
  • Make this spotlight track Gus just as you did for the camera by selecting Spot, SHIFT, then Gus, then by pressing Ctrl T. If you added the spot in Top View you should not need to clear its rotation via Alt R.
  • Add a second lamp in the same location as the spotlight, and again in Top View, with (SPACE>>ADD>>Lamp). Make this lamp a Hemi lamp with Energy of 0.5 (The Hemi lamp settings).
The Hemi lamp settings
The Hemi lamp settings
Two lamps?: Use two or more lamps to help produce soft, realistic lighting, because in reality natural light never comes from a single point.

Rendering

We're almost ready to render. As a first step, go to the Scene context and bring up the Render buttons by pressing the image icon in the Button window toolbar (The Rendering buttons window buttons.) or F10.

The Rendering buttons window buttons.
The Rendering buttons window buttons.

In the Format Panel, set the image size to 640x480 with the Num buttons at the top right. In the Render Panel set the Shadows Toggle Button top center to On, and the OSA Toggle Button center-left to On as well (The Rendering Buttons window). These latter controls will enable shadows and oversampling (OSA) which will prevent jagged edges.

The Rendering Buttons window
The Rendering Buttons window

Now press the RENDER button or F12. The result, shown in (Your first rendering. Congratulations!), is actually quite poor. We still need materials, and lots of details, such as eyes, and so on.

Your first rendering. Congratulations!
Your first rendering. Congratulations!

Saving our work

The Save menu.
The Save menu.

If you have not done so already, now would be a good time to save your work, via the File>>Save menu shown in The Save menu., or Ctrl W. Blender will warn you if you try to overwrite an existing file.

Blender does automatic saves into your system's temporary directory. By default, this happens every four minutes and the file name is a number. Loading these saves is another way to undo unwanted changes.

Materials and Textures

It's time to give Gus some nice cookie-like material.

The Material Buttons window Button.
The Material Buttons window Button.
  • Select Gus. Then, in the Button Window header, select the Shading Context by pressing the red dot button (The Material Buttons window Button.) or using the F5 key.


The Material Menu button.
The Material Menu button.
  • The Button window will be almost empty because Gus has no materials yet. To add a material, click on the Menu Button in the Material Panel (the one with two triangles, pointing up and down) and select Add New (The Material Menu button.).


  • The Buttons window will be populated by Panels and Buttons and a string holding the Material name, "Material" by default, will appear next to the white square button. Change this to something meaningful, like GingerBread.
  • Modify the default values as per (The Material Buttons window and a first gingerbread material) to obtain a first rough material.
The Material Buttons window and a first gingerbread material.
The Material Buttons window and a first gingerbread material.
  • Press the Menu Button in the Textures Panel area (The Textures menu button in the Material Buttons) and select Add new. We're adding a texture in the first channel. Call it "GingerTex."
The Textures menu button in the Material Buttons
The Textures menu button in the Material Buttons
The Texture Buttons window Button.
The Texture Buttons window Button.
  • Select the Texture Buttons by clicking the button in (The Texture Buttons window Button) or by pressing F6.


  • From the columns of ToggleButtons which appear in the Texture panel select Stucci and set all parameters as in (The Texture Buttons window with a stucci texture).
The Texture Buttons window with a stucci texture.
The Texture Buttons window with a stucci texture.
  • Return to the Material buttons (F5) and set the Map Input and Map To tabs of the Texture Panel as in (Settings for the Stucci texture in the Material Buttons window). Release the Col Toggle Button and set the Nor Toggle Button, then raise the Nor slider to 0.75. These changes will make our Stucci texture act as a "bumpmap" and make Gus look more biscuit-like.
Settings for the Stucci texture in the Material Buttons window.
Settings for the Stucci texture in the Material Buttons window.
  • Now add a second texture, name it "Grain", and make it affect only the Ref property with a 0.4 Var (Settings for an additional Noise texture in channel 2). The texture itself is a plain Noise texture.
Settings for an additional Noise texture in channel 2.
Settings for an additional Noise texture in channel 2.
  • Give the ground an appropriate material, such as the dark blue one shown in (A very simple material for the ground).
A very simple material for the ground.
A very simple material for the ground.

Eyes and detail

To give some finishing touches we'll add eyes and some other details.

  • First make Layer 1 the only one visible by clicking with LMB Image:Template-LMB.png on the layer 1 button (Layer visibility buttons on toolbar). This will hide the lamps, camera, and ground.
Layer visibility buttons on toolbar.
Layer visibility buttons on toolbar.
  • Place the cursor at the center of Gus's head. (Remember that you are in 3D so be sure to check at least two views to be sure!)
  • In ObjectMode, add a sphere (SPACE>>ADD>>Mesh>>UVsphere). You will be asked for the number of Segments: (meridians) and Rings: (parallels) into which to divide the sphere. The default of 32 is more than we need here, so use a value of 16 for both. The sphere is in the first image at the top left of the sequence in (Sequence for creation of the eyes).
  • Scale the sphere down (S) to a factor 0.1 in all dimensions, then switch to side view (NumPad 3) and scale it only in the horizontal direction (Y) a further 0.5, see the second two images in (Sequence for creation of the eyes).
Sequence for creation of the eyes.
Sequence for creation of the eyes.
  • Zoom a little if necessary via NumPad +, MW Image:Template-MW.png, or Ctrl MMB Image:Template-MMB.png, and drag the sphere (G) to the left so that it is halfway into the head, as shown in the first image in the second row of (Sequence for creation of the eyes).
  • Return to front view (NumPad 1) and move the sphere sideways, to the right. Place it where Gus should have an eye.
  • Flip a duplicate around the cursor:
Select the crosshair toolbar button, in EditMode A to select all, Shift D to duplicate, ESC to stop placing it with the mouse and M, Global X Menu entry.

Now Gus has two eyes.

Mouth

  • Exit EditMode (TAB), and place the cursor as close as you can (remember the Shift S key) to the center of Gus's face. Add a new sphere and scale and move it exactly as before, but make it smaller and place it lower than and to the right of the cursor, centered on the SubSurfed mesh vertex Creating a mouth with Spinning tools.).
Creating a mouth with Spinning tools.
Creating a mouth with Spinning tools.
The Spin Tools buttons in the Edit Buttons window.
The Spin Tools buttons in the Edit Buttons window.
  • Now, in the Edit Buttons (F9), locate the group of buttons at bottom in the Mesh Tools Panel (The Spin Tools buttons in the Edit Buttons window.). Set Degr: to 90, Steps: to 3, and verify that the Clockwise: TogButton is on. Then, with all vertices still selected, press SpinDup. This will create three duplicates of the selected vertices on an arc of 90 degrees, centered around the cursor. The result should be Gus's mouth, like the last image of the sequence shown in Creating a mouth with Spinning tools..


Now that you have learned the trick, add three more of these ellipsoids to form Gus's buttons. Once you have made one button, you can simply exit EditMode, press Shift D to create a duplicate, and move the duplicate into place, as shown in The complete Gus!.

The complete Gus!
The complete Gus!

Eyes material

Give the eyes a chocolate-like material, like the one shown at the top in Some other candy materials.. Give the mouth a white sugar like material, like the second one shown in (Some other candy materials), and give the buttons a red, white, and green sugar like material. These are shown from top to bottom in (Some other candy materials) too.

Some other candy materials.
Some other candy materials.


Material Menu.
Material Menu.
Objects sharing a material: To give one object the same material as another object, select that material in the Material Menu list which appears when you press the Menu Button ButtonWindow Material Panel, see (Material Menu).

Rendering

Once you have finished assigning materials, make layer 10 visible again (remember how? Hint, look at the 3D window header), so that lights and the camera also appear, and do a new rendering (F12).

The result should look more or less like (The complete Gus still rendering).

The complete Gus still rendering.
The complete Gus still rendering.

Saving

File type selection menu in the Rendering Buttons window.
File type selection menu in the Rendering Buttons window.

Save your image by pressing F3. Enter the name of your image in the file window and save.

You must choose the image format (JPEG, PNG, and so on) by setting it in the Rendering buttons before pressing F3 (The Rendering buttons window buttons) and using the Menu (File type selection menu in the Rendering Buttons window) in the Format Panel.

Blender does not add an extension to the file name; you must enter one if you wish.

Previous: Manual/PartI/The Vital Functions Contents Next: Manual/PartI/Your_First_Animation_in_30_plus_30_Minutes_Part_II