• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

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]

 

TOPICS
Expressions , Scripting

Views

498

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 17, 2023 Feb 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.

 

Votes

Translate

Translate
LEGEND ,
Feb 17, 2023 Feb 17, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 17, 2023 Feb 17, 2023

Copy link to clipboard

Copied

ok I will try

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2023 Feb 17, 2023

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines