Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Lining up images in after effects using expressions

  • Lining up images in after effects using expressions

    Posted by Kerovisuals on November 21, 2005 at 11:00 am

    What I’m trying to do is create a composition which consists of a line of images which scrolls along the bottom of the screen. Because there is over 1000 images I was wondering if anyone knew of a way of lining them up (horizontally) with a 3 pixel gap in between each image using expressions.

    Mike Clasby replied 20 years, 6 months ago 3 Members · 2 Replies
  • 2 Replies
  • Steve Roberts

    November 21, 2005 at 2:43 pm

    You could try using the align & distribute palette. Make a comp that is the width of 1000 images + 999 X 3 pixels wide, then place one image at the start, one at the end, select them all, then hit the button that distributes the images by left edge. That should work.

    If you’re keen on expressions, try using this layer index-based expression for each layer’s position:

    [width/2*(2*index-1) + (index-1)*3, position[1]]

    or:
    xPos=width/2*(2*index-1);
    AddGap=(index-1)*3;
    [xPos + AddGap, position[1]]

    Apply it to the first layer, select the property (position), then edit>copy expression only. Then select the other layers and select edit>paste.

    For flexibility, I might tie the 3 value to a slider.
    Dan will probably come up with something cleaner. 🙂

    Steve

  • Mike Clasby

    November 21, 2005 at 5:28 pm

    You might give this a look:

    https://www.motionscript.com/mastering-expressions/follow-the-leader.html

    Halfway down the page is setting up followers at a specific distance:

    A Completely Different Approach
    and
    Follow the Null

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