Text layer and expression

Moderators: Disciple, zlovatt

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

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

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

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

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.
fahdchishty
Posts: 4
Joined: January 6th, 2015, 10:48 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: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

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

Dan
Post Reply