Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects AE Distribute Layer not distributing evenly

  • AE Distribute Layer not distributing evenly

    Posted by Claire Presnall on March 11, 2025 at 8:52 pm

    I’m trying to distribute layers horizontally based on the center points of each layer with the goal to have evenly spaced layers with the same gap between them no matter what the width of the layer. Normally that’s a simple click of the “distribute horizontally” button in the align panel, but not today.

    I’ve attached 2 screen shots to show what I’m dealing with. I would like all the little rectangles to evenly distribute blue-green-blue-pink-blue-green etc. I want the blue squares centered between the green and pink evenly on both sides, but instead they’re hugging the pink rectangles. I did a little alt replace and it looks like the distribute is considering the width of the the pink to be the width of the green as well. These are solids created in AE to be the size of the layer precomps I’m using.

    Even if I just grab 1 green, 1 blue, 1 pink and say “distribute” only these 3 layers, the blue one hugs the pink one vs settling halfway between them.

    My original pieces were out of Illustrator and distributed just fine in a shorter comp, but when I went to duplicate it into this wider comp, it just all went to hell, and now even the shorter comp is distributing this way. I’ve done all the usual restarting and stuff (haven’t reset my preferences because I don’t want to have to re-set them up).

    I do this process literally EVERY day with layers of various sizes,
    scales, types, etc. 99.99% of the time they distribute with even spacing
    between each layer, just like I want it. Periodically I’ve gotten the
    issue that’s plaguing me today, but it’s been forever, and I think my
    previous solution was brute force, I just don’t
    remember because distribute layers has been working beautifully for me
    for years (including this morning).

    I’ve begged the adobe gods (and cursed them), and I’m moving on to other work and letting this project sit and think about what it’s done while I await you gurus to bless me with the secret box that I’ve accidentally checked/unchecked so I can feel like a dope for how easy the solution is, put it on a post-it for future me, and get about my day.

    I’m on a 2019 MacPro running AE24 (most updated before you switch to AE25).

    TIA!!

    Claire Presnall replied 1 month, 1 week ago 3 Members · 9 Replies
  • 9 Replies
  • Graham Quince

    March 12, 2025 at 11:28 am

    Best guess is the anchor point for each coloured shape is not in the center of the shape, so that when you use the align tools they are thrown off. I just did a quick experiment with shape layers and the repeater, but to be honest it ended up being a lot of maths and manual adjustment.

    See if the anchor resolves it, if not try precomping one set of layers and duplicating that. At least you’ll get even spacing 🙁

  • Claire Presnall

    March 12, 2025 at 2:35 pm

    Thanks for the suggestion, but these are individual solid layers created by ctrl+y inside the precomps for the offending layers to make sure they’re the size I want then drug into a fresh comp. The anchor points on all layers are centered to the individual layer. The layers are stacked in the order I want them to appear left at the bottom to right at the top of the comp layer stack. This is how I usually get the results I want, and I’m not sure why it’s treating the green solids as if they’re the same width as the pink ones.

    Honestly, it’s kind of like it’s equal spacing the blue then spacing the green & pink between them which is how we end up with the green getting enough space to replace it with a pink solid. However, if I delete all the blue layers, we still end up with the same spacing distribution.

  • Graham Quince

    March 12, 2025 at 3:52 pm

    That is strange. If you’re happy to share your project, I could take a look and see if I can spot anything.

    If you’d rather not post it here, drop me a line: shiveringc then there’s an AT and then gmail.com

    (Will that fool the spammers??)

  • Vasyl Iskovych

    March 12, 2025 at 7:28 pm
  • Claire Presnall

    March 12, 2025 at 7:37 pm

    I’ll try and clean a project file up to share after I get these other more cooperative jobs on my list done. Thanks!

  • Claire Presnall

    March 12, 2025 at 7:40 pm

    Thanks! That looks like it does exactly what I need!

  • Claire Presnall

    March 13, 2025 at 3:16 pm

    Hi Graham! Here’s a project with my solids. I have the comp with the distribute all wonky. I also created a 1/8 width precomp where I did the math and hand spaced my solids evenly like I’d like them to be, then dropped that into a fresh 100% width comp and lined those up so you can see what I’m going for.

    Luckily, yesterday they changed the art so this hand-spaced precomp solution should work for me to meet my deadline (hurray), but I would LOVE to figure out what is going on so I can fix it next time.

    Thanks for taking a look!

  • Graham Quince

    March 13, 2025 at 5:26 pm

    Wow – I’ve figured out what’s happening, but it’s an odd one.

    The anchor points are being aligned and distributed. But the distribution does not take into account different layer widths.

    I don’t know if these examples will help explain, but in the checkerboard pic, I arranged the red solid to be positioned at 0 pixels on the X axis. 1920 for the green. And then used distribute to place the blue.

    The blue square appears closer to the red, but it’s position is 960.

    On the black background I added shape layer circles in the same positions as each solid’s anchor point, then placed a black solid underneath. They are evenly distributed.

    The only way I can figure a non-manual solution is to use an expression. I’ve just put this together:

    var distance = 20;

    var solidBelow = thisLayer.index+1;

    var Y = value[1];

    var layerBSize = thisComp.layer(solidBelow).width*thisComp.layer(solidBelow).scale[0]/100;

    var LayerSize = thisLayer.scale[0]/100*thisLayer.width;

    var X = thisComp.layer(solidBelow).position[0]+layerBSize/2+distance+LayerSize/2;

    [X,Y]

    Distance is the gap between this solid and the previous one.

    You should be able to paste this onto each solid’s position and they will respond accordingly. You could also create a null with sliders and control each colour’s gap through that.

  • Claire Presnall

    March 13, 2025 at 5:48 pm

    Thanks Graham! You described exactly what it felt like was happening, but WHYYYYYYY!!!!! All I can say is “Adobe gotta Adobe” (sad trombone). 🤷‍♀️

    Thanks for taking the time to investigate. Good to know I haven’t completely lost my mind. And thanks for the script! Still baffled why it suddenly started misbehaving after years of acting right. Maybe this is one of those Adobe wants me to switch to 2025 and is slowly breaking 2024 like they do sometimes.

    Have a great rest of your week!

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