-
Laying out layers with set gaps and random scale
Hi all,
I’ve got this to work fine; sits on the position of each layer.
total = 0;
for (i = 1; i<=(index); i++) { total += thisComp.layer(i).width * (thisComp.layer(i).scale[0]/100) } total += 20; //gap in pixels [total, 300] The problem is it only works when the anchor point is 0 on the x axis. I want the objects to scale from the centre of the object - not the edge. I've figured that the maths is something like this: total += ((thisComp.layer(i).width * (thisComp.layer(i).scale[0]/100))/2) + ((thisComp.layer(i-1).width * (thisComp.layer(i-1).scale[0]/100))/2) But it doesn't seem to work... :o( Any help? James