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

Border of Shape Resize depend on text scale

New Here ,
Apr 30, 2020 Apr 30, 2020

In the picture I include, I want to autoscale trim path border depend on text scale like this pic

What is the expression should we do for this? PPic.PNG

TOPICS
Expressions , Resources , Scripting
453
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
LEGEND ,
Apr 30, 2020 Apr 30, 2020

Could be as easy as adding up the four sides of the rectangle and then subtracting the gap and then filtering it through a linear() expression to get the percentages for the Trim Paths operator. Something like this perhaps:

 

mGap=thisComp.layer("Image").width; //image width
mPad=20; //extra padding for image
mRect=content("Rectangle").content("Rectangle Path").size;
mRectLength=(mRect[0]+mRect[1])*2;
mGapLength=mRectLength-mGap-mPad*2;

linear(mGapLength,0,mRectLength,0,100);

 

Where the actual gap appears can easily be controlled with the trim path's offset setting, which in your case would be 50% or something like that...

 

Mylenium

 

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
New Here ,
May 03, 2020 May 03, 2020
LATEST

Thank you! I will try your method 

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