Almost every computer graphics application includes some form of a feature that allows creating animation. Most of them use the concepts invented by the first creators of "cartoons" drawn on paper and adapted to computers as time went on. Blender isn't too different in this regard. Nevertheless, 3D animation includes some extra concepts not present in 2D, such as: skeletons and IK (very rarely present in 2D), objects constraints in 3D using special rules and most of all advanced physics engines operating in a 3D environment. This exercise, just like the previous, will demonstrate only the basics, but it will also contain references to more information about animation in 3D graphics.
The simplest form of animation available in most graphic suites is through the concept of "keyframes". This idea stems from the early days of paper and cel animation. There you would initially design they most important, or "key" frames and then fill the rest in such a way to make the whole motion as realistic as possible.
Computers made the whole process considerably simpler, since they allowed for generating most of the non-key frames completely automatically. Another difference was that (especially in 3D animation) we generally tend to manipulate actual objects (ie. vectors), rather than redraw each frame from scratch.
In Blender we can "key" almost any value in the program. The keyboard shortcut I (capital letter i, not L!) lets us add a "key" for a given value in the current frame of animation. It is often sufficient to simply hover the mouse over a value in the program and press I, which will allow us to animate it in time (some values, e.g. resolution, cannot be animated, for obvious reasons).
One of the basic uses of animation in Blender is to control the camera. Even if we have a static model in 3D (eg. a monument or a piece of architecture), adding camera animation can greatly improve the attractiveness of the work and increase its realism. Let us therefore start with a simple scene:
Now select the camera (eg. from the object tree, top right corner of the window) and enter the camera view (by pressing 0 on the numeric keypad). We want to make a flyby with the camera over the top surface of the cube. Let's start with positioning the camera at a certain distance from the cube (as a reminder, this is easiest to achieve by pressing SHIFT-F followed by using the mouse and the A,W,S,D,Q,E keys). After positioning the camera, make sure you are located in the first frame of the animation. Look at the timeline at the bottom of the screen and make sure the time cursor is all the way on the left. You can also use the shortcut SHIFT-← (shift followed by the left arrow) to rewind the animation. Now move the mouse cursor over the 3D view and press I on the keyboard. A menu will appear with a list of items you can create keys for. Since we are only going to change the location and rotation of the camera, simply choose LocRot from that list.
We have thus set the first key frame of our animation. Now move the time cursor to the frame #100 and move the camera to its next position - preferably somewhere close to the cube. Press I again (remember to keep the mouse over the 3D view when you do that) and set the next LocRot key frame. Move to frame #150 and change the camera to yet another location - on the other side of the cube but still pointing towards it and add another key frame. Finally, change the frame to #250, move away from the cube a little bit and and add the last key frame. Playing it back, you should see something like this:
To play it back, you need to rewind the animation (SHIFT-←) and press the play button (or the keyboard shortcut ALT-A).
By clicking on the little clock icon in the lower left side of the timeline, you can change the view to the Graph Editor. This is an alternative method for viewing and editing the key frames. If you want, you can use this view to fine tune your camera motion.
A simple way to add motion is to move an object along a path. This can be done using keying and the graph editor, but there is a simpler way. Lets start by drawing a curve:
Later you can come back and fix some of the points you created earlier and even delete them with the X key. The final curve should look something like this:
Now let's add an object that moves along this curve:
You can play the animation now and observe the motion of the mesh along the curve. Let us combine it with the rest of the scene now:
After playing, the scene should look like this:
Blender contains a pretty advanced physics engine called Bullet, which can be used also outside of Blender (available as an SDK in many languages). In Blender, we can perform all sorts of different physics simulations like, rigid body, soft body, cloth, liquid, smoke and fire, etc. Some of them are more complicated than others. For example, liquids are fairly easy to create in a basic form, but very difficult to make it look perfect and also requires a lot of processing power. Smoke and fire are types of effects that are difficult to capture on a camera in real life, let alone Blender. For this lesson, we will demonstrate two simplest types of physics simulations.
Rigid body is the simplest (and oldest) form of physics simulation you can do in Blender. Rigid bodies are divided into two categories:
There is also a third type - objects not being part of the simulation at all. They can be rendered and visible, but all rigid bodies will completely ignore them. Let's start by modifying our scene slightly:
If you rewind the animation (SHIFT-← ) and play it back (ALT-A) you will notice that the object is falling according to the laws of physics. What's neat is that you can also duplicate it as much as you want (SHIFT-D - the animation below has about 30 objects) and all of them will behave the same way:
Rigid Body simulations are very interesting and can be used to achieve a lot of cool effects. A common demonstration are demolishing constructions (e.g. buildings, bridges). This can be improved by adding various constraints between objects - solid, breaking and even springs. Another nice example are chains: with a little bit of work, you can use this method to create a simulation of a whole chain or even chain mail armor. The final neat example are various clock mechanisms and Rube Goldberg machines: if we create a models of gears of specific shapes and sized, they should behave like actual, real-life objects. Of course, at a certain point, the physics simulation may break down and not be able to recreate the actual conditions from the real world. We can improve the accuracy of the simulation (at the cost of processing power) in the scene options (tab with an icon with three tiny object, third from the left), in the Rigid Body World section. This won't be discussed in detail on this lesson.
Another neat and simple physics example is the cloth simulation
The objects mentioned in the last point should definitely include the cube, the ground, but also anything else that is in motion and comes into contact with the fabric. If you rewind and play the animation now, you should see a convincing looking fabric falling from the sky. First time you run the animation, it may work a bit slow, but after it is cached, it should run completely smoothly. In the end, you can add to the fabric a Subdivision Surface modifier (CTRL-2) and change the shading to Smooth. The final result should look something like this:
To get the highest grade, you need to improve the above scene (add materials and lights) and create a final render. Rendering an animation isn't much different from rendering an image, but takes much longer (actually, exactly 250 times longer in this case). Check the following settings in the Render tab (the camera icon, first in the menu on the right):
And now you need to wait. It is very likely this task cannot be finished on the lesson. That is why this is the only exercise you can finish at home and bring the final (original!) movie to the next lesson. Just to be sure, don't forget to show the teacher your final progress before leaving the classroom.