Forums › Adobe After Effects Expressions › Move layer x pixels every nn frames
Move layer x pixels every nn frames
Navarro Parker
January 20, 2016 at 11:04 pmwould 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.
Dan Ebberts
January 20, 2016 at 11:25 pmThis should work:
tStep = framesToTime(12);
jumpX = 10;
nSteps = Math.floor((time-inPoint)/tStep);
value + [nSteps*jumpX,0]Dan
Mikhail Vasilev
January 21, 2016 at 11:44 amHi Dan.
And how about random time and distance intervals ?
And smooth(ease) movement? : )ido shor
July 31, 2016 at 2:10 pmit would be great if you can add a smooth interpolation between “keyframes” to this expression.
Dan Ebberts
July 31, 2016 at 6:10 pmMaybe 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
ido shor
July 31, 2016 at 6:20 pmTnx…. works like a charm. 🙂
Víctor Sanz
May 22, 2020 at 4:28 pmThat’s sweet. It would be posible to add a pause between those jumps??
Thank youDan Ebberts
May 22, 2020 at 5:35 pmLike 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
Víctor Sanz
May 22, 2020 at 7:53 pmIt works perfectly!! Thank you very much Dan. Cheers
Log in to reply.