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

Can anyone help me with this expression?

New Here ,
Jul 07, 2025 Jul 07, 2025

So I have this expression that's supposed to make my shape resize based on the text size. But for some reason, it doesn’t fully cover the text — it only covers part of it. I'm not very experienced with expressions, so I really can't figure out what's wrong. I put this expression in Rectangle Path - Size. Please help.

txt = thisComp.layer("Main Text");

x = txt.sourceRectAtTime(time, false);

txtlong = x.width;

sqwd = thisLayer.width;

t = time;

xPos = easeOut(t, inPoint, inPoint+0.5, 210, txtlong + 210);

[xPos, value[1]]

TOPICS
Expressions
246
Translate
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 , Jul 08, 2025 Jul 08, 2025

From your screen grab, it looks like you have the rectangle scaled to 70%.

Translate
Community Expert ,
Jul 07, 2025 Jul 07, 2025

Is your text scaled to more than 100%? If so, you'll need to adjust your txtlong value to account for that.

Translate
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 ,
Jul 07, 2025 Jul 07, 2025

My text is 100% scaled, so i guess it's not it. I also tried to change font size of my text, but i didnt help either. 

Translate
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 ,
Jul 08, 2025 Jul 08, 2025

The expression is set up to start at a fixed width (210 px) and ease up to that size plus the width of the text. Are you saying that after the animation, the box is too small, or before the animation?

Translate
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 ,
Jul 08, 2025 Jul 08, 2025

Yeah, that's the problem. The box is small after the animation. 
it looks pretty simple to me, but for some reason it just doesn't work. I also have this expession for the position of the shape to have the same position as previous shape, but i dont think it has something to do with the problem. 

Ilya_Redko7338_0-1752006498685.png

 

Translate
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 ,
Jul 08, 2025 Jul 08, 2025

From your screen grab, it looks like you have the rectangle scaled to 70%.

Translate
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 ,
Jul 08, 2025 Jul 08, 2025
LATEST

Yes! That was it. Thank you so much, idk why i didn't think about it. 

Translate
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