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

How to adapt the autoscale text box expression

New Here ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

I can't seem to get the source rect expression to work for the text boxes I'm using in my project.

My project is 1080x1920, and I've been manually resizing my text boxes to slide out from the left before text animates left to right across each slider using the typewriter effect. Timing is matched to a voiceover and this is how they look:

source rect.jpg

How do I create these sliders so they auto resize from left to right only? The text boxes must expand with the text across the page while height remains consistent.

 

I've been manually resizing each slider. They are twice the length shown and centred to the left hand side of the page. Happy to include a video example too if that helps understand my requirement?

 

Thanks for the help

Linda

TOPICS
Expressions , How to , Scripting

Views

1.4K

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
LEGEND ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

If they are parametric shape layer rectangles, you may simply need to subtract the center position. It's really not clear what you mean since you haven't provided any screenshot of the timeline with the relevant properties open nor the expression code you're actually using.

 

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 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Thanks Mylenium, I haven't used any expressions for the text boxes yet. I've been manually resizing each slider but would like to find a quicker solution. Here is a screenshot of the layers to show how I've been keyframing them:

Text Box Sliders.jpg

They're timed to sync with a video layer underneath.

Thanks again

Linda

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
LEGEND ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Something liek this perhaps:

 

Position:

 

xRef=thisComp.layer(index-1);
xSize=xRef.sourceRectAtTime();

X=xSize.width;
Y=value[1];

[X,Y]

 

Anchor Point:

 

xSize=thisLayer.property("Rectangle 1").property("Rectangle 1").size;

X=-xSize+0.5;
Y=value[1];

[X,Y]

 

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 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Would both these expressions go on the text box (Slider) layer? When I paste the anchor point expression, I get an error:

Text Box Sliders error.jpg

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
LEGEND ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

My bad:

 

xSize=thisLayer.property("Rectangle 1").property("Rectangle Path 1").size;

X=-xSize+0.5;
Y=value[1];

[X,Y]

 

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 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

I'm not entirely sure where to put these expressions and I still get an error. I feel my problem is way more complicated than my understanding of the software. Would it be better if I attach a short video to show how they currently work? You might have a different solution when you see how I have them working at the moment.

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 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Have you considered using my (paid) extension Pins & Boxes?

Here is a tutorial showing how to create boxes with a fixed height:



 

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
New Here ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Would I be able to add a rounded edge, extra buffering on the left of the text and would they be able to autosize with text that has the typewriter effect? I am interested in any plugin that can do this. Thanks!

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 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

LATEST

Yes, you should be able to do that.

- since the boxes are based on shape layers, you can use the normal corner roundedness control of shape layers rectangles
- the boxes have a separate margin control for top, left, right and bottom. Hence, you can simply add a larger margin on the left.

- The box auto-resizes when the text changes. Only in the unlikely case that the typewriter expression does not actually change the text but just sets the opacity of some letters to 0%, the source rect won't change and hence Pins & Boxes won't notice it. But if your typrwriter expression acts on the source text, it should work.

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