Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Horizontal scroll from specific starting position

  • Horizontal scroll from specific starting position

    Posted by Gabriel Gama on September 20, 2019 at 1:57 am

    Hello everyone!

    I’m trying to automate scroll of many objects on an horizontal axis, from left to right, and then disappear. The point is that the start position is important to alignment (manual repositioning).

    I used the following expression without success.

    xPos= (time * 150)-175 ;
    yPos = position[1] ;
    [ xPos , yPos ]

    But with this, all my objects start at the same point and also movement is always related to global time which is not good if I want one object to follow another one on an horizontal scroll line.

    Any ideas?

    Gabriel Gama replied 6 years, 11 months ago 2 Members · 3 Replies
  • 3 Replies
  • Scott Mcgee

    September 20, 2019 at 8:03 am

    If I’ve read this right. You want to do something like this.

    Layer 1:
    xPos= (time * 150)-175 ;
    yPos = position[1] ;
    [ xPos , yPos ]

    Layer 2 +:
    padding = SPACE HOW YOU WANT IT;
    xPos = thisComp.layer(index-1).position[0] – thisComp.layer(index-1).sourceRectAtTime().width – padding;
    yPos = thisComp.layer(index-1).position[1] ;
    [ xPos , yPos ]

  • Gabriel Gama

    September 20, 2019 at 5:53 pm

    Almost! Let me try to write it in another way (Maybe I’m didnt explain it correctly)
    Is it possible to make a an object follow a horizontal prefixed path (lets say go 1920 pixels to the right) in 10 seconds?
    This way I cant manually arrange the objects as they move in the timeline!

    I’m trying this with expressions because I have thousands of objects that should follow a linear path, going inside the compostion and the outside (for a 1080p resolution)

    Basically make objects go from left to right in a fixed time, independent of initial position and time duration of the object.

  • Gabriel Gama

    September 24, 2019 at 9:38 pm

    In the end I found a solution for myself!

    veloc = 100;
    x = position[0] + (time - inPoint) *veloc;
    y = position[1];
    [x,y]

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