AE Bounce and Overshoot Expressions

Just came across these. Why didn’t I find them sooner?

Keyframe Overshoot Expression:


freq = 3;
decay = 5;

n = 0;
if (numKeys > 0){
  n = nearestKey(time).index;
  if (key(n).time > time) n--;
}
if (n > 0){
  t = time - key(n).time;
  amp = velocityAtTime(key(n).time - .001);
  w = freq*Math.PI*2;
  value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}else {
  value
}

Add a little bounceback…

Keyframe Bounce Back Expression:

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
}

15 Comments

  1. Pingback: Week 5: Effects & Expressions – Motion Graphics Intro Spring 2018

  2. Pingback: Week 5: Effects & Expressions – Motion Concepts Spring 2018

  3. Pingback: Week 6: Cinematic Trailer Genres – Motion Concepts Spring 2018

  4. Pingback: Week 4: Effects & Expressions – Motion Graphics Intro Summer 18

  5. Pingback: Week 5: Effects & Expressions – Motion Graphics Intro Fall 2018

  6. Pingback: Week 5 – Effects & Expressions – Motion Concepts Fall 2018

  7. Pingback: Week 5: Effects & Expressions – Motion Concepts

  8. Pingback: Week 6: Cinematic Trailer Genres – Motion Concepts

  9. Pingback: Week 4: Effects & Expressions – Motion Graphics Intro

  10. Pingback: Week 5: Effects & Expressions – Motion Graphics Intro

  11. Pingback: Week 5 – Effects & Expressions – Motion Concepts

  12. Pingback: Week 6: Cinematic Trailer Genres – Motion Concepts

  13. Pingback: Week 5: Effects & Expressions – Motion Graphics Intro

  14. Pingback: Week 5 – Effects and Expressions – Intro to Motion Graphics

  15. Pingback: Week 5: Effects & Expressions – CD Studio: Motion Graphics

Comments are closed.