Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Add values to proximity based expression

  • Add values to proximity based expression

    Posted by Saulo Dal pozzo on July 1, 2019 at 4:33 pm

    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.

    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…

    Andrei Popa replied 7 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Andrei Popa

    July 1, 2019 at 9:39 pm

    Not sure tour 3 text way is the best, but in a lack of solutions, here we go. I think this should work.

    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]

    Andrei
    My Envato portfolio.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy