Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking range – Height Scale to Y Position

  • Linking range – Height Scale to Y Position

    Posted by Saber Na on August 7, 2017 at 7:04 pm

    Hi, I’m trying to make the white triangle’s height to follow the yellow triangle’s Y position. I’ve tried this script but it is not working. Any help would be greatly appreciated.


    temp = thisComp.layer("Shape Laye 2").transform.position[1]*-100/350+174;
    [transform.scale[0], temp]

    Andrei Popa replied 8 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Andrei Popa

    August 8, 2017 at 9:46 am

    I made it this way. On the anchor property of your size-modifiyng layer add the expression

    temp = thisLayer.sourceRectAtTime(time,false).height/2;
    [value[0],temp]

    and on the size position (Rectangle 1>Rectangle path 1> Size) addd the expression

    temp = (thisComp.layer("Shape Laye 2").transform.position[1]*-1 + height)/2;
    [value[0], temp]

    replace “height” with the starting coordinates of your layers, or align the size-modifiyng layer to the bottom of the composition. I added an image for easier understanding.

    Andrei

  • Saber Na

    August 8, 2017 at 7:10 pm

    Wow! Thank you very much Andrei, it works exactly the way it should!

  • Andrei Popa

    August 9, 2017 at 9:08 am

    Glad i could help!

    Andrei

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