Discussion:
align layer with different size
(too old to reply)
b***@adobeforums.com
2008-02-20 12:37:01 UTC
Permalink
need help!
have to distribute a real bunch of layers in one composition, align works fine with layer of same size but unfortunatly i have to use sd and hd layer.
i´am serching for a feature like distribute space (in this case 0) in illustrator? is it possible with an expression/ script?
has someone an idea?
thanks, bernd.
b***@adobeforums.com
2008-02-20 14:59:34 UTC
Permalink
hi rick, thank you - it works. i have changed it for y and everything is ok.

os = 0; //space between layers
pl = index -1;// gets layer above name
ip = thisComp.layer(pl).position[1]; //layer above y value
pw = thisComp.layer(pl).height/2; // half layer above height
w = height/2; //half this layer height
y = os + ip + pw + w;

[value[0],y]

many thanks, bernd
R***@adobeforums.com
2008-02-20 14:28:02 UTC
Permalink
Are you trying to distribute in 3D space?

The align tool compensates for width and height. IOW, if you align top then the top edge of each layer, no matter the size, will be in line.

The distribute tool also works with edges. IOW, if you distribute top, then the top edge of each layer will be evenly distributed between all layers.

I guess I don't understand what you're trying to do. Are you trying to get the same space between layers? I'm guessing that you want to line up each layer so that there is a uniform space between the layers. For example, the left edge of each layer is 10 pixels from the right layer of the next.

If that's what you want to do then this expression should work

os = 10; //space between layers
pl = index -1;// gets layer above name
ip = thisComp.layer(pl).position[0]; //layer above x value
pw = thisComp.layer(pl).width/2; // half layer above width
w = width/2; //half this layer width
x = os + ip + pw + w;

[x, value[1]]

You should be able to figure out how to distribute in Y from this example. Apply to the position property of all but the top layer you wish to distribute.
Loading...