Skip to main content
chrisj4220033
Participant
February 16, 2023
Answered

sourceRectAtTime() height is not updating when i change font size

  • February 16, 2023
  • 2 replies
  • 705 views

Hi, I have a problem with sourceRectAtTime() I'm trying to parent shape layer to the top edge of  the text layer with some offset and its working when Im adding another line of text or when i change leading, but when i change font size the position of the shape layer doesnt change. Someone know how to fix it?

 

https://streamable.com/wephkj

 

anchor point text layer expression:

 

left = sourceRectAtTime().left;
top = sourceRectAtTime().top;
width = sourceRectAtTime().width;
height = sourceRectAtTime().height;
x = 0;
y = top + height;
[x,y]

 

anchor point shape layer expression:

 

left = thisComp.layer("text").sourceRectAtTime().left;
top = thisComp.layer("text").sourceRectAtTime().top;
width = thisComp.layer("text").sourceRectAtTime().width;
height = thisComp.layer("text").sourceRectAtTime().height;
x = 0;
y = top + height;
[x,y]

 

This topic has been closed for replies.
Correct answer Mathias Moehl

By the way, you can also do these kinds of parenting very easily with my (paid) extension Pins & Boxes.

Just create a pin at the top center of the text layer and then parent your shape layer to it.

 

2 replies

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
February 17, 2023

By the way, you can also do these kinds of parenting very easily with my (paid) extension Pins & Boxes.

Just create a pin at the top center of the text layer and then parent your shape layer to it.

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mylenium
Legend
February 17, 2023

All your references use reserved keywords, which throws off the expression engine. You cannot arbitrarily use words like "height", "width" and so on because by default they refer to specific layer properties. Rename your variables to be  unique, e.g. by adding a suffix and using Dvorakian notation: mHeight, mTop, mWidth, mLeft etc..

 

Mylenium

chrisj4220033
Participant
February 17, 2023

ok I will try