• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
54
C
haracter animation – the art of bringing virtual characters to life– is the computerized counter-part to the hand-drawn cartoon. Replac-ing the drawing board with the com-puter does not really change the craft.Computer-generated animations stillbenefit from a realistic look and feel.Blender is capable of producing photore-alistic images, and Blender offers somebenefits that conventional cartoonistswill never enjoy. For instance, objects ina Blender scene “interact” autono-mously, and Blender correctly calculatesthe highlights and shadows when 3D ob-jects change their positions (Figure 1).Last month we showed you how tocreate a 3D image in Blender. Thismonth, we’ll show you how to put animage in motion using Blender’s anima-tion tools.
Pulling Strings
Blender includes powerful tools for gen-erating motion pictures. These toolswork with so-called
key frames
: in otherwords, there is no need to generate everysingle image in a video sequence. For ex-ample, you could specify the position of an object in the first and tenth frames.Blender will then automatically calculatethe intermediate steps, thus considerablyreducing your workload.Floating rotating objects across thescreen, and changing the colors andsizes of these objects, might be a nice ef-fect for the intro to a news broadcast, forexample, but this is not what I wouldcall character animation. After all, wedon’t just want to beam our figure acrossthe screen. We want its legs to movewhen it crosses the screen; and we wantto see those knee joints bend. Thus,character animation not only means ro-tating and moving an object, but specifi-cally changing the shape of the 3-dimen-sional object. If you bend a hose, thishas an effect on the diameter. Althoughthis is not very flattering for humans, theprinciple is the same for the skin andflesh that covers our bones when wemove our arms and legs.Again, Blender just imitates MotherNature: the program uses a “skeleton”(
 Armature
) of bones and joints as thebasis for moving figures. You can movethe bones just like moving a puppet.Blender treats the limbs like elastic ob-jects and changes their shape to match.You can download Blender from theBlender website [1]. We will be using
Creating animated characters with Blender
CARTOONBUILDER
Blender not only generates realistic single frames; it is also capable ofcapturing the natural movements of people and animals. We’ll intro-duce you to some of Blender’s animation features.
BY PETER KREUSSEL
Figure 1: Blender objects can be rotated, andthey cast shadows just like 3D objects in thereal world.
www . sx c .h   u
Blender 3D Animation
KNOW-HOW
54
ISSUE 66
MAY 2006
WWW.LINUX
-
MAGAZINE.COM
 
55
the latest version of the program for theremaining steps in this tutorial; after all,animation functions are far quicker inthis version. As Blender uses
OpenGL
todisplay wire frames, you will need to en-sure that your graphics adapter supports3D acceleration.The following steps assume you arefamiliar with basic steps such as zoom-ing views, and selecting objects inBlender. If you are not familiar withBlender, you might like to read the firstpart of this tutorial in last month’s LinuxMagazine.3D animation is a computationally ex-pensive process. Even a very small filmclip may contain 20 frames, whichmeans that Blender has to recalculatethe scene 20 times. Before you launchinto the animation, you should simplifythe wire model. To do so click the
 Edit-ing 
button in the lower third of thescreen (Figure 2, item 1), to display theEditing panel for object manipulation.Press [Z] to toggle between the wireframe and the solid view. The wire frameis typically preferable, as it is quicker.You also need to ensure that you areworking in
Object Mode
and not in
 Edit  Mode
.The Editing panel was reworked inBlender 2.40. Many functions that wereconfusingly grouped under
 Mesh
in for-mer versions our now more logicallygrouped under
 Modifiers
. Surfacesmoothing (
Subsurf 
), which we enabledfor most of our objects in part one of thistutorial, is now also grouped under
 Mod-ifiers
.Start by selecting the cap, then disablethe highlighted button to the right of 
Subsurf 
, shown in Figure 2, item 2. Thisdisables the individual wire frame ele-ment view but without influencing thefinal rendering results. However, thiswill definitely speed up the preview.Now click
 Add Modifier 
and select
 Deci-mate
in the drop-down menu. In the
 Per-cent:
field, set the value of 
0.100
, andclick on
 Apply
. Wait for Blender to catchup (that is, wait until the buttons changecolor when you hover the mouse overthem), then press the button again, andsay
OK 
when prompted by Blender. Re-peat this procedure for all objects forwhich a value for
 Decimate / Percent 
isshown in Figure 2. Disable the previewof the surface elements (Figure 2, 2) forthe other objects with a
Subsurf 
entry in
 Modifiers
.
Them Bones…
Position the cursor as shown in Figure 3.Check the position from the front andside perspectives. Press the space keyand select
 Add | Armature
from themenu. Then press[G] and drag themouse to move theendpoint of the“bone” you havejust added to theposition of theknee (in the middleof the leg). Nowpress [E] for ex-trude to add a sec-ond bone. Movethe bone to a posi-tion that makes anatomicsense. Then press [A] twiceto select both bones.[Shift]+[D] creates a copywhich you can now drag tothe other leg using themouse.Again press [A] twice toselect all four bones. Enablethe buttons
 Draw Name
and
 X-Ray
in the middle of the
 Armature
area at the bottomof the Blender window.Blender will now show youthe names of the bones,
 Bone
 through
 Bone.003
. To makethings easier, you might liketo assign more intuitivenames. If the list of bonesdoes not fit in the displaywindow, you can drag theborder of the lower panelslightly upwards. Let’s callthe bones
ul
for “upper leg”and
ll
for “lower leg”. Add
.L
 or
