Text layer and expression

Moderators: Disciple, zlovatt

Post Reply
Posts: 1
Joined: March 10th, 2014, 6:19 am

March 10th, 2014, 6:27 am

Hello guys. Need help with expression.
I have 2 layers : Text layer and solid layer.

So, I need then I type a text my solid layer scale automatically in x postion. Thanks a lot guys.

Aaron Cobb
Posts: 10
Joined: September 10th, 2007, 12:22 pm

March 10th, 2014, 9:25 am

This can't be done with an expression alone. You have to use a script to measure and mark the dimensions of the layer, using the AVLayer sourceRectAtTime() function (the scripting docs has the exact syntax). My preferred method to mark the layer is to add a point control to the text layer for the upper left and lower right corners. Then you can either scale the solid using the script, or use an expression to do it.
Posts: 4
Joined: January 6th, 2015, 10:48 am

January 7th, 2015, 7:16 am

sourceRectAtTime() does not work in expressions, only in scripts. For versions CS6 and below there is no property of text with that name that can be accessed through expressions. Look at nab's expression here http://www.aenhancers.com/viewtopic.php?f=6&t=931

Though if you want a workaround then You need to control the x scale of your elements via a slide controller. Make one NULL object as "Width Controller" and on it add Effects>Expression Controls>Slide Controller. Take the x scale of your element (e.g. a rectangle shape behind your text) and pickwhip it to that Slide Controller.
Dan Ebberts
Posts: 319
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA

January 7th, 2015, 5:18 pm

I should point out that the latest version of AE CC 2014.2 (build does support sourceRectAtTime() for expressions.

Post Reply