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!
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]]
Copy link to clipboard
Copied
there you go:
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! 🙂
Copy link to clipboard
Copied
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]]