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

Add value to proximity based scale expression

New Here ,
Jul 01, 2019 Jul 01, 2019

Hello! Thanks for your time!

So, I'm trying to make a square shape layer scale down to 0 once it passes thru a text, so it doesnt cover the text up.

I've got this expression:

  • t = length(position, thisComp.layer("Text").position);
  • s = ease(t, 200, 0, 0, 100);
  • [s, s]

But it only references the text's anchor point, which is in the center. My problem is the square shape layer is multiple (lots of squares going thru) and they will come on a 45 degree angle. So if I adjust the distance from the anchor point which the scaling will begin horizontally, the vertical distance gets too large, and vice versa (except it gets too small for the horizontal once I adjust the distance based on the vertical).

I've figured that if I make 4 layers of the same text, each with an anchor point in the extremities (up, down, right, left) and managed to reference each anchor point to the proximity scaling, it should work the way I wanted, but I dont know how to use 4 values in this expression:

  • t1 = length(position, thisComp.layer("Text").position);
  • t2 = length(position, thisComp.layer("Text 2").position);
  • t3 = length(position, thisComp.layer("Text 3").position);
  • t4 = length(position, thisComp.layer("Text 4").position);
  • s = ease( [t1, t2, t3, t4], 200, 0, 0, 100 );
  • [s, s]

Except the brackets doesnt work. Anyone can give me a light? Maybe there is another way to do it that I`m missing. Sorry for any stupid questions, I`m new to the expressions world...

TOPICS
Expressions
525
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
Explorer ,
Jul 01, 2019 Jul 01, 2019
LATEST

try this

len1 = length(position, thisComp.layer("Text1").position);

len2= length(position, thisComp.layer("Text2").position);

len3 = length(position, thisComp.layer("Text3").position);

len4 = length(position, thisComp.layer("Text4").position);

t = Math.min(len1, len2, len3, len4);

s = ease(t, 200, 0, 0, 100);

[s, s]

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