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

Change Size of Shape Layer based on Text Layer

Community Beginner ,
Sep 21, 2017 Sep 21, 2017

Copy link to clipboard

Copied

Hey guys,

I'm looking for an expression (preferably) to change the width of a plain ol' black rectangular box that's sitting beneath a layer of text. The text layer is going to change length, and I therefore need the black box to adjust with the text and change length accordingly. I'm sure there's a simple way to do this, but I've been fighting a cold all week and my brain is a little fried.

Any suggestions?

Views

9.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

correct answers 1 Correct answer

Community Expert , Sep 21, 2017 Sep 21, 2017

There's a (relatively new) expression function that does exactly this: "sourceRectAtTime"
SourceRectAtTime() Expression- Adobe After Effects tutorial - YouTube

Votes

Translate

Translate
Community Expert ,
Sep 21, 2017 Sep 21, 2017

Copy link to clipboard

Copied

There's a (relatively new) expression function that does exactly this: "sourceRectAtTime"
SourceRectAtTime() Expression- Adobe After Effects tutorial - YouTube

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 ,
Sep 21, 2017 Sep 21, 2017

Copy link to clipboard

Copied

LATEST

Hi Kyle,

Thanks! Your link was helpful. This is what I ended up with:

theTextLayer = thisComp.layer("TEXT");

p = 50;

box = theTextLayer.sourceRectAtTime(time);

x = box.width + (p*2);

y = 150;

[x,y]

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