fbpx

6.1 – Animation – Keyframes & Graph Editor

Animation is certainly the ideal field of application and the most interesting one for 3D software. As a result, Blender has all the necessary tools to animate every single element of our virtual scenes. The topic of Animation is quite vast and would deserve a treatment in a volume of its own, especially considering that the open movies of the Blender Animation Studio (works entirely made with Blender) show that it is possible to achieve a cinematic quality. In this chapter, you will find the main features of animation described, with which you can start experimenting right away. Blender has several windows related to animation that we can gather and organize in a single workspace. The most important ones are the Dope Sheet (at the bottom) and the Graph Editor to the left (not included by default in the Animation workspace). In the image, you can see how these windows look when working on a rather consistent animation project. As usual, let’s not be intimidated by what at first might seem complex and start from the basic concepts. All the topics so far presented have concerned the composition of static scenes, where practically nothing happens, like in a snapshot. To create movements and make the scene dynamic, we must decide what should change within certain intervals of frames, with the additional possibility of relying on the laws of physics (Chapter 7). For now, let’s focus on the use of so-called keyframes and the interpolation methods of Blender. Let’s start with the default cube scene, adopting the classic Layout workspace for now (we will later switch to the Animation workspace). At the bottom, in the timeline, we find the range of active frames in a light gray area, while the frames outside the range are in dark gray. The range is fixed by the Start and End values the number on the left indicates the frame on which the cursor is placed, represented in the timeline by a blue vertical line. We can move the cursor simply by clicking on the frame number with the left mouse button and then holding down to scroll the cursor itself along the timeline.

The fundamental factor in creating animations is the choice of frame rate, that is, the number of frames displayed in a second of animation. This number is found in the Output context of the properties. Typical values are 25-30 frames per second. The higher the number of frames, the better the fluidity of the animation, which will however be rendered in a longer time. By default, the number of frames per second is set to 24, a value that we can leave unchanged for all initial experiments. Returning to our scene, let’s select the cube and click the button on the left of the timeline header. Immediately above the button the menu will appear.

By clicking on the area under the wording Active Keying Set, next to the icons in the shape of keys, a further list will appear with various items that we can scroll with the mouse wheel

If we select Location and click the + button, we will add a keyframe at the point of the timeline where the cursor is located and related to the position of the cube in space at that moment. In doing so, we will have actually added a keyframe for each of the three coordinates of the cube (those of its origin). In fact, if we go to the sidebar of the 3D View (N key), we will see that the coordinates of the cube (placed exactly at the origin of the default scene’s coordinate system 0,0,0) will all be yellow, which is the color that in Blender will highlight any parameter set through a keyframe at a specific frame.

By selecting an object for which keyframes have been set, we will see orange diamonds (if selected) or white diamonds (if not selected) appear in the timeline corresponding to each of them.

We will understand their use better in the Dope Sheet window (very similar to the timeline and where circles will replace the diamonds). What does setting a keyframe location for an object at a certain moment mean? It means that it will be constrained to be in that position at that moment. In the absence of another keyframe of the same nature, preceding or subsequent, which puts the object in another position, it will remain fixed for the duration of the animation. For example, try moving to a different frame from the keyframe and translate the cube in any direction, then click again in a random point on the timeline to see the cube automatically return to the position fixed by the keyframe. The only way to change the position of the cube will be to set a different keyframe location at a different moment in the animation, in which case we will see the cube move in the time interval between the two keyframes; or alternatively, parenting the object to a moving parent. We can control the animation with the commands in the center of the timeline header

  • The single arrow pointing to the right will be the play (space bar); starting the animation will disappear showing the stop.
  • The single arrow pointing to the left will show the animation in reverse.
  • The arrow pointing to the right with a diamond will move the cursor to the next keyframe.
  • The arrow pointing to the left with a diamond will move the cursor to the previous keyframe.
  • The arrow to the right with a vertical bar will move the cursor to the last frame of the range.
  • The arrow to the left with a vertical bar will move the cursor to the first frame of the range.

Let’s see what happens in the DopeSheet window with the introduction of two Location keyframes; here we also find a blue vertical line indicating the current frame displayed in the 3D View.

