Our experiment into the world of animation is almost over. Lil’ Bob is ready to move, and he’ll do it in the name of science!
During the course of the last two blog posts, we have created and separated into layers our orange-headed character, Lil
‘ Bob (shown below). Now, he is going to join the world of the living by taking his first steps into the realm of animation!
Animating a 2D character is actually a lot easier than it seems, especially since we already separated all of his moving parts. To complete this task, we’re going to use the non-linear editing program known as Adobe After Effects.
After Effects is one of the premiere Adobe products for the composition and animation of layers (same as the Photoshop layers we covered in the last tutorial). With After Effects, we can give the illusion of buildings shattering, type on text one letter at a time along a path, or animate layers to different positions over time (we’ll be doing this one). It is an extremely versatile tool.
Upon opening Adobe After Effects, we’re greeted with this gray monstrosity of a screen:
The first thing that we need to do is get our Photoshop project file (.psd) from the previous tutorial into After Effects. There are many ways to do this. I like to right-click on the “Project” panel and go to Import>File… (this may look slightly different depending on which version of After Effects you have) as shown in the image below:
This brings up a familiar window asking me which file I want to import. Navigate to your project Photoshop project file (.psd) from the previous tutorial, select it, and click “Open.”
After Effects then prompts us with a window asking about how the project should be imported.
IMPORTANT NOTE: In order to be able to edit the layers the way we want, the project file should be imported as a “Composition – Retain Layer Sizes” with “Editable Layer Styles” as shown in the image below:
Once we click “OK,” After Effects creates a composition featuring all of our layers from the Photoshop file.
For this composition of Lil’ Bob moving, I’m going to make my timeline (the amount of time our animation runs) to be 12 frames in length. To do this, all I have to do is click on Composition>Composition Settings… from the navigation bar at the top.
In the “Composition Settings” menu I can make my composition have a 12-frame timeline by changing the “Duration” as shown in the image below (we can also change the Background Color, if necessary):
Now, I finally have a project file with a 12-frame timeline that is ready for me to begin animating. Each of Lil’ Bob’s layers can be animated within the 12 frames I have set out for it. This is what the layers of my project (with their respective timelines) looks like:
To make a simple walking animation for Lil’ Bob, I’m going to set keyframes (points between which a layer animates position, rotation, scaling, etc.). Let’s start by getting Lil’ Bob to look like he’s walking. The first step is to select the “leftFoot” layer I have (ordered correctly thanks to my alphanumeric naming system).
After expanding the layer (by clicking on the arrow to the left of the layer name), I can click on the “stop watch” (shown below) and receive a keyframe on my timeline. This keyframe basically tells my layer that it needs to be at the exact position (or rotation, scaling, etc.) my keyframe says at the exact frame that it’s at on my timeline. After Effects automatically creates the frame(s) between the two positions that I define so I don’t have to do each frame by hand.
Thanks, After Effects!
To create more keyframes (positions where Lil’ Bob’s oddly-colored foot should go), I drag my playhead (yellow, pick-looking object at the top of my timeline with the red line extending below it) to another frame along the timeline. Once at this new point in my timeline, move “leftFoot” to the its new different position (as shown in the images below) to set the new keyframe.
After Effects creates the frame(s) between the two positions that I want so I don’t have to do them by hand. Thanks, After Effects!
Right now his foot moves forward over 6 frames and stays there. Once the 12-frame timeline animation ends, his foot returns back to its original position. This animation will go on a continuos, 12-frame loop. Our feet don’t move like this though.
To make Lil’ Bob’s movement smooth and natural, I need his foot moving back to its original starting position on the timeline. I copy the first keyframe in my “leftFoot” timeline and paste it at the end of my timeline to ensure complete walking motion.
IMPORTANT NOTE: Keyframes paste to wherever the playhead (yellow pick) is on your timeline. Knowing where the playhead is at all
times is extremely important!
The image below shows my full timeline for “02 leftFoot” (one of Lil’ Bob’s foot layers). The left-most keyframe is his beginning position, the middle keyframe’s position is moved to the right, and the right-most keyframe is just a copy of the left-most one. With my keyframes arranged like this, Lil’ Bob’s foot will move forward and then back to its starting position as long as my animation is running.
IMPORTANT NOTE: In After Effects you can preview an animation by hitting the spacebar. Also, you can get a fully-rendered preview of the composition by right-clicking in the actual workspace of the composition (middle window) and go to “Preview>RAM Preview.”
Repeat this process for his right foot. Creating a similar, but opposite, animation will give the effect that he’s walking.
Lil Bob’s body needs to rotate, resulting in a bobbing motion as he walks forward.
I need to expand Lil’ Bob’s “03 headBody” layer and activate the Rotation “stopwatch.” Set this keyframe at the
beginning of your timeline. Then, move to the 6th frame (the middle point of our timeline as well as the frame where each foot comes to the end of its path) and place a new keyframe by slightly changing the headBody layer’s rotation. Try not to go overboard with this rotation; I only ended up giving Lil’ Bob’s body a rotation of 2 degrees.
Just like Lil’ Bob’s feet, I want his body’s movement to look complete. Copy the first keyframe (the headBody layer) and paste it to the end of the timeline.
The “01 swordHand” layer is going to be the trickiest layer we animate. This is because we need to change its “anchor point.” An anchor point is the x,y coordinate from which that layer derives its movement, scaling, rotation, etc.
For example, if my anchor point is at the center of a layer and I rotate that layer, the layer will rotate around itself from this center point (much like Earth rotates around its own axis).
For this layer, we want Lil’ Bob’s arm rotating from what would appear to be his shoulder joint. Since he doesn’t have shoulders, his movement looks a little more abstract. This will actually work in our favor.
Using the “Pan Behind Tool” on my toolbar, I can select the “01 swordHand” layer, click and hold on its anchor point (the circle at the center of the layer as shown in the image below), and move it to where the arm’s movement should originate (his fake shoulder).
After using the Pan Behind Tool, this is where I moved my anchor point:
The final step of Lil’ Bob’s walking animation is a quick rotation of his arm to make it look natural with the rest of his body’s movement. I expanded his layer, activated the “stopwatch” for that layer’s rotation, and got to work.
Much like Lil’ Bob’s body, his arm only needs a slight rotation with a keyframe of the arm’s beginning position at each end of my timeline. I ended up giving him a 4-degree rotation at the 6th frame (our animation’s midpoint).
If you’ve followed along with everything I’ve done, your timeline should look something like this:
Right now, my animation of Lil’ Bob is just a composition in After Effects. We want this in a form that can be used in a game. In other words, we need to “render out” our project to something more useful. To do this, I need to send my project to the “Render Queue.”
The Render Queue is where compositions go to become real things. By selecting my project tab in the timeline (shown below), I can select “Composition>Add to Render Queue.” This opens the Render Queue tab in what was my project/timeline area.
Since I selected my “lilGuy” composition and added it to the Render Queue, it’s ready to be rendered out. Now I must select what I want it to become, what files I want to render out of After Effects. This can change depending on what you need to do with the animation. For example, in a game, you’d want to have individual images of each frame in your timeline so you can use them in your code. For something that I just want to show off, like a video, I can just render out my animation as a Quicktime or AVI file.
We need frames, though. So, I clicked on the orange-highlighted word “Lossless” next to “Output Module” to get to the menu below where I changed the Format to “PNG Sequence” and the Channels to “RGB + Alpha” and clicked “OK.”
These settings will give me 12 images because my timeline spans 12 frames.
The only thing left to do is tell After Effects where I want these files. By clicking the orange-highlighted words “Not yet specified” next to “Output To” in the Render Quere, I get a basic explorer menu where I can place the files (much like the “Save As” option in almost any program).
IMPORTANT NOTE: Since After Effects will render out more than 1 file, it’s a good idea to create a new folder on your desktop (or wherever you want the files) in which the images can be rendered.
Nothing is actually rendered yet. We’ve only told After Effects where we want the files and what they will be. To render our animation of Lil’ Bob into images, we need to click the “Render” button in the top right corner of the Render Queue tab.
Success! This is the end of our adventure creating a character, cutting him out and layering him, and then animating him. Lil’ Bob is now a real boy!
You can see him animating perpetually below: