In this After Effects animation tutorial, we will look at how to animate inertial bounce expressions in Adobe After Effects by using an example project.
In our example, we have some leaf elements broken out into individual elements, which makes it easier for us to animate them in a fun and interesting way. We’re going to add a very subtle rotation to make them look as if they’re blowing in the wind.
Before we do that, though, let’s finish the layout. We’re going to duplicate these leaves and replace the other flat leaf elements in the image.
To do this, we need to make sure that our leaves are prepared properly to avoid duplicating any mistakes. For example, we want the anchor point of our leaves in the correct place, ready for animation and rotation.
Create a new Null Object by going to Layer > New > Null Object or by using the keyboard shortcut Control-Alt-Shift-Y.
Move the null object to the corner where the leaves are in the top left.
If you don’t have snapping enabled, you can enable it by choosing the Selection Tool and clicking on the checkbox in the top menu bar. You can also temporarily enable it or reverse the enabling by holding down the Control button on the keyboard.
So if it is enabled, when you hold Control, it will disable. And if it’s not enabled, when you hold Control, it will enable.
Rename the Null layer “Leaf_Cont_1”, and then from here we want to think about how we want to animate this before duplicating it. If we animate everything first before duplicating, it’ll save us from needing to repeat the animations further down the line.
So let’s select one of the leaf layers and hit S on the keyboard to bring up the Scale properties.
Move down around 10 frames in the timeline by hitting Shift-Page Down on the keyboard, and then create a Scale keyframe in that position. This will be the end scale for this particular leaf element.
Now we’ll go back to the beginning of the timeline and set the Scale down to 0.
So over the first ten frames, this particular leaf element will grow from 0 to its original size. Now what we’ll do is enhance that with something called Inertial bounce. This is also known as overshoot, and it’s a great technique that will make this animation look more realistic.
First, let’s copy the expression below. You can also find this expression under Inertial bounce version 1.2.
amp = .1; freq = 2.0; decay = 2.0; n = 0; time_max = 4; if (numKeys > 0){ n = nearestKey(time).index; if (key(n).time > time){ n--; }} if (n == 0){ t = 0; }else{ t = time - key(n).time; } if (n > 0 && t < time_max){ v = velocityAtTime(key(n).time - thisComp.frameDuration/10); value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); }else{value}
Alt-click on the Scale stopwatch and paste an expression as shown below.
When you preview the animation, it will appear much more dynamic. So it’s doing an overshoot calculation.
If I go into the graph editor and turn on the Post Expression Graph, you can see it is showing you what the expression is doing via the graph. We get this sinusoidal wave with a decay in the amplitude.
The animation will have a very natural look to it because this is how a lot of things move in the real world, which is very cool.
What if you don’t like the exact movement that we’re getting here? Well, we can modify some of these parameters in the expression and change things like the Frequency. For example, let’s change the value to 1.5 because I think 2 is just a little too much.
If the overshoot animation or expression is lasting too long, we can turn up the decay, and this will cause it to decay faster. It’ll cause that Post Expression to stop more quickly. So let’s just turn this up to 5 or 6, which will make the animation faster.
And if we look at the graph editor, it’s going to reflect that. So we just get a little bit of overshoot, we get a little bit of bounce back, and then it settles very quickly compared to before.
Rather than tweak the animations for every single leaf, we’re going to use the leaf controller layer that we created earlier. Let’s add some slider controls to the leaf controller layer. So with the leaf controller selected, go to the Effects and Presets panel and type in “Slider Control”. Apply this to the Layer Control by double-clicking on it.
Rename the slider “Freq” for frequency.
Duplicate it by pressing Control-D and call it “Decay”.
In the expression, select 1.5, and then grab the Pick Whip and Pick Whip it up to the Frequency Slider by clicking and dragging with the mouse.
Now we want to repeat the same process for the decay. Select that decay value (which is 5 in this example) and use the Pick Whip to Pick Whip up to the Decay Slider.
Now set the values for both the Freq and Decay sliders. For example, we will set the Freq to 1.5 and the Decay to 5 again.
That way, if we want to globally change that, we don’t have to run back through all of these expressions. Remember that when we duplicate all five of these leaves, that’s going to be 20 different layers we’re going to have to go through. So this is going to be a lot quicker.
From here, let’s open up the rest of our leaf layers and create an ending keyframe for Scale. This should be around the same time position as the one we created earlier.
Go back to the beginning and set all of them to zero again.
Then, on the leaf layer containing the expression, we are going to right-click and select Copy Expression Only.
And now, if we just select these keyframes and paste the expression (Control-V), it’s going to paste the expression to the Scale properties.
Now, all of the leaves should grow and do that very nice overshoot animation.
If you want to get a little bit more life out of this animation, we can change the distance between the keyframes. So if we shorten this, we’re going to get a quicker animation with a more drastic overshoot bounce.
But we can also smooth out the beginning by just selecting the beginning keyframes and hitting F9 on the keyboard to easy ease them.
But having them all come out at the same time doesn’t really look too hot. So what I would probably do is offset these by maybe a frame or two, so that they come out in a staggered way. This will make the animation seem more natural and random.
This Inertial bounce expression can be used in a bunch of fun and different ways. You can use it on scale, rotation, position, and a bunch of other properties to come up with some really interesting looks.
Congratulations
Congratulations! That’s the end of this bounce expressions After Effects tutorial. Now that you’ve learned the basics, check out some of the other tutorials we have on Adobe After Effects below.
I hope you’ve found this After Effects animation tutorial useful, and I’ll see you next time on Envato Tuts+!