35,99 €
Completely free and open source, Blender, with its supportive community and powerful feature set, is an indispensable tool for creating 3D animations. However, learning the software can be a challenge given the complexity of its interface and the intricacies of animation theory.
If you want to venture into 3D animation but don’t know where to start, Realizing 3D Animation in Blender is for you. Adopting a practical approach, this guide simplifies the theory of 3D animation and the many animation workflows specific to Blender. Through detailed exercises and a sharp focus on the animation process, this book equips you with everything you need to set out on your path to becoming a 3D animator. It’s much more than just an introduction; this book covers complex concepts such as F-Curve modifiers, rigid-body physics simulation, and animating with multiple cameras, presented in an easy-to-follow manner to avoid common pitfalls encountered by novice animators.
By the end of this Blender 3D animation book, you’ll have gained the knowledge, experience, and inspiration to start creating impressive 3D animations on your own.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 513
Veröffentlichungsjahr: 2024
Realizing 3D Animation in Blender
Master the fundamentals of 3D animation in Blender, from keyframing to character movement
Sam Brubaker
Copyright © 2024 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Rohit Rajkumar
Publishing Product Manager: Kaustubh Manglurkar
Book Project Manager: Aishwarya Mohan
Senior Editor: Debolina Acharyya
Technical Editor: Reenish Kulshrestha
Copy Editor: Safis Editing
Indexer: Manju Arasan
Production Designer: Joshua Misquitta
DevRel Marketing Coordinator: Anamika Singh and Nivedita Pandey
First published: July 2024
Production reference: 1130624
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK
ISBN 978-1-80107-721-7
www.packtpub.com
This book is dedicated to my wife, Elina, my parents, Mike and Charlotte, and the many members of the Blender community who have taught me, inspired me, and involved me in their wonderful artistic endeavors over the years.
– Sam Brubaker
Sam Brubaker is an artist, 3D animator, and Blender expert. After stumbling upon Blender by chance in 2004, Sam was determined to be an animator, and in 2006 his short film won the Blender Foundation’s Suzanne Award for best animation. In 2012, Sam graduated from North Carolina State University with a bachelor’s in art and design and immediately started a career as a freelance animator, followed by a stint as a Blender instructor. He has since been a freelancer and educator living on both coasts of the United States. He now resides in the Midwest with his wife, Dr. Elina Thomas.
Daniele Daldoss is a creative designer who finds his focus in turning classic design into motion graphics and 3D animation. His work ranges from one-off artwork projects to full-scale branding development with the extra mile of including digital technologies in the process. His clients are a mix of small businesses as well as large-scale international corporations.
One year ago, he was hired as a Motion Graphics Team Leader by an international company.
He’s been doing 3D design since 2005, his first year at the Academy of Fine Arts. In 2014, he switched to Blender after a colleague suggested it as software more in line with his way of working. He immediately fell in love with it. Today, he works full-time With Blender and couldn’t be happier.
Jonathan Daniel has been using Blender for over 6 years at this point and is an avid aircraft and tank enthusiast, often modeling these military vehicles in Blender as a hobby.
When someone takes an interest in learning 3D animation, the first question they usually ask is, “What program should I use?”
The answer, according to the smartest and most experienced animators, is that it’s a waste of time to argue about this. An app is merely a tool, not what makes you an animator. What matters are an animator’s ideas, patience, and willingness to learn. Every minute spent mulling over “which app is best” is a distraction from actually animating, so just pick one and get started!
I like that answer, don’t you? Anyway, the correct answer is Blender.
It’s not Blender’s excellent features and competitive price ($0) that make it the best. This quirky free program has changed dramatically since the version I downloaded as a teenager in 2004. Its suitability as an industry tool for animators is no longer disputed like it once was. But the thing that makes it the best 3D program hasn’t changed a bit – Blender is licensed under the GNU General Public License as free software. Not just free as in $0, but really free. The program – along with its source code – is free to download, modify, and share by anyone, and is legally stipulated to remain so in perpetuity. It cannot be acquired by another company. It will never charge you a subscription fee. If you expect to spend hours and hours of your time and creativity in a single program, that “feature” should matter to you most of all.
Another thing that hasn’t changed about Blender is how much fun it is to teach. Blender has always been full of features that users find accidentally. The community shares these “secrets” with one another like scholars sharing esoteric knowledge. With this book, I hope to share a little of that magic with you.
If you’re new to 3D animation and would like to get started with the best 3D animation program out there, this book is for you. With my experience training 3D animators of all ages and skill levels, I’ll transform you from a novice tinkerer into a real animator from as early as Chapter 1. Only the most basic starting familiarity with Blender is required.
Perhaps you’re already a competent Blender user who has yet to really break into animation, an experienced animator who’s looking to switch to an open source pipeline, or someone who just finished Part 1 of this book. If that sounds like you, you’ll find helpful exercises, tips, and commentary in the character animation chapters and chapters on advanced topics.
This book does not come with a computer! To follow the exercises and make your own 3D animations, you’ll need Blender, a suitable computer on which to run it, and an internet connection.
Software/hardware covered in the book
Operating system requirements
Blender
Windows, macOS, or Linux
Let’s look at this in a bit more detail.
The minimum and recommended system requirements to run Blender can be found on the official Blender website:
https://www.blender.org/download/requirements/
Nearly all new laptops and desktop computers will meet these criteria. Even if your machine is no longer the latest model, there’s a good chance it can run Blender perfectly fine as well.
If you’re shopping for a new computer or an upgrade specifically geared toward 3D animation, I recommend putting your money toward a dedicated NVIDIA or AMD graphics card. A high-performance GPU is the most crucial computer part to help ensure your animations play back smoothly in Blender.
You will also need a mouse and keyboard. Blender makes use of practically every key on your keyboard as a hotkey, so a full-size keyboard with all the functions and number pad keys will be the most helpful. As for the mouse, that’s non-negotiable. You need a mouse with a left button, a right button, and a clickable scroll wheel in the middle. A touchpad will not do!
Blender runs on Windows, macOS, and Linux. If you have a choice and you’re curious about Linux, that happens to be the best operating system for Blender. Now would be an excellent time to try it out!
Put simply, Blender has all the technical requirements of a 3D video game. If you’ve got a computer that can play the latest games, an internet connection that can download them, and a mouse that’s fast enough to beat them, you’ve probably got all the hardware you need to make 3D animations.
Though this book is written with the novice reader in mind, we’re going to skip the most elementary essentials and get straight to animating in Chapter 1. That means you’ll need some starting familiarity with Blender and computers.
You must know what a file is, because we will be saving files to folders. Later, we will need to click on those folders and find the files we saved there earlier.
You can be a Blender novice, just not a Blender never-seen-it-before. Do you know how to navigate 3D space in Blender and look at the default cube from all sides? How about selecting that cube and moving it to a different location on a particular axis? Can you delete the cube and replace it with a sphere? If these tasks don’t sound too hard, you already have what it takes to tackle this book.
Finally, you must be able to download and install Blender on your own.
Blender is free to download and easy to install. The latest version can be downloaded from the official site blender.org, but every previous version is available as well.
For this book, I recommend downloading and installing version 4.0.2 here:
https://download.blender.org/release/Blender4.0/
Download the package that matches your operating system and install it. Using this version will ensure that what you see on your screen will be consistent with the instructions and screenshots of Blender in this book.
Blender is well maintained by developers at the Blender Foundation and in the worldwide community. Though updates to the software are frequent, the foundation keeps every previous version available online. Blender’s backward/forward compatibility is quite good, so later versions of Blender, such as 4.1, 4.2, and so on, may also work with the exercises in this book. This will gradually change as time goes on.
Chapter 1, Basic Keyframes in the Timeline, to ease ourselves into the subject of keyframes, will cover how to create a rudimentary animation in Blender using the default cube and Blender’s most basic animation editor, the Timeline.
Chapter 2, The Graph Editor, discusses Blender’s graph editor, which is indispensable for creating more complex motion. To realize the usefulness and importance of this tool, we will use it to animate a bouncing ball.
Chapter 3, Bezier Keyframes, discusses Bezier keyframes. These versatile keyframes offer direct control over the shape of the F-Curve, allowing the animator to directly “draw” the animation. This will be useful for our third exercise: animating a unicycle!
Chapter 4, Looking into Object Relationships, by examining the ways objects can be parented, constrained, and driven by other objects, teaches us how objects can be made to move in precise ways without being directly animated.
Chapter 5, Rendering an Animation, discusses rendering. Your animation can’t just live inside a .blend file forever. You’ll want to render it as a sequence of still frames and export those frames to a video file that can be shared with others.
Chapter 6, Linking and Posing a Character, looks at linking and posing a character. An aspiring animator should become familiar with character animation using a professional-quality rig. In this chapter, you’ll be introduced to Rain, an excellent rig provided for free by the Blender Foundation.
Chapter 7, Basic Character Animation, discusses character animation, which requires managing hundreds or sometimes thousands of keyframes for a single scene. Two new areas in Blender are needed to do so effectively: the Dope Sheet and the Action Editor.
Chapter 8, The Walk Cycle, explores making a character walk, which is essential but tricky! We’ll have to use the tools and techniques from previous chapters with even greater care and precision. Along the way, we’ll learn some additional techniques for ensuring symmetrical animation and smooth footwork.
Chapter 9, Sound and Lip-Syncing, will guide you through the process of importing a voiceover audio file and animating Rain’s mouth to match the spoken words.
Chapter 10, Prop Interaction with Dynamic Constraints, covers proper interaction. Picking up an object and throwing it is one of many acts that are simple to do in real life but not so simple to animate. We’ll need to add our own constraints, apply their effect at precise times, and even animate their influence.
Chapter 11, F-Curve Modifiers, returns to the Graph Editor. There’s still more to the Graph Editor than meets the eye! F-Curve modifiers allow an animator to generate endless motion without endless keying! Animating a clock will be our exercise for applying this useful feature.
Chapter 12, Rigid Body Physics, explores the physics of rigid bodies. Why animate lots of objects by hand when the computer can do the work? In this chapter, we’ll animate a wrecking ball destroying a wall – a perfect opportunity to use Blender’s rigid-body simulation features.
Chapter 13, Animating with Multiple Cameras, covers various methods for using multiple camera objects in one animation. Most films and television shows are shot with more than one camera. There’s no reason 3D animation can’t be the same way.
Chapter 14, Nonlinear Animation, explores what is possibly Blender’s most mysterious and esoteric feature, the Nonlinear Animation Editor, which allows you to animate your animation.
Each chapter in this book consists of an animation exercise with guided instructions. I recommend you read it while seated at your computer and follow along in Blender! That’s the idea, anyway – maybe you’ll decide to read the chapters out of order or disobey the instructions at your own peril. It’s a book, not a schoolmaster.
The Technical requirements section in each chapter will tell you what additional things you need to follow along. Some chapters require that you download a specific file prepared specifically for this book by yours truly. Other chapters may require using an asset you created earlier, so always remember to save your work at the end of the exercise!
Finally, there is a Questions section at the end of every chapter that will challenge you on what you’ve learned. These are not ordinary quizzes! Some questions are straightforward and have answers given in the preceding pages. Other questions are intended to make you think critically or do your own exploration in Blender. A few are jokes or trick questions, but the hardest questions of all are the ones that only sound like tricks... if you can answer any of those, you get an A+.
Once you’ve read Realizing 3D Animation in Blender, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.
Thanks for purchasing this book!
Do you like to read on the go but are unable to carry your print books everywhere?
Is your eBook purchase not compatible with the device of your choice?
Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.
Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.
The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily
Follow these simple steps to get the benefits:
Scan the QR code or visit the link belowhttps://packt.link/free-ebook/9781801077217
2. Submit your proof of purchase
3. That’s it! We’ll send your free PDF and other benefits to your email directly
Math is all about numbers, modeling is all about vertices, gravel is all about very small rocks, and animation is all about keyframes. These are all boring but essential facts, which is why we begin this book with three whole chapters that – though they have different names to hold your attention – are solely about keyframes. First, we’ll learn how to create them and move them left and right. Then, in the second chapter, we’ll move them up and down, and, in the third chapter, we’ll learn what makes them move by themselves when no one is looking.
By the time we get to the fourth chapter, we will have grown so sick of keyframes we’ll want to learn how to animate using as few of them as possible. Finally, the fifth chapter is about frames, of which keyframes are not a type. What is a keyframe, you ask? Let’s not get ahead of ourselves.
If you’ve never animated anything in Blender before, this is the place to start.
This part contains the following chapters:
Chapter 1, Basic Keyframes in the TimelineChapter 2, The Graph EditorChapter 3, Bezier KeyframesChapter 4, Looking into Object RelationshipsChapter 5, Rendering an AnimationFor our first animation in Blender, we will animate the default cube. It has to be good for something! This may seem painfully boring, but we must keep things simple at first, and even simple objects can tell a story. Ours will be a 5-second epic about a young cube that ventures eastward into the unknown, then turns around, returns home, and rests in the end, wizened by many frames of traveling.
This exercise will serve as an introduction to Blender’s Timeline, as well as keyframes, the building blocks of any animation. We’ll use keyframes to determine the location, rotation, and color of the cube at various points in time.
Whereas this chapter is intended for readers with zero knowledge of Blender’s animation system, you will need to have a little experience in Blender’s basic functionality. This includes navigating the 3D Viewport, editing numeric values, and selecting and moving objects in 3D space.
In this chapter, we’re going to cover the following main topics:
Navigating the TimelineCreating simple movement with keyframesEditing keyframes in the TimelineAnimating nearly any property in BlenderTo follow along, all you will need is Blender 4.0 running on a computer that meets the minimum system requirements. Later versions of Blender will probably be suitable for this book as well, with only minor changes, though this can’t be guaranteed.
Figure 1.1: The default scene in Blender 4.0, shown here in the “Print Friendly” theme
If you have already made significant changes to your user preferences or startup file, go to File | Defaults | Load Factory Settings to restore the same environment as the one shown in Figure 1.1.
Tip
For the time being, there’s no need to click on the Animation tab at the top of the screen or to switch to any other workspace. Everything in this chapter can be done in the default Layout workspace. Remember that workspaces are just preset window configurations for your convenience. They are not essential to each task for which they are labeled. Since Blender’s interface is so flexible, I usually ignore them or make my own.
Open a new file in Blender and take a look at the numbered area at the bottom of the screen just below the 3D Viewport. This area is called the Timeline, the most basic editor for animation work:
Figure 1.2: The Timeline
The Timeline displays your keyframes and contains controls for playback and basic keyframe editing. Much of the work of animating will involve this window and/or one of Blender’s several other animation editors.
The first thing you probably learned in Blender was how to navigate the 3D Viewport, moving your viewing angle around in 3D space using the middle mouse button and various keyboard shortcuts. For the same reason that you needed to learn this before actually modeling anything, you must learn how to navigate in time before animating anything.
In the header (the part with menus) of the Timeline, you’ll see some menus, playback controls, and finally some integer properties:
Figure 1.3: From left to right – the Current Frame, Start Frame, and End Frame properties
These are the Current Frame, Start Frame, and End Frame properties of your scene. The most crucial of these properties is the Current Frame.
Current Frame is a very special property that determines the frame, or point in time, in which the scene is displayed. Just as you must view a 3D model from many different angles, as an animator, you must move through time, viewing your animated scene at many different frames as you work.
Changing the Current Frame value moves backward and forward through time in your animation. There are a variety of ways to do this:
Directly editing the Current Frame value in the header of the TimelineClicking anywhere along the Timeline’s row of frame numbersTapping the left and right arrow keys on your keyboardHolding Alt while scrolling with the mouse wheelTip
The vertical blue line in the Timeline which marks the current frame is called the playhead. Dragging the playhead left and right is a technique called scrubbing, which is indispensable for reviewing and inspecting your animation.
Give these methods a try. As you adjust the Current Frame value, the horizontal position of the playhead in the Timeline will move with it. Keep in mind that, because we have not yet animated anything, nothing else in Blender will move.
The default scene in Blender has a Start Frame value of 1 and an End Frame value of 250. This means that the animation will begin at frame 1 and end at frame 250, for a total duration of 250 frames. At the default frame rate of 24 frames per second (FPS), this will yield an animation just over 10 seconds long.
Tip
The Frame Rate setting of your animation can be found in the Dimension panel of the Output Properties in the Properties Editor. For the remainder of this book, however, we’ll stick with 24 frames per second, a nice divisible number and a rate commonly associated with a film-like or “cinematic” look.
250 frames is an awful lot for our first animation, so let’s shorten the range we have to work with. Dial down the End Frame property from 250to 120:
Figure 1.4: End Frame set to 120
This shortens the duration of the animation to 120 frames, exactly 5 seconds. Just enough time for our epic 3-part adventure!
Although we’ve set our animation to end at frame 120 and not at frame 250, the Timeline is still displaying a range of frame numbers from 0 to 250. We’re no longer interested in any frames past 120, so let’s adjust our view to use the horizontal span of this area more effectively:
Middle-click and drag rightward in the Timeline to move the frame range 0 to 120 into roughly the center of the area.Use your scroll wheel or Ctrl and middle-click to zoom in so that the Timeline displays only the desired range of interest, 0to 120.As you can see, the controls for changing the Timeline view are pretty much the same as any other area in Blender:
Figure 1.5: The Timeline, adjusted to show only frames 0 to 120
Tip
If you lose your way in the Timeline (or almost any other editor, for that matter), press the Home key or go to View | Frame All. This has the same result as what we just did, restoring the editor’s view so that all visible content is nicely centered.
In later chapters, it will be necessary to scroll around, zooming in and out at different keyframes as our animations become more complex. For the rest of this chapter, however, we can leave the Timeline view where it is.
Controls for playback and for jumping to specific frames are in the center of the Timeline header:
Figure 1.6: Timeline playback buttons
Hitting the spacebar or clicking the Play button will play your (presently very boring) animation, rapidly incrementing the Current Frame value at the established frame rate. Hitting Ctrl + Shift + Spacebar or clicking the backward Play button plays your animation backward. Until stopped, the animation will play on repeat, looping back to the Start Frame after the End Frame has been reached.
You can stop the animation immediately at the current frame by hitting the spacebar again or by pressing the Pause button in the Timeline. Hitting Esc will stop the animation and also return to the original frame at which playback began. Remember to stop the animation before attempting to edit anything.
Tip
Playing and stopping animations is such a frequent action that I almost always use keyboard shortcuts instead of clicking on these buttons. The hotkeys for playback work in every editor, so you won’t always have to have the Timeline open.
We’ve gone long enough without animating anything – let’s now make the cube move!
In the first act, our hero Cube will stride fearlessly from west to east. We’ll achieve this using keyframes, a technique inherited from the traditional hand-drawn animation process.
In hand-drawn animation, a lead animator draws the most important frames in a shot, or “keyframes,” which determine the positions and expressions of characters and objects in the shot at key points in time. These keyframes are then passed to the “in-betweener,” who draws the rest of the frames in between to create a smooth appearance of movement.
In Blender and other animation apps, keyframes play a similar, though much simpler role: determining what the value of a property will be at a given frame. It’s easier to see for yourself than read about it, so let’s jump right in!
To begin, we’ll give our main character, Cube, a suitable starting position:
Go to frame 10.Select the Cube.Move the Cube up 1 unit on the Z axis so that it rests on the “floor” in the 3D Viewport.Move the Cube-5 units leftward on the X axis.Now, let’s insert our first keyframe! With the Cube still selected and your mouse cursor in the 3D Viewport, press the I key.This brings up the Insert Keyframe menu, one of several ways to insert a location keyframe:
Figure 1.7: The Insert Keyframe menu
What you see here is a list of some (but not all) of the selected object’s properties that can be keyed. Click Location to insert a location keyframe.
Important note
From this point onward, always be aware of what you have selected and what frame you are on, especially when inserting keyframes.
We have just inserted a keyframe for the location of the Cube on frame 10. This is huge! In the future, we will insert and edit dozens of these things at once, but for the moment, let’s dwell on what has changed.
Firstly, a small diamond shape has appeared in the Timeline. If you don’t see it at first, scroll up or press Home; it might be hiding:
Figure 1.8: New keyframe on frame 10
That’s our keyframe, insofar as it exists in the Timeline. Its horizontal position marks the frame on which you have “keyed” a property of the Cube. Although you can’t see it yet in the Timeline, it also contains the X, Y, and Z values of the cube’s Location property when it was keyed.
Tip
By default, the Timeline only displays the keyframes of selected objects; they will hide when you select a different object. In later chapters, we’ll examine other editors better suited for displaying the keyframes of multiple objects at once.
Secondly, take a look at the cube’s Transform properties:
Figure 1.9: The keyed Location property
The Location values are now highlighted and distinguished by a small set of keyframe-shaped icons to the right. This indicates that they are “keyed.”
Tip
Animated properties are highlighted yellow when there is a keyframe for that property on the current frame, green on every other frame, and orange when manually changed.
Try moving the Cube again, and then change frames. The Cube will immediately “snap” back to its keyed location. The property has been “taken over” by its keyframes. From now on, any manual change you make to the cube’s location can only be temporary unless you insert another keyframe for it.
Important note
A single property cannot have two keyframes on the same frame. If you insert a keyframe where one already exists, the new keyframe will simply replace the old one.
Play the animation and look closely at what happens to the Cube. Nothing! Now, play the animation backward. What happens then? Again, nothing – but now it’s happening backward.
Our one keyframe simply determines that the Cube must be at a certain location on frame 10, but one keyframe isn’t enough to create movement. Until we add a second location keyframe, our Cube will remain at just one location – not only on frame 10 but on every other frame as well.
Let’s add that second keyframe:
Go to frame 40.Move the Cube10 units rightward on the X axis.Press I and insert another Location keyframe:Figure 1.10: The Cube on frames 10 and 40
Now, play the animation. The Cube moves! Two keyframes were all we needed to create motion. Now let’s take a closer look at what happens between those two keyframes.
Note that we never issued any “commands” to the Cube in order to make it move. We did not, for instance, encode any events like “begin moving at frame 10,” or “stop moving after frame 40.” This is a misapprehension that novice animators often have. By inserting these keyframes, we simply declared that on frame 10, the Cube shall be in one specific place, and on frame 40, it shall be in another.
Also, watch what happens to the X Location value of the Cube as you change frames:
Figure 1.11: The Location property on frame 20
Although we might say we have “animated the Cube”, it is more accurate to say that we have animated just one property of the Cube (Location), and even then, only one of the three components of that property actually changes (the X Location). For now, everything else about the Cube (for example, its Rotation and Scale) remains unaffected.
Finally, note that we didn’t need to interfere in the 29 other frames between frame 10 and frame 40 in order to make the Cube move smoothly from one place to another. Blender handled that automatically, playing the role of in-betweener for us. This is arguably the greatest advantage that digital animation offers over traditional animation.
Tip
The method by which one value transitions to another is called interpolation. We’ll explore some different interpolation modes in the next chapter.
In the second act of our epic 120-frame animation, the Cube gets homesick and turns around, in preparation for the long journey back to its birthplace. We’ll animate this part by keying not the Location property but the Rotation property.
As you might expect, we can follow the same process as before, using the Insert Keyframe (I) menu. Since you’ve already had some practice, we can cover this part more quickly:
Go to frame 45.Ensure the Cube is still selected.Press I to bring up the Insert Keyframe menu and click Rotation.Go to frame 55.Rotate the Cube180 degrees on the Z axis (clockwise or counterclockwise – your choice).Repeat step 3 to insert the second rotation keyframe.There should now appear to be four keyframes in the Timeline: two for the cube’s location and two for its rotation. For the moment, we cannot tell just from looking at the Timeline which are which but rest assured that they are distinct. We will learn how to look at their contents more closely in the next chapter.
When you playback your animation now, the Cube will move from west to east, wait 5 frames, then briskly spin around for 10 frames to face the opposite direction.
We’re ready to animate the dramatic third-act finale! Having turned its back on the frontier to the east, our hero Cube will head back home, weary from its sojourn, to rest at the very same spot where its life began.
To animate this last part, we could continue with the same technique we’ve been practicing – going to a new frame, moving the object, inserting the keyframe, and so on – but there are other ways of animating at our disposal you need to be aware of.
As it happens, the Timeline is not just a window for displaying keyframes. We can also use it to edit them! In this section, we’re going to set aside what we’ve learned about inserting new keyframes using the Insert Keyframe (I) menu and instead use the Timeline to take advantage of the ones we’ve already made.
How does one edit keyframes? Here are the only actions you need to know for now:
To select a keyframe in the Timeline, click on it using whichever mouse button you’ve been using to select things. Hold Shift and click to select multiple keyframes.Use Grab (G) to move selected keyframes through time. You can also click and drag keyframes using the same mouse button you use for selecting.To duplicate keyframes, use Duplicate (Shift + D). Duplicated keyframes will be “stuck” to your cursor as if you had used Grab (G) on them.If you’re thinking this is just a list of controls you already know about, you’re absolutely right! If you know how to select, move, and duplicate objects in the 3D Viewport, then you already know how to select, move, and duplicate keyframes in the Timeline. The controls are exactly the same.
This is the case for many other operations and control schemes. If it works in the 3D Viewport, chances are it will work in the Timeline and other animation editors.
Tip
Selected keyframes are highlighted in yellow. Newly inserted keyframes will be automatically selected. Before doing things like duplicating keyframes, make sure there aren’t any unwanted keyframes in your selection. You can quickly make a mess of things by operating on more keyframes than you mean to!
A common use for editing keyframes directly is to duplicate certain segments of an animation to save time. To make the Cube return to its original location, we don’t have to move it back ourselves; all we need to do is duplicate one of the keyframes we made earlier:
Select the keyframe we created on frame 10.Press Shift + D to duplicate it.Move the duplicate keyframe to frame 90.Tip
The control schemes for editing keyframes are really quite similar to the ones you’re used to in Blender’s 3D Viewport. For instance: in step 3 here, you can enter the value 80, moving the duplicated keyframe exactly 80 frames from frame 10 to frame 90.
We’ve keyed the Cube’s final resting place! Now, it will be in the same location on frame 90 as it was on frame 10, but now our animation looks a little strange...
Watch how the Cube moves back to its starting point. How slow and clumsy looking! Right after frame 40, it begins to move westward; it doesn’t even get the chance to turn around before doing so.
This is a frequent mistake and/or a sign of an incomplete animation. The last location keyframe we made was on frame 40. Then, we put the next one all the way over on frame 90 without considering how that would affect everything prior.
After frame 40, we want the Cube to hold still for a bit like it was doing before. This does not require any special “hold-still-type” keyframe. Instead, all we need to do is duplicate the other location keyframe from frame 40:
Select the Cube object’s location keyframe on frame 40.Press Shift + D to duplicate it.Move the duplicate keyframe to frame 60.Now that there is a location keyframe on frame 60 identical to the one on frame 40, there will be no change in location between those frames. Because we only edited location keyframes, the animation of the cube’s rotation was not affected:
Figure 1.12: The Timeline with six keyframes
Inserting keyframes according to these step-by-step instructions might have given you the impression that we’re supposed to know ahead of time when and where to insert keyframes. On the contrary – animators rarely insert all their keyframes on the right frame on the very first try. When animating on your own, you will assuredly need to adjust the timing of keyframes after they have been added.
Take our current animation, for example. After the last keyframe on frame 90, we’ve still got 30 motionless frames before the scene ends. Why not slow things down and give our animation a little more breathing room so that we can use the full duration of our scene’s frame range?
This next step will be more open-ended so that you can experiment and see how different placements of keyframes affect the animated result:
Go to any frame between the first and last keyframes.Select only the keyframes that come after the Current Frame.Grab the selected keyframes and move them 20 frames to the right.Tip
Try hitting ] (the closing bracket key) for step 2. Respectively, [ and ] are the shortcuts for Before Current Frame and After Current Frame, which are helpful for quickly selecting all keyframes that come either before or after the current frame.
If you haven’t figured it out already, moving keyframes to the right delays them, widening the gap in time between those keyframes and keyframes left behind, and slowing down a part of the animation. Which part of the animation will be slowed down depends on where that extra gap between keyframes was made.
For example, moving the last two keyframes makes the Cube seem to hesitate before its return to the west:
Figure 1.13: The Timeline with the last two keyframes moved
Moving the last three keyframes makes the cube’s 180° rotation take longer:
Figure 1.14: The Timeline with the last three keyframes moved
Also, moving all but the first keyframe makes the cube’s initial embarkation a bit slower than its return trip:
Figure 1.15: The Timeline with the last five keyframes moved
Without changing the order of these keyframes, feel free to continue experimenting with their timing.
Having finished giving movement to the Cube, we’re nearly done with this chapter! We’ve brought a life of adventure to a simple object by causing just two of its properties to change over time.
The three spatial properties of a 3D object – location, rotation, and scale – might be the three most common properties you’ll typically work with, in a 3D animation, but that’s not all there is to animation. As we’ll see in the next section, keyframes can be used to affect almost any property.
Our odyssey concludes with the main character at rest, finally home from its harrowing adventure abroad. Is our hero triumphant, or sorrowful and full of regret? Hard to say (it’s a cube), but one thing’s for sure: things will never be the same again. Is it the world that has changed? Quite the contrary; no hero’s journey is complete unless it is the hero who is changed by the world. One cube leaves, and a different cube (metaphorically speaking) returns.
In this section, we’ll key one more property of the Cube, its color, to demonstrate how almost anything in Blender can be animated.
So far, we’ve been using the Insert Keyframe menu to insert our initial keyframes, but this menu is purely a convenience, not a complete list of every keyable property in Blender. For one thing, it doesn’t contain Color.
Fortunately, we don’t need that menu. When you find a property you want to animate, Blender’s interface offers a number of ways to key it right there on the spot:
Right-click on the property and click Insert Keyframe from the context menu.Hover the mouse cursor directly over the property and press I.Click on the small dot to the right of the property (note that this dot is just for one-click convenience; a property without one may still be keyable).Each of these methods accomplishes exactly the same result.
Tip
For every method that inserts a keyframe, you’ll find a similar way to delete it. Try pressing Alt + I instead of I, for example.
Let’s try out keying the color of the Cube:
Select the Cube and go to Material Properties to edit the cube’s default material, Material.Find the Base Color property:Figure 1.16: The Base Color property
Go to frame 1.Pick any color you like for the starting Base Color.Key the Base Color using any one of the methods mentioned earlier.Go to frame 120.Pick a different color for the ending Base Color.Key the Base Coloronce more.Switch the Viewport Shading mode to Rendered or Material Preview to see the result in the 3D Viewport:Figure 1.17: Viewport Shading set to Material Preview mode
In addition to moving, the Cube will now gradually change from one color to another over the course of its journey. Personally, I’ve made mine change from a cheery green to a deep and woeful purple:
Figure 1.18: The Cube on frames 1 and 120
Tip
Numeric values aren’t the only type of property that can be keyed. Checkboxes and on/off buttons, otherwise known as Boolean properties, can be keyed to turn on and off as well. Among other things, this can be helpful for making objects appear and disappear.
If you’ve made it this far, congratulations – you’re an animator. Surprised? You shouldn’t be – an animator is someone who makes animations, and what did you just do? With just the Timeline, the default cube, and fewer than a dozen keyframes, you animated an epic adventure!
Alright, I’ll admit it – maybe our first animation wasn’t that epic, but it was important! We took something boring and found the potential in it for something exciting. Sure, a cube is just a mesh with some faces and vertices, but then so are the characters and objects in your favorite 3D animated film. And all those fancy characters and objects were brought to life with a bunch of keyframes like the ones you just made.
The only difference? Mainly the amount of keyframes. We’re going to need a lot more keyframes in the future. We’ll also need to know a bit more about the true nature of those keyframes, which, for the sake of brevity in this chapter, has been kept secret. The Timeline, as it happens, is not the ideal tool for advanced keyframe editing. In the next chapter, we’re going to need a completely different editor to crack those keyframes open and poke around inside...
In the previous chapter, we created a rudimentary animation while limiting our keyframe editing to Blender’s Timeline. While this was necessary to keep things simple at first, we concealed some important animation workflows for the sake of brevity. For most animations, using only the Timeline would be very frustrating!
The next most important tool for 3D animation in Blender is the Graph Editor. In addition to doing almost anything the Timeline can do, the Graph Editor displays both the time and value of keyframes, along with the resulting animated property they affect, on a 2D graph.
To learn about the Graph Editor and what makes it so useful, we’ll put it to practice in this chapter by animating one of the most popular case studies in the animation industry – a bouncing ball.
For nearly a hundred years, the bouncing ball has been a well-known learning exercise in both 2D and 3D animation. If we want our bouncing ball to look realistic, we’ll need to pay close attention to its velocity and acceleration – things for which the Graph Editor is an indispensable tool.
In this chapter, we’re going to cover the following main topics:
Animating a rolling ballNavigating the Graph EditorSetting interpolation and easing typesAnimating a bouncing motionSetting extrapolation modesTo follow along with this chapter, you’ll need Blender, along with a suitable model of a regulation-sized football (otherwise known as a soccer ball).
You can download such a model here:
https://github.com/PacktPublishing/Realizing-3D-Animation-in-Blender
You can open the downloaded file and immediately begin working, or you can model your own football if you prefer:
Figure 2.1: Left – the football model, and right – an acceptable ball that I modeled in one minute
Any sphere will do, as long as it is 0.7 meters in diameter, rests on the grid floor of the scene, and is multicolored so that you can easily see it roll.
Before we get into the Graph Editor, we’ll need to insert some initial keyframes as we did in the previous chapter. As a general rule, it’s better to block out the most important positions of an object before adding details, so our first two keyframes will simply make the ball roll from left to right.
Rolling is just rotation in perfect sync with location. All we need to do is key the location and rotation of the ball on the same frames, making sure that we rotate the ball according to a precise mathematical formula based on how far it moves. After we get the ball rolling, we’ll use the Graph Editor to make it bounce.
Let’s key the initial placement of the ball. To save time, we can key the location and rotation of the ball at once:
Go to frame 10.Select the ball and move it -5 units leftward on the X axis.Press I to bring up the Insert Keyframe menu and choose Location & Rotation.This inserts both rotation and location keyframes without requiring us to bring up the menu twice.
Next, let’s get ready to insert a second set of location and rotation keyframes:
Go to frame 90.Move the ball 10 units rightward on the X axis.Now that we’ve determined how far the ball will move in the span of 80 frames, we just need to figure out how much it should rotate in order to roll realistically. If we key too much or too little rotation, the ball will appear to slide along the ground.
So, how many degrees should we rotate the ball, and on what axis? Although there are some nice formulas to figure this out, that’s a bit advanced for this chapter. For now, let’s cheat a little and just enter some magic numbers:
Rotate the ball 1164 degrees on the Y axis.Insert location and rotation keyframes, as we did in step 3.When you play your animation, the ball should now roll smoothly from left to right without appearing to slide or skid. This simple motion will accompany the bouncing keyframes that we will add later.
While following along with the previous chapter, you may have wondered how an animator is supposed to recognize all those identical-looking keyframes in the timeline. Do we always have to remember which ones are for location and which ones are for rotation? What if the rotation and location keyframes exist on the same frame, as they do in our present animation? How can you edit them separately?
For that matter, how can you discern any of the values inside a keyframe? In the Timeline, a keyframe that makes something move a few inches down looks no different from one that takes it a hundred miles up into outer space.
The Timeline, then, is an insufficient tool to edit an entire animation. That’s where tools such as the Graph Editor come in.
One convenient way to get to the Graph Editor is to use the interface area where the Timeline currently is. The Graph editor will need more vertical space than the Timeline to be useful, so we just need to drag up the border between the Timeline and the 3D Viewport in order to make the area taller. After that, it’s easy to switch out the Timeline for the Graph Editor:
Find the border between the 3D Viewport and the Timeline (your cursor will change to arrows when you hover the mouse over it).Drag the border upward, resizing the lower area to roughly half the height of the whole screen.Use Ctrl + Tab or the Editor Type menu to switch the area to the Graph Editor.Now we’re ready to begin working in the Graph Editor!
Figure 2.2: The user interface with the Graph Editor
This editor displays animated properties as lines in a 2D graph and displays keyframes as points along those lines, allowing you to intuitively edit both the timing and value of keyframes.
Important note
Like the Timeline, the Graph Editor’s default setting is to only display the keyframes of selected objects. Make sure the ball is selected or the Graph Editor will appear blank.
This editor can be perplexing for those who’ve never seen it before, so let’s take a moment to consider just what we’re looking at.
Tip
In my examples, I’ve disabled View | Show Cursor to stop displaying an additional horizontal line in the Graph Editor, which is of limited usefulness.
Keyframes in the Timeline can only be moved left and right – that is, backward and forward through time. Whereas this makes the Timeline essentially a one-dimensional editor, you can think of the Graph Editor as a two-dimensional Timeline.
Just like in the Timeline, you’ll see a row of frame numbers along the top of the Graph Editor, which – just like in the Timeline – may also be clicked on to scrub and move through time. Moving keyframes left and right along the X axis in the Graph Editor moves them backward and forward in time, just like in the Timeline. We can take it for granted, then, that the X axis in the Graph Editor represents time in frames... just like in the Timeline.
Unlike the Timeline, however, we now have a vertical axis, along which keyframes may be moved up and down. This Y axis represents the numeric value of each individual property. Depending on the property, this can be any kind of unit – meters, degrees, watts, whatever. If it’s animated, the Graph Editor will display it.
Important note
Don’t confuse the X and Y axes in the Graph Editor with the X, Y, and Z axes in the 3D Viewport. Properties of 3D objects such as Location, Rotation, and Scale all have X, Y, and Z components that relate to the X, Y, and Z axes in your 3D scene, respectively. When viewed in the Graph Editor, however, these components are all just numbers that map to the same Y axis like everything else.
Take a look at the red line in your Graph Editor that curves smoothly upward from left to right. By examining this curve against the numbers indicated on the X and Y axes, you might be able to guess which animated property it represents. What about the other lines? Don’t worry if you aren’t certain; we’re about to take the guesswork out of which lines represent which properties.
On the left side of the Graph Editor, you’ll see a panel with three nested lists:
Figure 2.3: Fields for the object, action, and channel group
The Ball object contains the BallAction action, which in turn contains the Object Transformschannel group.
Click the small triangle to the left of the Object Transforms