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

Trouble With Auto-Sizing Text Box

Participant ,
Apr 01, 2022 Apr 01, 2022

I've used these expressions before with no trouble but clearly something is different this time. I've tried adding it to all the different Scale and Size properties within the Box layer but they all either extend left to right forever or they scale wrong. Either it's growing too fast, or it shrinks as I type. Can anyone spot what is causing this?

Capture.PNG

Capture 1.PNG

  

TOPICS
Error or problem , Expressions
545
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 2 Correct answers

Community Expert , Apr 01, 2022 Apr 01, 2022

It looks like your x scale for the layer is set to -4674.3. Maybe that's the issue?

Translate
Participant , Apr 01, 2022 Apr 01, 2022

Yes I think that had something to do with it. I created a new rectangle from scratch and was able to get it to work by changing the value in parenthesis of the expression for sourceRectTime to 2 so it didn't get thrown off by the animation at the beginning. And the new text box doesn't have such an extreme x value. Initially, I tried a new approach which created groups within the layer and I think that got messed up.

Translate
Participant ,
Apr 01, 2022 Apr 01, 2022

Also, should have maybe added the expressions I used-

 

s=thisComp.layer("Your Text Title Name Here");

 

w=s.sourceRectAtTime().width;

h=s.sourceRectAtTime().height;

 

[w,h]

 

Also tried -

 

dname=thisComp.layer("name").sourceRectAtTime(time).width;

Value+[dname,0]

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 ,
Apr 01, 2022 Apr 01, 2022

Have you tried applying the expression to rectangle path's Size property?

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
Participant ,
Apr 01, 2022 Apr 01, 2022

Yes. Something is throwing it off. I'm wondering if it has to do with the animation I added.

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
Participant ,
Apr 01, 2022 Apr 01, 2022

This is another attempt, this should be the size of my text but this is what I get.

Capture2.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
Participant ,
Apr 01, 2022 Apr 01, 2022

A slightly different expression creates an infinite width

Capture3.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 ,
Apr 01, 2022 Apr 01, 2022

In your other posts, it looks like you have adjusted the scale values of both the box's group and layer transforms. Is that still the case?

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
Participant ,
Apr 01, 2022 Apr 01, 2022

Here are the current values

Capture5.PNG

Capture4.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 ,
Apr 01, 2022 Apr 01, 2022

It looks like your x scale for the layer is set to -4674.3. Maybe that's the issue?

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
Participant ,
Apr 01, 2022 Apr 01, 2022
LATEST

Yes I think that had something to do with it. I created a new rectangle from scratch and was able to get it to work by changing the value in parenthesis of the expression for sourceRectTime to 2 so it didn't get thrown off by the animation at the beginning. And the new text box doesn't have such an extreme x value. Initially, I tried a new approach which created groups within the layer and I think that got messed up.

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