FORUMS: list search recent posts

Expressions: bounce version of this overshoot Expression Selector code for text?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Paul Hasas
Expressions: bounce version of this overshoot Expression Selector code for text?
on Sep 29, 2019 at 6:33:39 pm

Hi all. I'm taking an online AE course, and I picked up this very useful code for auto-animating overshoot, when using an Expression Selector on a text layer. There are no keyframes, and no other selectors aside from the Expression Selector. You simply choose a property to animate (e.g. Scale, set to 0%), and add this code to the selector's Amount property. The problem is, the course doesn't supply a "bounce" variant of this code, just the overshoot. I've tried adapting this code myself, using some of the standard auto-bounce expressions snippets floating around online as reference, but my results are buggy and unpredictable, and I don't know enough Expressions / math to fix. Can anyone help? Here's the original overshoot code:

freq = 2;
decay = 4;
delay = .05; // delay between animation of nearest units
dur = .12; // unit animation duration

myDelay = (textIndex - 1) * delay;
t = time - (inPoint + myDelay);
startVal = 100;
endVal = 0;

if (t < dur) {
linear(t, 0, dur, startVal, endVal);
} else {
amp = (endVal - startVal) / dur;
w = freq * Math.PI * 2;
endVal + amp * (Math.sin(t * w) / Math.exp(decay * t) / w);
}


Return to posts index

Paul Hasas
Re: Expressions: bounce version of this overshoot Expression Selector code for text?
on Sep 29, 2019 at 6:57:40 pm

Wasn't gonna bother posting my duct-taped bounce variant, but here it is. This is the one that gets me closest to a working result. The problem is, after the initial bounces stop, they start up again and keep jumping higher and higher.

bounces = 5;
decay = 2;
delay = .2; // delay between animation of nearest units
dur = .3; // unit animation duration

myDelay = (textIndex - 1) * delay;
t = time - (inPoint + myDelay);
startVal = 200;
endVal = 0;

freq = 1 / dur;
mult = (bounces - Math.floor(t * freq)) / bounces;

if (t < dur) {
linear(t, 0, dur, startVal, endVal);
} else {
amp = (endVal - startVal) / dur;
endVal - (amp / 10) * (Math.abs(Math.sin(freq * t * Math.PI)) * Math.pow(mult, decay));
}


Return to posts index

Paul Hasas
Re: Expressions: bounce version of this overshoot Expression Selector code for text?
on Oct 17, 2019 at 5:24:40 am

bumpage. Anyone know? Paging Dan Ebberts.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]