ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Move layer x pixels every nn frames

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Navarro Parker
Move layer x pixels every nn frames
on Jan 20, 2016 at 11:04:55 pm

would like to move my layer's position by an artbitrary amount of pixels in +x direction in a certain period of time.

Ideally, it would go something like this: Every half second, add nn to the x position of a layer using hold interpolation.

Or every 12 frames, jump the position xx pixels to the right.

So there would be a continuous progressive jumpy scroll to the right.


Return to posts index

Dan Ebberts
Re: Move layer x pixels every nn frames
on Jan 20, 2016 at 11:25:03 pm

This should work:

tStep = framesToTime(12);
jumpX = 10;
nSteps = Math.floor((time-inPoint)/tStep);
value + [nSteps*jumpX,0]


Dan



Return to posts index

Mikhail Vasilev
Re: Move layer x pixels every nn frames
on Jan 21, 2016 at 11:44:12 am

Hi Dan.
And how about random time and distance intervals ?
And smooth(ease) movement? : )


Return to posts index


ido shor
Re: Move layer x pixels every nn frames
on Jul 31, 2016 at 2:10:55 pm

it would be great if you can add a smooth interpolation between "keyframes" to this expression.


Return to posts index

Dan Ebberts
Re: Move layer x pixels every nn frames
on Jul 31, 2016 at 6:10:20 pm

Maybe like this:

tStep = framesToTime(12);
jumpX = 10;
t = time - inPoint;
nSteps = Math.floor(t/tStep);
phase = t-(tStep*nSteps);
e = ease(phase,0,tStep,0,jumpX);
value + [nSteps*jumpX + e,0]



Dan



Return to posts index

ido shor
Re: Move layer x pixels every nn frames
on Jul 31, 2016 at 6:20:29 pm

Tnx.... works like a charm. :)


Return to posts index


Víctor Sanz
Re: Move layer x pixels every nn frames
on May 22, 2020 at 4:28:01 pm

That's sweet. It would be posible to add a pause between those jumps??
Thank you


Return to posts index

Dan Ebberts
Re: Move layer x pixels every nn frames
on May 22, 2020 at 5:35:50 pm

Like this maybe:


tStep = framesToTime(12);
tPause = framesToTime(10);
jumpX = 10;
t = time - inPoint;
nSteps = Math.floor(t/(tStep+tPause));
phase = t-((tStep+tPause)*nSteps);
e = ease(phase,0,tStep,0,jumpX);
value + [nSteps*jumpX + e,0]



Dan



Return to posts index

Víctor Sanz
Re: Move layer x pixels every nn frames
on May 22, 2020 at 7:53:52 pm

It works perfectly!! Thank you very much Dan. Cheers


Return to posts index

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