Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
videoprice
Topic Author
Posts: 1
Joined: Mon Mar 10, 2014 6:19 am

Text layer and expression

Mon Mar 10, 2014 6:27 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: Mon Sep 10, 2007 12:22 pm

Re: Text layer and expression

Mon Mar 10, 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.
 
fahdchishty
Posts: 4
Joined: Tue Jan 06, 2015 10:48 am

Re: Text layer and expression

Wed Jan 07, 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: Sat Jun 26, 2004 10:01 am
Location: Folsom, CA
Contact:

Re: Text layer and expression

Wed Jan 07, 2015 5:18 pm

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

Dan

Who is online

Users browsing this forum: No registered users and 2 guests