Download Project File

How to Get Correct Text Layer Size in After Effects

How to Get Correct Text Layer Size in After Effects

Code

CODE FOR WIDTH:
targetLayer = thisComp.layer("Layer Name");

w = targetLayer.sourceRectAtTime().width;
s = targetLayer.transform.scale[0];
p = (s – 100)* .01;
finalSize = w + p * w;

finalSize

CODE FOR HEIGHT:
targetLayer = thisComp.layer("Layer Name");

h = targetLayer.sourceRectAtTime().height;
s = targetLayer.transform.scale[1];
p = (s – 100)* .01;
finalSize = w + p * h;

finalSize

Download Project File

About the author:

Sergei Prokhnevskiy

Sergei Prokhnevskiy is a Charlotte, NC based motion graphics designer, an online tutor, an entrepreneur, and Adobe MAX Master Speaker. Sergei is known for his quick and practical After Effects tips and tricks on YouTube, where he generated well over 6 million views on his tutorials. He has authored an online video course on After Effects Expressions and developed scripts for After Effects. He is also a former senior motion graphics designer at Fox Sports where he worked on graphics for NFL, Super Bowl, MLB, World Series, College Football, NASCAR, Women’s World Cup, and NASCAR Race Hub. He is very passionate about learning and teaching others.

5 FREE TIME-SAVING TOOLS

Over 100,000 downloads & counting!

These 5 After Effects tools will seriously speed up your workflow and save you hours of wasted time. More than that, they could be the difference between being able to complete a project on time or not!