Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Simple Position Expression

  • Simple Position Expression

    Posted by Justin Vaillancourt on January 18, 2010 at 4:55 pm

    Hi, I’m sure this is pretty basic, but I searched for it and couldn’t find anything.

    I want to move the position of a layer in either x or y by a defined amount of pixels per second OR

    Have the layer move on the x or y by a defined amount of pixels over the length of the comp

    Any help is much appreciated!

    Thank you
    Justin

    Justin Vaillancourt replied 16 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 18, 2010 at 5:13 pm

    Here’s an expression that will move in the x and/or y direction based on pixel speeds you specify in the first two lines (it’s set up for the positive x direction, but just edit the speeds for different results):

    xSpeed = 100; // pixels per second
    ySpeed = 0;
    t = time – inPoint;
    value + [xSpeed,ySpeed]*t;

    This version is similar, but the first two parameters specify total pixels over the duration of the comp.

    x = 500; // total pixels over comp
    y = 0;
    xSpeed = x/thisComp.duration;
    ySpeed = y/thisComp.duration;
    t = time – inPoint;
    value + [xSpeed,ySpeed]*t;

    Dan

  • Justin Vaillancourt

    January 18, 2010 at 5:17 pm

    Thank you Dan, you’re the best!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy