• 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 Make a Text Object Automatically Increase the Width of a Shape Based on Character Length?

Community Beginner ,
Jul 08, 2017 Jul 08, 2017

Copy link to clipboard

Copied

Are there any expressions or ways to go about setting up a simple lower third composition where the width of a solid fill shape layer can expand and shrink automatically based on the character length of a text object stacked above it? I'd really like to be able to setup a dynamically expanding and contracting lower third title comp but am struggling with the challenge of figuring out how to create it. Any suggestions are greatly appreciated. Thanks!

Views

484

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

LEGEND , Jul 15, 2017 Jul 15, 2017
There needs to be some padding around lettering. Any ideas?

of course. just add a padding factor. for example: 50 pixels

s=thisComp.layer("Hello people");

x=s.sourceRectAtTime(time-s.inPoint,true).width+50;

y=s.sourceRectAtTime(time-s.inPoint,true).height;

[x,y]

or this:

t=thisComp.layer("text");

padding=50;

x=t.sourceRectAtTime(time-inPoint,true).width+padding;

[x,value[1]]

Votes

Translate

Translate
LEGEND ,
Jul 08, 2017 Jul 08, 2017

Copy link to clipboard

Copied

there you go:

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 Beginner ,
Jul 14, 2017 Jul 14, 2017

Copy link to clipboard

Copied

Thanks Roei,

This is extremely helpful. Almost exactly what I'm looking for, however, I need the background rectangle to extend a bit of negative space around the text itself in order to use this technique as a lower third. I wonder if anyone knows how to modify this expression to make the rectangle slightly larger than the text itself. There needs to be some padding around lettering. Any ideas? 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
LEGEND ,
Jul 15, 2017 Jul 15, 2017

Copy link to clipboard

Copied

LATEST
There needs to be some padding around lettering. Any ideas?

of course. just add a padding factor. for example: 50 pixels

s=thisComp.layer("Hello people");

x=s.sourceRectAtTime(time-s.inPoint,true).width+50;

y=s.sourceRectAtTime(time-s.inPoint,true).height;

[x,y]

or this:

t=thisComp.layer("text");

padding=50;

x=t.sourceRectAtTime(time-inPoint,true).width+padding;

[x,value[1]]

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