The Wiggler, one of the features that first drew me to After Effects
all those years ago, has by far the best name for an option in any
piece of software! But its ability to generate random values for
anything in your animation is still a most powerful necessity, and when
this can be achieved through simple scripting, it adds a whole new
weapon to your arsenal of animation tools and techniques. Let’s create
a really stunning title sequence for a program called “It’s a Bit of an
Animal” with just four keyframes and a little Expression magic.
The specs for this project are an NTSC square-pixel composition
(720×540), 29.97 frames per second, 4 seconds long, with a background
color of black. Some of the effects we’re using here are only available
in the Professional version of After Effects.
STEP 1 Import PSD; Duplicate 3D Layers
Import a texture image from Photoshop that’s 768 pixels square. This
will serve as one of the walls to the animal cage we’ll create. We’ll
need six walls for the cube arranged perfectly in 3D space—easy using
Digital Anarchy’s 3D Assistants that ship with After Effects. Drag the
texture into the Timeline at 0 seconds, and make it 3D by clicking in
the blank box under the cube switch. Press Command-D (PC: Control-D)
five times to duplicate the layer, giving us the six layers we need.
Then, in the Comp window, switch to Custom View 1 instead of the Active
Camera.

STEP 2 Create 3D Cube; Remove Front Face
With all six layers selected, go to Window>Box Creator Lite (make
sure you’ve installed the 3D Assistant plug-ins from the AE Installer
CD), select Fit Box to Layers, and click Apply. You should now see a
cube shape, and if you hit C to access the Orbit Camera tool, you can
rotate around the cube in the comp window. Now, in the Timeline, turn
off the visibility of the first layer to remove the front of the cube
so we can see inside it. Return to the Active Camera view.

STEP 3 Add, Position, and Rotate 3D Camera
Go to Layer>New>Camera and from the Camera dialog, choose a
preset of 28mm, then click OK. You should see a little more of the cube
now because of a greater perspective. We’re going to animate this
camera to be very “hand-held,” so we need to turn off its auto
orientation value by going to Layer>Transform>Auto Orient,
choosing Off, and clicking OK. Hit P to access the camera’s Position,
and key in 630, 90, and -560 for the X, Y and Z axes. Then, hit R for
Rotation, and key in 350, 340, and 356 for the Orientation property.

STEP 4 Import Illustrator Titles; Place in Cage
Double-click in the Project window to access the Import dialog and
bring in a layered Illustrator file containing the titles. Be sure to
choose Composition - Cropped Layers from the Import As sub-option. Open
the newly created comp, select all the layers, copy the layers, then
switch to the main comp, and paste them in. Click the 3D Layer icon for
one layer to make them all 3D, then drag only the red and green arrows
in the comp window to position the titles’ X and Y axes to the lower
right (dragging the arrows on one layer will move them all together).

STEP 5 Add Position Expression
Select one of the title layers, hit P for Position, and hold down the
Option key (PC: Alt key) while clicking on the Position Stopwatch to
add an Expression. We need to use a simple Wiggle script to randomly
animate the position but constrain it to one axis. To do this, we need
a variable. Key in “steve = wiggle(3,350);”. This establishes a wiggle
of 350-pixel movement, three times per second, packaged up inside a
variable and given a name—in this case my name. But the script is not
complete, as it now wiggles on all three axes.

STEP 6 Finish Expression
Press Return at the end of the first line of script, and key in
“[position[0], position[1], steve[2]]”. This tells AE to keep the
original position values for the X and Y axes (0 and 1) and to use the
Steve Wiggle value on the Z axis (2). Press Enter to OK the script and
then preview the animation—perfect random motion along one axis! Select
the two lines of script and copy them. Select the other title layers
one at a time, Option-click (PC: Alt-click) their Position Stopwatch,
and paste in the same script. AE now creates new random values for
every layer.

