editors note: Blender is a wonderful open source (free) software package that lets you draw objects, animate them, and create very realistic views. This is done by defining surface properties, and the software calculates how light would reflect from it. The software is used by many animation studios and professional graphic artists. It is available from http://www.blender.org
Here is part 3 of my overview of animating in Blender.
In this final section, I'll discuss topics related to the actual animation. Parts 1 and 2 involve modeling, materials, and lighting. All of which are necessary to render a still scene. If you want to create an animation, you will have to do a bit of planning and know how to use keyframes.
Before you do any work with keyframes, you need to decide how long your animation is going to be as well as the framerate you would like to use. If things aren’t moving around too quickly, 30 frames per second should be okay. 30 fps is considered the standard minimum in video game development for things to look smooth to a user. However, if you have objects moving large distances between frames, it can cause noticeable choppiness in the final animation. In such a case you’ll need to increase the framerate or think about having objects move smaller distances between frames. The title image is a .gif that was supposed to go at 20 fps which is almost enough to eliminate choppiness. As it turns out, uploading .gifs to this site only displays the first frame. Oh well. Here's a youtube link in case you're curious as to what it looks like.
For this part of my Blender overview, I decided to make a 2 second animation of the “Brain Smasher.” This is a device that the Tech Toybox uses for projects related to head trauma measurement. You may note that there is in fact a monkey head, named Suzanne, instead of a brain. Suzanne is a quick-test model built into Blender (maybe the Hello World of Blender?) and I, lazily, decided to use her head instead of modelling an actual brain. I wanted this animation to look really nice (youtube really diminished the quality of the video for reasons unknown to me) so I chose to use 60 fps which means Blender will be rendering 2x60=120 frames. It is important to know exactly how many frames you want heading into assigning keyframes because it can be a huge pain if you decide to change the framerate later.
At this point, a novice user might be wondering “what is a keyframe?” A keyframe is a value that you set for an object at a specific frame. This might be the object’s location, rotation, scale, or a combination of two or all three. For the Brain Smasher animation, the only thing I wanted to be moving was the rotating upper part of the frame. Therefore, all I had to do was to set the object’s rotation at a few frames and Blender did the rest.
To set a keyframe, you must have a 3D view open such as in the picture below. It’s a very simple matter:
1. Use the timeline editor to navigate to the desired frame. You’ll want to set a starting point for the properties for which you are going to set keyframes. Frame 1 is a good place to start!
2. Under Keyframes (red box in the picture below), click on “Insert” and select Location, Rotation, Scale, or a combination depending on the properties you want to set. Combination keyframes are abbreviated/concatenated so LocRot sets Location and Rotation values for a frame. After inserting a keyframe, the properties in the Transform pane for the object should be highlighted with yellow such as the Rotation property within the green box in the below picture.
3. Now you’ll want to figure out where to insert the next keyframe. I found that the easiest way to do this was by clicking on the timeline at the desired frame. For the Brain smasher, I wanted the upper part of the frame to rotate a full 360 degrees in 2 seconds so I put a rotation keyframe at frame 60 that sets the frame’s Z rotation to 180 degrees and one at frame 120 that sets it to 360 degrees. Each keyframe for an object will show a yellow bar in the timeline after it has been set. Clicking on this bar will allow you to alter that keyframe’s settings if needed.
You might notice that the above picture actually has more keyframes than I said I had set. This is because I didn’t know about how to change the interpolation method, which I just learned about while writing this, hah. By default, the interpolation mode is set to “bezier.” This typically gives objects smoother transitions between keyframes. However, I wanted the rotation to be constant, so I should have set the interpolation mode to “linear.” To do this, change to a “Graph Editor” pane and select Key>Interpolation mode>linear. The picture below shows a graph of Z rotation vs. frame number. It is fairly straight due to an excess of keyframes but the beginning and end of the Z rotation plot is noticeably curved. This causes the upper frame of the Brain Smasher to appear to speed up and slow down instead of rotating at a constant pace. Changing from bezier to linear causes the Z rotation plot to go from curved to linear, yielding constant rotation of the Brain Smasher frame.
Camera Movement and Rendering
In the Brain Smasher animation, the camera doesn’t move at all. In the GTEC animation, the camera is flying around throughout the entire 13 seconds. This is accomplished by setting keyframes for the location and rotation of the camera. Things can become quite tricky when you have both the camera and objects moving. I needed to keep all of the falling equipment in view of the camera so I decided to set the camera’s movement first and then sync the motion of the equipment afterwards.
The best way I found to move the camera around was using “fly mode.” Fly mode allows you to navigate the camera around your scene as if you’re flying a plane. To use fly mode, enter camera view (numpad 0) and press shift+F. Moving the cursor around pans the camera and with the mouse wheel, you can make the camera fly forward or backward. To stop all movement, simply left click anywhere inside the 3D view. I would use this method to place the camera where I wanted, then insert a keyframe, and repeat until the camera’s movement was fully mapped.
To coordinate the falling equipment with the camera, I would place the camera such that the object was centered and then set a keyframe for the object’s location. Then, I would back up 5-6 frames and move the object above the room’s ceiling and set another location keyframe. It can be a bit tedious but it gets easier with practice.
Finally, I’ll leave a few thoughts about rendering in Blender. The rate at which you render frames is limited by your computing power. Major animation companies have rendering farms which are arrays of CPUs that are coordinated such that they can produce extremely high quality frames without having to wait years. Assuming you don’t have a render farm, you’ll have to worry about balancing quality vs. render time. I found it best to render a frame or two with a given setting to get an idea of how long each frame would take to render. So, if I need to render 300 frames in 2 days, I want to make sure it takes less than 48 hours/300 frames = 0.16 hours/frame (so ~10 minutes/frame). The main parameters affecting render time are the render Resolution and Samples. These are set under the render tab in the “Properties” pane shown below in orange and green boxes. Typically, sampling over 1000 times will give you a high quality render and your resolution will depend on the application.
One last warning: make sure that you don’t overwrite your frames! I lost about 60 frames (24 hours of render time) by accidentally starting a render without moving the good frames out of my output folder. To avoid this, always use a different output folder or move your good frames to a new folder after each render.
Well that’s about it! I hope that I was clear enough and that you gained something from this overview. I’m happy to answer any questions or comments in the comment section below or at Jake@fltechtoybox.org