In the summary on the left, we notice that a Action called CubeAction, concerning the transformation obtained through keyframes, has been associated with the cube, in this case of type Location. The Dopesheet Summary therefore has a hierarchical structure that shows the objects in the scene and the list of actions applied to them. On the right, we will see circles (orange if selected, or white) that indicate the position along the timeline of the keyframes. Clicking on the arrow next to Object Transforms will display the details of the action concerning our cube: X Y and Z Location. In the Dope Sheet window, you can move and act on the elements present in the usual way, that is:

  • Expand the view (narrowing the time scale) by scrolling the mouse wheel up.
  • Zoom in (enlarging the time scale) by scrolling the mouse wheel down.
  • Pan the entire panel by pressing the mouse wheel and moving the mouse.

It is possible to work on individual keyframes with:

  • Right click on a keyframe (circle) to select it. Along with it, all the circles of the higher and lower hierarchy will also be highlighted in orange (but not those of the same level unless they are also selected while holding down the Shift key).
  • Button A selects everything (two quick presses to deselect).
  • Button B starts a keyframe selection through a rectangular area to be defined with the mouse.
  • Button X deletes selected keyframes.
  • Button G moves keyframes selected along the timeline.
  • Shift-D duplicate and move selected keyframes.

Finally, you can view the graphical representation of the path of an animated object in the Viewport by going to the Motion Paths panel, under the Object context . Here, simply click to make the path appear in the 3D view (the same button will change to Update Path to update after any changes). The white points represent individual frames and become orange at key frames with the corresponding frame number.

In the translation of the cube from one point to another in space, we can observe that this movement occurs at a non-constant speed; in fact, from the initial acceleration phase, the cube passes to a subsequent stretch at almost constant speed, and finally reaches the final deceleration. This happens because by default Blender modifies the values set between two keyframes by interpolating them in a non-linear way, as visible in the Graph Editor window.

On the left side of the window is the list of actions, similar to what is seen in the Dopesheet, with the additional ability to make the curves invisible by clicking on the eye marked with the same color as the curve. In this window, in addition to the time scale axis (x-axis), we find a vertical scale corresponding to the numerical value of the parameter set with the keyframe (in our example, the value of the coordinates). In this case, having translated the object along the y-axis, the curves relative to the x and z coordinates will be two flat and constant lines, while the other will have the shape of the interpolation applied by Blender, which by default is of type bézier; you will recognize the handles located to the right and left of the control points of the curve that coincide with the keyframes. The curve represents how the value set in a keyframe will turn into a number N of frames until the value set in the next keyframe (that is, in a time equal to N/FPS seconds, where fps is the frame rate set for the animation). From the shape of this curve, you will understand the behavior seen in the translation of the cube: we find a first part where the slope of the curve rises slowly (acceleration) until it reaches an almost linear trend (constant speed) and then converges to the final value in a deceleration. This interpolation is set by default to avoid unrealistic discontinuities in the motion of objects, without having to resort to the use of a physics engine.

Let’s try now to act on the handles of the control points to change the shape of the curve and check the effect on the animation:

this curve imposes a movement that, instead of starting at zero speed, will do so with high speed (slope of the curve) and then slow down until the values (of the coordinates) reach those set in the second keyframe. In this way, we have not modified the position of the keyframes, nor altered the values set by these keyframes, because through the curves of the Graph Editor, called F-Curves, we are also free to change the position of the keyframes and the values of these, acting on the control points of the bézier curve, for which the following commands apply:

  • Pressing the G key will allow you to move them freely, modifying both the position of the keyframe in the timeline and the value set in the keyframe.
  • Pressing the G+X key will modify only the position of the keyframe in the timeline.
  • Pressing the G+Y key will modify only the value set with the keyframe (for example, a smaller or larger displacement).
  • Pressing the Shift-D key will duplicate the control point/keyframe.
  • Pressing the X key will delete a keyframe.
  • Pressing the I key will insert a new keyframe and a new control point of the bézier curve.

From the Key > Handle Type menu in the graph editor header, you can decide the behavior of the handles, as seen in paragraph 2.4.

In the menus located in the Graph Editor header we find many other important options, some of which we will use in the usual sidebar (N key)

After clicking on a control point of the F-Curve, you can change the type of interpolation, and therefore the shape of the curve, until the next control point, by going to the Active Keyframe panel in the F-Curve tab and choosing between: Bézier interpolation, Linear or Constant, options located in a window that will also appear on the screen when pressing the T key.

