FORUMS: list search recent posts

A script to move a layer 10 pixels every 10 frames?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jon Melot
A script to move a layer 10 pixels every 10 frames?
on Oct 28, 2015 at 2:24:59 pm

Hi all,

I've got a wide screen image (5446 pixels) in a 720 comp. I'm wondering if there's is a way to use a script to move the image 10 pixels to the left every 10 frames. I had been doing this by hand and then replacing the keyframes with "hold keyframes", but I figure there must be a better way. I don't want fluid movement, just something really jerky.If I could make it loop, that would be awesome, but first things first!

Any ideas?


Return to posts index

Cassius Marques
Re: A script to move a layer 10 pixels every 10 frames?
on Oct 29, 2015 at 12:51:45 pm

why a script? can't you just add an expression?

create two keyframes 10f and 10px apart, hold them(by ctrl+alt clinking) then alt click the stopwatch (to add an expression) and write:

loopOut("offset")


Return to posts index

John Cuevas
Re: A script to move a layer 10 pixels every 10 frames?
on Oct 29, 2015 at 3:35:56 pm

And after seeing the perfect response from Cassius, here's a much more complicated way of doing it. Expression to the position property:

x = transform.position[0];
y = transform.position[1];
myTime = timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false);
myCondition = myTime % 10;
timeDown = myTime - myCondition

if (myCondition == 0) ([x,y]) - [myTime,0] else [x-timeDown,y]


Johnny Cuevas, Editor
ThinkCK

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.


Return to posts index

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