.R
for left or right (Figure4). The convention of taggingsymmetric objects as
.L
and
.R
is a requirement for auto-matically mirroring bone po-sitions, which we will have to do later.This completes the bone structure forthe legs, but attempting to move thiswould have no effect whatsoever on therendering results. Bones are just auxil-iary objects in Blender; all they do is de-fine the movements and deformations of the wire frame that surrounds them. Forthis to happen, you have to tell Blenderwhich areas of the surrounding 3D ob-ject are “driven” by moving the bones.This process is referred to as
skinning
,as what you are doing is pulling a vir-tual, flexible skin over the bones. Wewant the tube-shaped legs to bend at theknees when the figure walks, and we
Key frames:
A key frame is a frame in acompressed video file that contains afull set of image data. In Blender, a keyframe is where you set the object posi-tions manually, in contrast to framesautomatically generated by the pro-gram.
GLOSSARY
Figure 2: Saving effort: using the “Decimator” toolreduces processing time and memory needed for render-ing.Figure 3: When positioning the cursor in 3D space, always checkfrom two perspectives.
KNOW-HOW
Blender 3D Animation
55
ISSUE 66
MAY 2006
WWW.LINUX
-
MAGAZINE.COM
 
want them to change shape to reflectthis. So we need to tell Blender whichareas of the 3D object are connected towhich bones.Up to now the legs have been made upof a single tube. To be able to assign thetop half of the leg to the upper leg bone,and the lower part to the lower leg bone,we will first need to divide the legs. Asthe legs always move at the same time, itmakes sense to group them to form asingle object before we do so. Select theleft leg by pressing the right mouse but-ton, then hold down the [Shift] key andadd the right leg. Pressing [Ctrl]+[J]groups the two objects. Press the [Tabu-lator] key to enable Edit Mode. If you seebright yellow dots, disable them bypressing [Ctrl]+[A]. In the lateral view,press [B] and drag a selection frame overthe top and lower leg cross-sections (Fig-ure 5, left). Then select
 Mesh | Edges |Subdivide
in the menu at the lower edgeof the drawing area. A ring of new han-dles divides the leg at the position wherewe need the knee joint (Figure 5, right).Now quit Edit Mode. Ensuring that thewire frame for the legs is enabled, pressthe [Shift] key, and select the bones. Asingle click is all you need, as the fourbones are just sub-elements of the sameobject. Press [Ctrl]+[P] and select
 Ar-mature
in the
 Make Parent 
pop-up; thenselect
Create From Closest Bones
in the
Create Vertex Groups ? 
menu. The
Vertex-Groups
represent the upper and lowerleg bones for both legs, which can bemoved separately. Now press [Ctrl]+[A]to deselect the current selection, andthen select just the legs. When you en-able Edit Mode, you will now find thenames of the four bones in the
 Link and Materials
area below
Vertex Groups
.Press [Ctrl]+[A] to deselect all high-lighted, yellow points, and click on
Se-lect 
below the
Vertex Groups
. All thepoints that move when the
Us.L
, thelower left leg, is rotated now turn yellow.As you can see, automatic mapping of the wire frame points to the bones hasnot worked perfectly. Because our figuredoes not have an ankle joint, we have tomove the foot along with thelower leg. Press [B] and selectthe missing points. Then click
 Assign
to assign them to thelower leg bone. Press[Ctrl]+[A] to deselect, andthen repeat these steps for theright leg and the Vertex Group
Us.R
.
On the Move!
You can now move the cartoonfigure’s legs. Quit Edit Mode. Just select the skeleton struc-ture and change to the lateralview. Instead of 
Object Mode
,select the
 Pose Mode
entry inthe list box for the
Object 
 menu. Select one of the lowerleg bones, and press [G]. Theknee should bend when you drag themouse. Quit the rotation by pressing[Esc] on this occasion.Our next target is to get the figure torun on the spot. We need four keyframes to do this, where each frame rep-resents one phase of the running action(Figure 6). Blender will calculate the in-termediate steps automatically. In thefirst frame of the video sequence, wewant the figure to stand just like in thefirst part of the tutorial. To select the cur-rent pose for subframe 1, first ensurethat the field on which the current frameis based (Figure 6) contains a
1
. Press[A] twice to select all bones, whichshould then turn blue. Then press [I]and select
 LocRot 
. This tells Blender tostore the position and rotation data forthe selected bones in frame 1.Now go to frame field
5
. In frame 5 wewant the cartoon character to move itsleft foot forward, its right foot back, andto bend its knees slightly, as shown inFigure 6. To allow this to happen, selectthe right upper leg bone in the frontview. Position the cursors exactly on theupper leg joint. Press [R] to turn the legslightly to the left to reflect the step posi-tion. Then enable the lower leg bone,press [R], and slightly bend the knee.Follow the same procedure to turn theother leg slightly to the left, and againbend the knee. Finally, enable all thebones and press [I] to store the positionand rotation values.The third pose, with the right leg for-ward and the left leg back, is an exactmirror image of the pose in frame 5, so
Figure 4: A Blender object has musculoskeletal system just like a real animal. Character ani-mations use bones and joints.Figure 5: To move the knee joint, the leg has to bedivided into two sections.
Blender 3D Animation
KNOW-HOW
56
ISSUE 66
MAY 2006
WWW.LINUX
-
MAGAZINE.COM
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...