Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
israelu
Topic Author
Posts: 2
Joined: Wed Nov 12, 2014 4:26 pm

Tying layers positions to other layers positions and scale

Thu Nov 13, 2014 12:26 pm

Hello,
I truly hope someone can help me. I've been using AE for many years, but when it comes to expressions, I'm an absolute noob (I can pickwhip - that's about it).

I've been charged with building a tool kit for a bunch of IPM (lower thirds, basically) assets - meaning automating the build for non-designers to be able to edit. There's a long string of elements that need to move, and in some instances scale in relation to one another. More specifically, there's a bar underneath everything that will need to scale to the layout length (which I believe I might have workable code for), but on top of that, there's a string of type and shape layers that need to adjust their positions (and in the case of the shape layer - scale). Everything needs to push out from right to left as type elements change. Specifically, at the extreme right is the time expressed as Pacific and then Central, the length of the time will affect the placement of a box (shape layer), who's length is dependent on the the type contained in it. There's then another line of type whose placement is based on the left edge of the box.

I'm at an absolute loss, and would be tremendously appreciative of any help anyone can send my way

Thank you so much
 
fahdchishty
Posts: 4
Joined: Tue Jan 06, 2015 10:48 am

Re: Tying layers positions to other layers positions and sca

Wed Jan 07, 2015 7:09 am

Seems like you need to know the size of text layer to resize the elements associated with it.
nab was working on an expression using sampleImage() which determines the size of your text layer (after which you can resize your elements).
You can find the discussion here http://www.aenhancers.com/viewtopic.php?f=6&t=931
But the greatest drawback of that expression is that it is VERY CPU intensive. If you add it to more than one text layer, you can say goodbye to scrubbing on the timeline.

If you are using Adobe CC then there might be a way to work it out via sourceRectAtTime() parameter of text layers, but if you are working in any version lower than that, there is no efficient expression. I have searched quite a lot on this topic.

I was confronted with the same problem while making an editable project for someone else to reuse. After quite some research I found a workaround.
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.

Hope that helps :P

Who is online

Users browsing this forum: No registered users and 2 guests