Quick and smooth animation in Blender

By telleropnul, July 28, 2020

Source File

strafing_run.blend

The result of recording camera movement (Auto Keying) when in walk navigation (WASD) mode:

Smoothing using [ALT+O]:

Approximating using Decimate (% allowed change):

Copying camera animation data to an object:

 

Quick notes

This is a popular learning trajectory for animating objects in Blender:
Goal
“I want to make an animation”
Approach

  1. Place keyframe at start.  Place keyframe at end.  Linear or Bezier.  Modifty in Graph Editor.
  2. Add more keyframes.

Problems

  1. Not realistic and life-like.
  2. No path following.
  3. No banking / titling.
  4. Adding rotational keyframes manually to set pitch, roll and yaw is tedious, especially if you decide to move the object later on.

Approach

  1. Use Curve Modifier.
  2. Set a start and end position keyframe.

Problems

  1. Curve origin needs to be set at start of curve.
  2. Curve origin and object origin need to sit at same position.
  3. It is not necessary to ‘apply location’, but you should ‘apply rotation and scale’.
  4. Getting the orientation of your object along the curve correct is a pain.
  5. Using the ’tilt’ property to edit Curve points is a pain.
  6. Even though curves use points with Bezier handles, objects can often be seen to change pitch, yaw and roll abruplty the moment they pass a point on a curve.  Adding more points helps but makes animating tilt difficult.
  7. If you make the curve longer, the object will move faster.  No constant speed.

Approach

  1. Add a plane shaped into a 3 vertex arrow with Curve Modifier.
  2. Vertex parent an object to the 3 vertices of the 3 vertex arrow.
  3. Instead of keyframes, set a single keyframe on the X or Y position.
  4. In Graph Editor, add a Modifiers > Generator to the track so the 3 vertex arrow moves at a constant speed independent of the number of points on the curve.

Problem

  1. Editing keyframes with the animation paused often results in objects in the wrong place at the wrong time or objects moving at wrong speed when you press ‘Play’.

Solution

  1. YOU NEED TO START LIVE RECORDING KEYFRAMES AS SHOWN IN VIDEO.

How does it work

Step 1 – Record moving an object using [G]

You can record moving an object using the Move command [G]:

  1. Add a cube to the scene.
  2. Click “Auto Keying” circle shaped record button in Timeline.
  3. Set end frame to 1000.
  4. Press Space to start recording.
  5. Press [G] to move the cube.Notice keyframes being generated automatically.

Step 2 – Moving a camera using WASD navigation

  1. [RMB] View > Navigation > Walk navigation and assign SHIFT-F shortcut.
  2. Press SHIFT-F
  3. Press (SHIFT) + WASD to move the camera fast / slow as if you are in a computer game.
  4. You can record this movement the same way as before by using “Auto Keying” and pressing [Space].

Step 3 – Graph Editor

Do Not Be Afraid Of Having Hundreds of Keyframes.  Keyframes are your friend.  The Graph Editor can be used to smoothen, simplify (decimate), cleanup any number of keyframes and create simple graphs (called F-curves).

The Graph editor has some clever features to work with large animation sequences consisting of hundreds of F-keyframes:

Graph Editor – useful keyboard shortcuts

[G] move a sequence along the timeline (X axis) or value (Y axis). Values are often degrees or coordinate positions.
[S] to scale a sequence to slow down or speed up.
[MMB] Mousemove to pan.
[CTRL+MMB] Mousemove to zoon in on X axis (mousemove left <> right) and Y axis (mousemove up/down).

Graph Editor – useful menu options / workflow

This is a useful workflow to manipulate a large number of recorded keyframes.

  1. Add a keyframe at start and end frame manually.
  2. Key > Sample Keyframes to fill in any gaps (interpolates between existing keyframes)
  3. Key > Smooth Keys x 100 or so.
  4. Key > Decimate (% allowed change).  Set a value between 0.0 (= 0% allowed change) and 1.0 (= 100% allowed change) to approximate the samples into a simplified F-curve.  0.1 to 0.5 generally gives acceptable results.

Can you transfer a recorded walk navigation mode (WASD) camera animation data to objects ?

Yes you can.  Simply use copy-paste to copy-paste the keyframes or:

  1. Select camera
  2. CTRL / SHIFT select one or more additional objects.
  3. Press [CTRL-L] and select “animation data”.

This is similar to how you apply the same material to multiple objects.  This time, we use [CTRL+L] to apply animation data.

Conclusion

Pros:
+ I can now work with animation tracks that have hundreds of keyframes.
+ Realistic life-like animation.
+ Easy to smooth.
+ Easy to reduce keys using ‘Decimate (% allowed change).’

Cons:
– Only two WASD speeds (fast or slow). Speed transitions can be smoothed out though, which is good.
– Speed may not be correct. Scaling all keyframs along X axis may fix this.
– No banking / tilting.
– Smoothing / decimating F-curves may cause the object to move closer to other objects in the scene unintentially.
– Animation takes a lot of time to get right. Is just how it is.

Banking / tilting
You can record this on a separate track on a dummy object afterwards and transfer keyframes.  You can also simply move a rotation value input field slider or press [R] [X] or [Y] to rotate an object in a single direction whilst live recording (= Auto Keying enabled during playback).