Linear interpolation is useful, for example, in the trivial case of animating an object that rotates 360 degrees around the vertical axis. The resulting animation can therefore be performed in continuous loop.

In addition to Location keyframes, it is possible to set Rotation and Scaling keyframes, as well as various combinations of them:

  • Location & Rotation
  • Location & Scale
  • Rotation & Scale
  • Location, Rotation & Scale

Let’s try to create the example mentioned above of a full rotation around an axis. Select the default scene cube and set a Rotation keyframe for it in the first frame of the animation. In the Transform panel of the sidebar in the 3D View, after moving to the last frame of the range, add 360 to the value in Rotation (Z axis; if it is 0, you just need to enter 360) and create a new Rotation keyframe.

The green background color reminds you that at least one keyframe has already been set at another time. When you start the animation, you will see that the object’s rotation will start slowly, reach its maximum speed halfway through the time, and then slow down progressively until it reaches the initial position. In the Graph Editor, select the first control point and change the interpolation to linear: each time you restart the animation, you will notice a moment of stasis due to the fact that in a loop of this kind, the rotation should not be fixed in the last frame at: <starting value> + 360°, as we have just done, but something less than 360°. Considering N the number of frames in which the rotation takes place, we calculate the value: R° = 360°-(360°/N). This will be the exact value (slightly less than 360) to be fixed with the second rotation keyframe, which will give a fluid loop rotation animation and free of the stasis moment.

With Constant interpolation, the parameter conditioned by keyframes will jump discontinuously from one value to another.

In addition to these main interpolations, there are others divided into the categories: Easing and Dynamic Effects that can be useful in different cases. The Easing interpolations are already clear from the icons that illustrate their progress; the Dynamic Effects are used to emulate a physical dynamics without having to resort to a rigorous calculation of motion as we will see in the next chapter; more specifically, with them it is possible to obtain a slight excess of the numerical value set in the keyframe (such as inertia) with a subsequent return back. So we can also simulate a bounce or an elastic vibration.

Before discussing the other possibilities offered by the graph editor and F-Curves, it is important to understand the extent of the effects that can be obtained by using keyframes, which allow us to animate almost any parameter in Blender. Let’s take the Metallic parameter of any material as an example. In the Principled node of the Shader Editor (or in the Material context panel in the properties), right click on to display the following menu.

As you can see, the first option, “Insert Keyframe,” is the one we are interested in. After assigning a keyframe to the Metallic parameter, it will become the characteristic yellow color; then, by right-clicking on Metallic again in the same keyframe, we will have two different options related to the keyframe: “Replace” (if we want to change the value) and “Delete” to delete the keyframe. After setting the starting keyframe with Metallic equal to 0, we increase its value to 1 in another keyframe. All objects with this material will become Glossy during the animation time between the two keyframes, and this will happen according to the interpolation curve seen in the Graph Editor. It is not only possible to apply keyframes to parameters such as the Metallic value; we could, for example, decide to activate an entire panel such as the shadows of any light object (eevee) simply by applying the keyframe to the checkbox (either active or inactive). Or we can apply a keyframe to the icons in the outliner to make an entire object visible or invisible at any frame of the rendered animation. The possibilities for animation are practically infinite; we can change the shaders of the material and the properties of any texture, or animate a lattice to observe an animated deformation of a mesh, etc. In Blender, anything can be animated.

In rendering the frames of any animation, you can make the movement of objects more fluid and realistic by simulating the optical effect of Motion Blur, with which moving parts will appear blurred in proportion to their speed. Motion blur is available for both Eevee and Cycles. Let’s go to the Render properties context for Cycles, where we will find the following panel:

Increasing the Shutter value will mix together frames that are increasingly “far” apart in time. Motion blur is also useful for simulating the blurry effect of photography (which results from using longer exposure times). An example can be found on the cover of this guide.

Next paragraph
Previous paragraph
Back to Index


Wishing you an enjoyable and productive study with Blender, I would like to remind you that you can support this project in two ways: by making a small donation through PayPal or by purchasing the professionally formatted and optimized for tablet viewing PDF version on Lulu.com  



>Purchase the ebook (PDF) on Lulu.com securely using PayPal and prepaid cards<