FORUMS: list search recent posts

Time remapping w/o affecting a bounce expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emmett Fraser
Time remapping w/o affecting a bounce expression
on Oct 25, 2016 at 10:58:48 pm

Hi All, I'm working on an animated alphabet that I'd like to keep as customizable as possible. To that end I was hoping to add a global control for 'duration' that would control how long it takes for every letter to animate.

At first this just sounds like some basic time-remapping, but unfortunately I have a bounce expression on some of the layers, and when slowed down or sped up it looks really weird. Ideally, I would be able to change the duration of the animation, but have the bounce act at "normal" speed.

I was thinking of maybe pre-composing all the non-bounce layers and having their time remapping linked to a duration slider, and then somehow editing the bounce expression to activate earlier or later depending on the duration slider, but I'm not even sure that's possible. For reference I'm using Ian Haigh's Ease and Wizz bounce expression from aescripts.

Any help you could offer would be appreciated!

Return to posts index

Dan Ebberts
Re: Time remapping w/o affecting a bounce expression
on Oct 26, 2016 at 12:56:03 am

I suspect that's possible. I think it would involve manipulating the timing and bounce parameters for the bounce function. As I recall, the ease functions are right at the top of the code, so it shouldn't be hard to find, but you'll have to reverse engineer it to figure out what you need to manipulate based on time remapping duration. Alternatively, you could craft your own bounce expression. A bit of work in either case...


Return to posts index

Emmett Fraser
Re: Time remapping w/o affecting a bounce expression
on Oct 27, 2016 at 7:10:24 pm

Thanks for the response Dan!

I've gone the route of working on my (rather, your) bounce expression and I can't seem to make it work. My code is pasted below.

What I did was create a ts variable that pulls from my "time scale" control. If time scale = 2 everything should go twice as fast (except for the bounce). Then I divided the key(n).time values by ts, thinking that would make the bounce expression kick in twice as early.

Where I think I get out of my depth is in the velocity calculation. I divided key(n).time by ts in the velocityAtTime code but that didn't seem to help.

Finally I modified the else expressions to adjust with the time scale as well (but I'm 99% sure that's not the problem.)

Any help you could provide would be greatly appreciated!

e = .7;
g = 2500;
nMax = 9;
ts = comp("_controller").layer("Controller").effect("time scale")("Slider")

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

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved