Chapter 8 alluded to methods for smoothing and destabilizing a camera that are preferable to the Smoother and the Wiggler, After Effects' built-in solutions that pre-date expressions. As with looping, these are pretty easy to learn and will expand your capabilities quite a bit. Steadicam and Camera ShakeThere are effects applications out there with specific effects for smoothing or destabilizing the camera, and I've seen at least one other author claim that After Effects has no tools for camera stabilization and destabilization. I'd like to disprove that assertion right now. If you followed the steps in Chapter 8 for using a 3D camera to motion track a scene in such a way that the track is applied only to the layer and camera, you're ready to proceed. If not, please review that section briefly if you want an idea of how the setup can be applied to a motion-tracked camera. Using wiggle to destabilize a camera will work without tracking data (see Figure 10.14). Figure 10.14. Contrast a simple camera push with an ease (top) with the result of applying a modest Wiggle operation to it (bottom: overlaid in red on the curve).Once again, application of the expression is easy. Given a set of keyframes, you can smooth themaveraging them against the closest adjacent keyframes (you control how many)or give them more noise and jitter, by applying one of the following expressions: smooth() wiggle(freq, amp) There are, actually, more default parameters than I've included here, but I'm hoping that presenting them this way will make them appear easier to use than they do with the menu defaults, which are nonetheless explained below. You can apply smooth as is, and you can clearly view the result without ever previewing any animation, just by looking at the velocity graph showing the source animation curve (in black) and the result of the smooth operation (in red). This graph is an additional advantage to applying smoothing with an expression (Figure 10.15). Figure 10.15. Camera jitter, smoothed. The delta (change over time) of the smoothed motion (in red) is much less than that of the source (in black).You can of course tweak the amount of smoothing using the parameters shown in the default expression: smooth(width = .2, samples = 5, t = time) These are the same settings as in the example above, with no arguments used. The width setting specifies the amount of time, in seconds, to either side of the current frame that is averaged into the smoothing calculation. The samples setting specifies how many increments to examine within that keyframe range (typically, you should choose an odd number to include the current frame in the calculation). The time setting allows you to offset the effect of the smooth, something you'll rarely, if ever, need to do. The wiggle expression needs a couple of arguments by default, and has the option for more. At the very least, you need to enter freq, or frequency (the number of wiggles per second), and amplitude (the maximum amount the wiggle can change a valuein other words, the number of pixels). The full default expression reads wiggle(freq, amp, octaves = 1, ampMult = 5, t = time) For the most part, freq and amplitude are all you need, but if you must know, octaves has to do with how much noise is added together, and won't usually need to be more than 1. A higher value for octaves doesn't mean more noise, it just means more samples, and ampMult multiplies the resultagain, it's about variety. For just plain more, add to the frequency and amplitude. Time, once again, is an offset.
To apply smooth() and wiggle() expressions to a 3D camera that has been tracked to match the background (as demonstrated in Chapter 8), make sure that you apply them both to the null layer to which the camera is parented and to the background plate. Alternatively, if you're just looking to apply random numbers within a certain range rather than wiggling keyframe values, you can use the various random, Gaussian random, and noise functions found in the Random Numbers submenu (see the In Depth box). Or, if you want to wiggle the temporal position of the keyframes themselves (to wiggle them in time), try temporalWiggle(freq, amp).
It's not the most commonly used, but it is useful if you need the animation values to stay in exactly the same range (to follow a path, for example) but to move back and forth semi-randomly on that path. |