Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Grid based format for images but only along separate dimensions for x-axis

  • Grid based format for images but only along separate dimensions for x-axis

  • Daniel LaPack

    October 20, 2021 at 10:51 pm

    I’m very stuck on this. I found on this forum a thread from a user named John Cuevas back in 2012 in which he explained how to make grid-based placements of hundreds of images in a comp from this expression:

    var columns = 10;
    var spaceBetweenLayers = thisLayer.width + 10;
    var x = ((index-1) % columns) * spaceBetweenLayers;
    var y = Math.floor((index-1) / columns) * spaceBetweenLayers;
    var origin = [40,50];
    origin + [x,y]
    Found here:

    However, this does not work for the project I am working on. I have about 470+ images in 3D space that I have falling downwards into a white background through ‘z-position’ via “Separate Dimensions”. I set it up this way so I could just copy and past the z-position keyframe animation of all the images falling via their z-position and not have to manually change the x and y coordinates each time. The problem is this code doesn’t work for just x or y positions as separated dimensions. I receive this error: “Error: expression result must be of dimension 1, not 2.” for this line of code: “var columns = 10;”

    Is there any way around this, or any other way to accomplish this?

    Thank you so much for any help you can give me!

    Zoom out to show hundreds of images or layers?

  • Dan Ebberts

    October 20, 2021 at 11:37 pm

    Just change the last line to this for x:

    (origin + [x,y])[0]

    and this for y:

    (origin + [x,y])[1]

Viewing 1 - 2 of 2 posts

Log in to reply.

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