Alright Matt, here is how I envision this. Assuming that scale is applied, based on the image sample, I guess anchor point is set to the top of the layer. Anyways, if not, here is the whole idea breakdown:
1. In the comp, create null layer, name it ‘control’ .
2. Apply Slider effect and name it ‘y-offset’. This will control the gap distance.
3. Assuming all text layers in the project panel are placed on after another:
ONE
TWO
THREE
Apply this expression to the anchor point for all layers:
sourceSize = thisLayer.sourceRectAtTime(time, false);
T = sourceSize.top;
L = sourceSize.left;
W = sourceSize.width;
H = sourceSize.height;
([L+ W/2,T+0])
That way, we will get full layer height value in position expressions.
4. For second and third layer’s positions, apply this expression:
yDiff = thisComp.layer("control").effect("y-offset")(1); //Gap distance between the lines
y = thisComp.layer(index-1).transform.position[1]; //Previous layer Y position
s = thisComp.layer(index-1).transform.scale[0] / 100; //Scale ratio
h = thisComp.layer(index-1).sourceRectAtTime(time, false).height; //Previous layer height
[value[0], y + s*h + yDiff]
First layer’s Y position will stay constant, others will accommodate. Change control layer’s ‘y-offset’ to set desired gap.
Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Social Media Profiles