ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Control speed of comp (time remapping) base on speed of position property

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Frederic Antoinette
Control speed of comp (time remapping) base on speed of position property
on Apr 22, 2018 at 3:48:11 pm

Hi, as the subject says.
I have a fish tail animation inside a comp, and I'd like it to speed up and slow down to normal speed, based on the the velocity at which the fish is moving.
I did found this post that pretty much does it but with the exception that if the body stop moving it also freezes:
https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=7523...

I readapted the code to this, but I'd like to keep going at normal speed if there speed is 0

p = transform.position
dampen = 5000;
//--
dur = this.source.duration;
finalTime = 0;
for( i = 0; i < time; i+= thisComp.frameDuration ){
xVeloc = p.speedAtTime( i )+1;
finalTime += xVeloc/dampen;
}
if( finalTime < 0 )
(dur + finalTime) % dur
else
finalTime % dur


Return to posts index

Dan Ebberts
Re: Control speed of comp (time remapping) base on speed of position property
on Apr 22, 2018 at 5:09:51 pm

Try changing this line:

xVeloc = p.speedAtTime( i )+1;

to:

xVeloc = p.speedAtTime( i ) + dampen*thisComp.frameDuration'


Dan



Return to posts index

Frederic Antoinette
Re: Control speed of comp (time remapping) base on speed of position property
on Apr 22, 2018 at 7:27:32 pm

That did it.
Thanks Dan


Return to posts index

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