Calculating the dimensions of a text or layer

The expression allows you to calculate the dimensions of the text or any other layer. Can be useful for creating a substrate that will automatically change size, depending on the width of the text. Does not work in versions below CC 2014!
title = thisComp.layer("Text Layer") ; // Layer
indW = 10; // Spacing width
indH = 10; // Spacing height
rect = title.sourceRectAtTime(time,false);
x = rect.width+indW;
y = rect.height+indH;
[x,y]
Recommended Posts
