EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • Featured Skills
    • New & Trending
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign Up
Home Design Design Tutorials After Effects Tutorial After Effects Bounce Expression
 

After Effects Bounce Expression

Updated August 28, 2023

After Effects Bounce Expression

 

 

Introduction to After Effects Bounce Expression

Bounce Expression in After Effects is a type of expression through which you can add a bounce effect on your object for making bouncing animation with it. For using bounce expression, you have to type an expression in computer coded language in the expression box of a particular property of any object. You can copy free expression code from any free internet website for the bounce effect of the different properties of the object. So let us understand different parameters of this expression to easily understand this topic and have command on code of bounce expression, which we will apply on different transform properties of any animated object of after-effects in this topic.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

How to Use Bounce Expression in After Effects?

We can learn using this expression in After effects for adding bounce expression on our object by following some steps of the application process of this feature of after effect. But before we start learning about this topic of after effect, we must look at the working screen of this software to understand this topic in a better way.

In the user screen of this software at the top, we have a Menu bar with several menus. Below this, we have a Property bar of active tools or images. Below this bar, we have three sections in which at left side we have Project panel along with Effect Controls tab, at the center, we have Composition window in which we can see our current working, at the right side we have some tabs such as Preview, Align, Effects & Presets, and some other tabs are there. You can adjust all these sections anywhere on the user screen of this software as per your choice.

After Effects Bounce Expression output 1

Now let us have a new composition for learning about this topic. For new composition, go to the Composition menu of the menu bar and click on it. Choose the ‘New composition’ option from the drop-down list, or you can press Ctrl + N button from the keyboard as a shortcut key for having new composition.

After Effects Bounce Expression output 2

A new composition settings box will be open. Adjust the parameters of this box according to your desired composition property and click on the Ok button for applying for desired settings.

After Effects Bounce Expression output 3

A new composition will create like this. Now go to the tool panel of this software and click on the icon of the Rectangle tool for having this tool active. I will apply bounce expression on different transform properties of the rectangle shape made by this tool.

After Effects Bounce Expression output 4

Now draw a rectangle of any size like this.

After Effects Bounce Expression output 5

Now go layer panel of this software and click on Shape layer 1, then press the S button of the keyboard for having the Scale property tab of this shape. Now set two keys from 0 to 100 percent that means set 0 value of scale at first key.

After Effects Bounce Expression output 6

And 100 percent value of scale at second key.

After Effects Bounce Expression output 7

Now click on the stopwatch icon of scale property with the mouse button by holding the keyboard’s Alt key. Once you click, an expression box will come in the keyframe section of this scale property.

output 8

Now type this expression in this box, or you can copy-paste it from here. In addition, you can get this type of expression from free internet websites.

n = 0;
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 < 1){
v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
amp = .05;
freq = 4.0;
decay = 8.0;
value + v*amp*Math.sin(freq*t*2*Math.Pl)/Math.exp(decay*t);
}else{
value;
}

output 9

Now you can see the bounce effect in scale property by playing it. Moreover, you can make changes in the bounce effect by changing any of these three values of this expression as per your choice.

output 10

Now let us type code for adding bounce expression on the position property of this shape. First, go to the layer panel and the select layer of shape again, then press the P button of the keyboard for having position property.

output 11

Now add two keys in position property and animate it from middle of composition window to bottom of it, which means at the first key place this rectangle at the center of composition window and second key place this at the bottom of the composition window.

output 12

Now make a click on the stopwatch icon of position property of this shape by holding the Alt button of the keyboard, and an expression box will add in the keyframe section of the timeline of this software.

output 13

Now type this expression in this box, or you can copy-paste it from here. In addition, you can get this type of expression from free internet websites.

e = .7;
g = 5000;
nMax = 9;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
v = -velocityAtTime(key(n).time - .001)*e;
vl = length(v);
if (value instanceof Array){
vu = (vl > 0) ? normalize (v) : [0,0,0];
}else{
vu = (v < 0) ? -1 : 1;
}
tCur = 0;
segDur = 2*vl/g;
tNext = segDur;
nb = 1; // number of bounces
while (tNext < t && nb <= nMax){
vl *= e;
segDur *= e;
tCur = tNext;
tNext += segDur;
nb++
}
if(nb <= nMax){
delta = t - tCur;
value + vu*delta*(vl - g*delta/2);
}else{
value
}
}else
value

output 14

Now you can see the effect of bounce expression on the position property of this shape by playing it.

output 15

You can make changes in these two values of this expression for making the change in the bounce of position property.

output 16

In this way, you can use bounce expression in the After effect.

Conclusion

Now, after this article, you can understand what Bounce expression is in After Effects and how you can type expression for getting it. You can also learn how you can change the values of these expressions for having variation in bounce effect on the different properties of any shape of after-effects.

Recommended Articles

This is a guide to After Effects Bounce Expression. Here we discuss How to use Bounce Expression in After Effects and how you can change the values of these expressions. You may also have a look at the following articles to learn more –

  1. Trapcode in After Effects
  2. Twixtor in After Effects
  3. After Effects Portable
  4. Plexus After Effects

Primary Sidebar

Footer

Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA
Free Design Course

3D animation, modelling, simulation, game development & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

🚀 Limited Time Offer! - ENROLL NOW