STEP 7 Animate Camera with Keyframes and Script
At 0 seconds, select the camera and show its Position and Orientation
values. Click their Stopwatch icons to add keyframes, and then go to 4
seconds. Change Position to 20, 530, and –560 and Orientation to 16,
25, and 353. A preview now shows a nice smooth animation across the
cage. Maybe the camera should shake realistically? Hold down Option
(PC: Alt), click on the camera’s Orientation Stopwatch, and enter this
script: “wiggle(3,5);”. Preview again. This rotates the camera randomly
by 5° three times per second.

STEP 8 Add Light; Parent to Camera
Now, at 0 seconds, go to Layer>New>Light. Choose Spot, Intensity
110%, Cast Shadows On, 55% Darkness, 10 px Diffusion, and click OK.
Again, go to Layer>Transform>Auto Orient and select Off. Let’s
attach the light to the camera: Control-click (PC: Right-click) on the
Source Name column in the Timeline, go to Columns, and choose Parent.
Drag the small @ symbol next to the Light’s Parent option and point it
at the Camera layer. Now show the Light’s Position values and change
them to 0, 0, and –65. Looking through Custom View 1, you can see the
light attached just above the camera.

STEP 9 Wiggle Light Intensity; Activate Shadows
To make the light flicker, let’s use that same Wiggle script again.
Twirl down the Light’s options, Option-click (PC: Alt-click) on the
Intensity Stopwatch, and key in “wiggle(10,50);”to randomly animate the
intensity 10 times per second by up to 50% in either direction. Now
select the title layers, hit A twice to access their 3D properties, and
next to Casts Shadows, click to turn them all on. A preview should now
show the flickering light, as well as shadows being projected onto the
cage’s walls.

STEP 10 Add 3D Smoke/Dust Layer
If you have a movie render of some slowly moving smoke, use it now; if
not, create a new solid layer and use AE’s Fractal Noise effect to
create some. Now, bring the layer into the comp at 0 seconds, make it
3D, scale it to the edges of the cell, position it on the Y axis to
just touch the bottom, and then position it on the Z axis to –360, just
in front of the camera. Looking through Custom View 1, notice that the
layer has a hard edge and needs to blend into the scene better.

STEP 11 Use Linear Wipe Transitions
Go to Effect>Transition>Linear Wipe, and in the Effect Controls
window, change the Transition Complete value to 5% and the Feather to
40. This softens the smoke on the left side of the cage. Hit Command-D
(PC: Control-D) to duplicate the effect and change the Wipe Angle to
–90° to affect the right side. Duplicate the effect again, and a Wipe
Angle at 0° affects the bottom. Finally, duplicate again, set the Wipe
Angle to +180°, Completion to 25%, and Feather to 140, and the top of
the smoke softly fades in.

STEP 12 Create Volumetric Smoke
Click the Switches/Modes button at the bottom of the Timeline to switch
to Modes and set the smoke layer’s blending Mode to Screen to drop out
the darkest pixels, leaving soft white smoke. Preview now through the
active camera, and it’s looking great. But the smoke doesn’t have
depth. Here’s a great trick for creating 3D volumetric smoke in AE:
Deselect the layer, select it again (to avoid duplicating another
effect), and duplicate it twice to make three layers, all currently in
the same position on the Z axis.

STEP 13 Offset Smoke Layers
Access the Position values for the two duplicated layers, and change
their Z axis values to –260 and –160 respectively, putting 100 pixels
between each of the smoke layers. If you click the Solo icon for these
layers in the Timeline and preview, you’ll see smoke now that truly
looks 3D and dense. From certain camera angles, however, there’s a
pattern repetition. To fix that easily, select the middle one of the
three layers, access its Rotation value, and change the Y axis to 180°.
Preview again and the problem’s solved.

STEP 14 Create Cage Door; Motion Blur Effects
Turn off the Solo icons and turn the visibility back on for the first
texture layer (the cage front). Quickly turn this into a cage door by
going to Effect>Render>Grid. Set the Border to 10 and the Color
to gray. Then, add Effect>Blur & Sharpen>Fast Blur and set
Blurriness to 5 pixels. Remember to hit A twice for the layer and turn
Casts Shadows to On to see the grid shadow on the back wall. Finally,
turn on Motion Blur for all the layers and render your finished, very
cool, and realistic title sequence—all courtesy of a little command
called Wiggle.
 |