Hi Benjamin,
give this expression to the layer’s position:
[value[0],thisComp.height/2];
and this expression to the layer’s anchorPoint:
posterizeTime(0);
l=thisLayer;
// upperbound:
for (i=0; i<l.height; i++) {
samp = l.sampleImage([l.width/2, i+0.5], radius = [l.width, .5], postEffect = true, t = time);
if (samp[3]!=0) break;
}
upper = i;
// lowerbound:
for (i=height; i>upper; i--) {
samp = l.sampleImage([l.width/2, i-0.5], radius = [l.width, .5], postEffect = true, t = time);
if (samp[3]!=0) break;
}
lower = i;
[value[0], (upper+lower)/2];
Mind you: it doesn’t work if your text and images fall outside of the bounds of the original Precomp, let me know if that would be a problem.