From BlenderWiki

Jump to: navigation, search
Warning
  Warning
The contents of this page may be incomplete and needs review. You can help develop the Blender wiki by contributing to this article.
New Writers

[edit] 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 PartI of this tutorial we'll build a still Gingerbread Man. Then, in PartII, we will make him walk.

[edit] 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 be already 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).

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 :

Blender provides you with 20 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 L. The last layer that is turned on becomes the active layer, the one where all objects that will be created are stored.

Layer visibility controls.

So let's clean up the place.

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 Layer1 is visible. Check the rightmost button on the top row and then click on OK. This will move your camera to layer 10

Layer control toolbox.

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 our modelling job.

[edit] Building the body

Change to the front view with NumPad 1 and add a cube 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.

The EditMode is a mode in which you can edit the vertices of the mesh. By default, all vertices are selected for every new object (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.

Now locate the Subdivide button in the Mesh Tools panel and press it once (The Edit Buttons window for a Mesh.). 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 cube, subdivided once.

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

Note about 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 Image:Template-RMB.png 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 (Limit selection button).


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.


Now press X and, from the menu that pops up, select Vertices to erase the selected vertices (The pop-up menu of the Delete (X) action.).

The pop-up menu of the Delete (X) action.

To model symetrical Objects we can use the Mirror modifier. It will allow 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.

It is pretty empty for the moment. Find and click on the button marked Add Modifier : it opens a list from which you'll choose Mirror(List of modifiers).

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 of whatever Blender is itself to our mesh.(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 one of the X, Y or Z button  : the mirror plane is perpendicular to that axis. In our case it is the Xaxis.(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 axis than the limit we set will be placed exactly on the mirror plane. The limit can be set from 0.000 to 1.000 B.U. 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 B.U. away from the mirror plane would be noticeable but anything closer might not : our mesh could end up ripped by the middle if vertices that should be on the mirror plane aren't. To avoid inadvertandly neglecting a wandering vertex that can cause some problem we should set the Merge Limits to 0.1

Merge Limits button.

Finally, with the Do Clipping button (Do Clipping button) checked, our mirror become a frontier that no vertex can cross : if this were to happen it would cause quite a mess.

Do Clipping button.

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

Let's create Gus's arms and legs. Using the sequence you just learned, Box Select the two top-rightmost vertices (Extruding the arm in two steps., left). Press E and click on the Region menu entry to extrude them. This will create new vertices and faces which you can move and which will follow 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 square to the right. Extruding the arm in two steps. show this sequence.

Extruding the arm in two steps.
Note about Undo:
Blender has two Undo features : one for the EditMode and the other for the ObjectMode.
In EditMode, the following shortcuts apply:
  • Press Ctrl Z for the Undo.
  • 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 undoes, so that you can easily find the point to which you want to revert.
In ObjectMode : the same shortcuts apply.
  • Ctrl Z to undo.
  • Shift Ctrl Z to redo.
  • Alt U to see the history.

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.
  • If you made changes in EditMode that are not lost for that Object, they will be all 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.
Note about Coincident vertices:
If you extrude, and in the process of moving you change your mind and press ESC or  RMB Image:Template-RMB.png to recover, the extruded vertices will still be there, in their original location! While you can move, scale, or rotate them by pressing G, you probably don't want to extrude them again. The simplest mean of getting rid of them is to go back to the steps before you created them with Undo Ctrl Z

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 that shown in Body..

Note:
We use the Extrude tool three times to produce the leg. We don't care about elbows, but we will need a knee later on!
Body.

We're done with mirror modelling ; in the next steps we will experiment 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. Gus being in ObjectMode TAB click on the Apply button of the Mirror modifier.

Note about Reference center:
In Blender, scaling, rotating and other mesh modifications occur either with respect to the 3D cursor position, the object's center, or the barycenter (center of mass) of the selected items, depending upon which entry of the Rotation/Scaling Pivot Menu (Setting the reference center to the 3d Cursor. (Note that the picture is wrong and points to Median when it should point to 3D Cursor )) is active. The crosshair button selects the cursor as reference.
Setting the reference center to the 3d Cursor.
Note about 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->Grid places the cursor exactly on a grid point. The Cursor->Sel places it exactly on the selected object. The other entries move objects other than the cursor.

Gus Needs a head:

  • Move the cursor so that it is exactly one grid square above Gus' body (leftmost image of Adding the head.). Add a new cube here (SPACE>>ADD>>Mesh>>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., right).
Adding the head.
  • This produces a rough figure at best. To make it smoother, locate the Modifier panel and add a Subsurf modifier. Toggle Button (The Subsurf modifier in the Modifiers panel.) Be sure to set both the two NumButtons below to 2 : the first is for what you'll see in the 3D area, the second for the render.
Note about 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 the smooth, fine mesh one.
  • Switch out of EditMode (TAB) and switch from the current default Wireframe mode to Solid mode with Z to have a look at Gus. He should look like Setting Gus to smooth, left.
The Subsurf modifier in the Modifiers panel of the Edit context (F9)
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 SubSurfed 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, 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

(Slimming Gus using constrained scaling., left).

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!

[edit] Let's see what Gus looks like

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

  • 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.
Making both layer 1 and 10 visible.
Note about last selected layers:
Remember that the last layer selected is the active layer, so all subsequent additions will automatically be on layer 10.

2. 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.

Note about entering precise locations and rotations: 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.
The Panel for numerical input of object position/rotation etc.

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.

Note about Tracking: If you choose the option Old Track and if 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.

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 about being in EditMode:
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.
  • Switch to ObjectMode Z 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 cursor (where we set it at the beginning) to object 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.
Set the reference center to Object center.
  • Enlarge the plane so that its edges extend beyond the camera viewing area, as indicated by the outer white dashed rectangle in Camera view.

Now, some light!

  • In Top view (NumPad 7), move the Lamp light (SPACE>>ADD>>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.
  • 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.
The Lamp Buttons window button.
  • 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.
  • 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.6 (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. You will learn more about this in chapter_lighting.

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.

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

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!
Note about Saving:
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.
The Save menu.

[edit] Materials and Textures

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

  • 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 Buttons window 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 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.
  • 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
  • Select the Texture Buttons by clicking the button in The Texture Buttons window Button. or by pressing F6.
The Texture Buttons window Button.
  • 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.
  • 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.
  • 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.

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.

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.
  • 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!)
  • 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 (Template:H) 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.
  • 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 by following the sequence you learned when flipping Gus's body. (Select the crosshair toolbar button, in EditMode A to select all, Shift D, ESC M, Global X Menu entry). Now Gus has two eyes.
  • 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.
  • 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..
The Spin Tools buttons in the Edit Buttons window.

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!

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.
Note about objects sharing a material:
To give one object the same material as another object, select that material in the Menu list which appears when you press the Menu Button ButtonWindow Material Panel.
Selecting an existing material from the Material Menu.

Once you have finished assigning materials, make layer 10 visible again (you should know how), 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.

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

Note about image types and extension:
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.
File type selection menu in the Rendering Buttons window.






Redirects to fix

  • Manual/PartI/The Interface → Manual/The Interface
  • Manual/PartI/The Vital Functions → Manual/The Vital Functions
  • Manual/PartI/Your First Animation in 30 plus 30 Minutes Part II → Manual/Your First Animation in 30 plus 30 Minutes Part II
  • Meta/New Writer → Meta:New Writer