Moderators: Disciple, zlovatt

Topic Author
Posts: 4
Joined: Tue Feb 28, 2017 4:04 am

Measure text layer with sourceRectAtTime()

Tue Feb 28, 2017 4:15 am

Hey folks,

i'm currently trying to wrap my head around using the sourceRectAtTime() expression to measure any given text layer (selected using layer control) to create a text box. 

The basic functionality works fine, i can create a shape with the exact dimensions. But the positioning of the shape layer doesn't work as expected. I want the shape layer to be dynamic - in the way that i can select any text layer in the comp and make the shape layer have the correct dimensions and positioning to be behind the text layer. 

I used the .top and .left output values the position the shape layer, but the values place the layer somewhere else. I managed to find the correct position subtracting the text layers' position from the top/left values - but whenever i change the source text, it's off again. 

Is there any way to force the width, height and position of the shape layer to always match the text layer? 

Thanks in advance - any help is greatly appreciated

User avatar
Posts: 3
Joined: Fri Nov 04, 2016 11:01 am

Re: Measure text layer with sourceRectAtTime()

Sun Mar 05, 2017 1:39 pm

Do you still need help with this? .top and .left should give you comp-space coordinates. Is there parenting involved or anything else adjusting the text sizing/position? Can you share the expression you're using?

Who is online

Users browsing this forum: No registered users and 4 guests