After we posed the avatar’s arm in the previous section, you may have noticed that the bones in the arm turned blue! That’s because they now have keyframes set on them — they’re alive! Muahaha!
The keyframes were set automatically when we changed the pose, because we turned the “Auto-Keyframe” option on. Since we were on frame 1 when we changed the pose, the keyframes are set on frame 1. Simple, right?
Animation is change over time
To make an animation, you just need to make different poses at different times. If the pose is the same on every frame, it’s a static pose, not a proper animation. So to make this an animation, let’s go to frame 15 and set another pose.
There are a handful of ways that you can change the frame you’re on:
- Left click on the little left and right arrows on the frame indicator in the Timeline header, or Shift+Left Click the indicator to type in a frame number and press Enter to set it.
- Left click anywhere on the timeline display to go to that frame. You can even click and drag to “scrub” back and forth.
- Use the arrow keys on your keyboard:
- Left / Right = change by 1 frame
- Up / Down = change by 10 frames
- Shift+Left / Shift+Right = Go to start / end.
Let’s set the pose on frame 15 to have the arm up, like so:
Just like before, new keyframes are automatically created when you set the pose, but this time they’re on frame 15.
Bonus Pro Tip: Manual keyframes
Auto-keyframes are nice for beginners, but as you get more experienced, you’ll probably want more control over when a keyframe is inserted. You can turn off auto-keying by unpressing the red circle button in the Timeline header.
Then, when you want to set a keyframe, just select the bone(s) and press I — a menu will come up, letting you choose which attribute (Location, Rotation, etc.) to set a keyframe for. Now that’s control! (But note that only rotation is important for most bones. The exceptions are root and body, which also use position; and the hand and feet controls, which use position, rotation, and scale!)
Playing the animation
Let’s play the animation and see how it looks so far. To do this, press Alt+A. This will play the animation until the end, then repeat from the beginning, over and over. To stop it and go back to the frame you were on, press Esc. Or press Space to stop it at that point in the animation.
You can see that even though we only set keyframes on frame 1 and frame 15, Blender automatically calculates how the bone will be posed at the frames in between. Unlike Qavimator, Blender uses “cubic splines” to make nice smooth curves between the keyframes. (You can read more about cubic splines if you want, but there’s a lot of math that isn’t important to actually using them in Blender.)
You can see these miraculous splines in action in the Animation Curve Editor, the panel in the top right. Just select a bone, put your mouse in the curve editor, and press “Home” to adjust the view to see all the keyframes. Here’s an example showing what the curves for the shoulder will look like when the animation is done. So smooth and yummy!
Bonus Pro Tip: If you’re feeling really courageous, you can actually edit an animation curve (as you might expect with something called an “Animation Curve Editor”). Right click on a curve to select it, then press Tab to change to toggle edit mode. Good luck!
Coming full circle
When you play the animation, you can see that it “pops” when it reaches the end — the arm instantly goes back to the down position, with no smoothness. Yuck! To solve this, let’s copy the first frame, and put it on frame 30, the last frame of our animation. That way, it’ll loop smoothly.
The simplest way to do this is in the Keyframe Editor. First, select one or more keyframes. If you have a lot of keyframes and you don’t want to Shift+Right Click to select them each individually, you can use B to get a box select tool. (Hit A a couple times to select / deselect all keyframes). Selected keyframes will appear a lovely shade of goldenrod.
Once you have the keyframes selected, press Shift+D to duplicate them, and move your mouse left and right to position them. You can hold Ctrl while moving the keyframes to make them snap to frames (instead of putting them partially between frames). When you have them in position, left click to set them. (By the way, you can delete keyframes by selecting them and pressing Delete or X.)
When the keyframes are set, put your mouse back in the 3D view and press Alt+A to watch the animation again. Now the avatar should raise its hand, then lower it again, over and over, with no skipping. Woot, that’s our animation!
Next: Exporting to BVH and uploading to SL
Now that our magnum opus is complete, we’re ready to export it, upload it to SL, and impress all our friends with our mad skillz.