Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Opacity of Layer 1 driven by Position of Layer 2

  • Opacity of Layer 1 driven by Position of Layer 2

    Posted by Johnnyfix on April 29, 2007 at 11:25 pm

    THis might be a no brainer, but I can’t seem to find a solution of my own.

    Okay, I have a column of ‘buttons’ that I have pushing forward in z-space. Their forward movement is being driven by an expression that affects tthe each button layer based on the proximity of a null.

    I also have a text layer for every button. each text layer is parented to the position value of it’s respective button layer.

    What i want is acheive is a set up so the text’s opacity shifts from 0 to 100 as it’s parent button layer is offset in z space, then back down to 0 as the button returns to it’s original position.

    Put another way: when button’s Z value is 0, then text’s opacity is 0,
    but when button’s value is 30 (or possibly 60), then text’s opacity is 100.

    I hope this makes sense. Any help or ideas would be awesome. Thanks!

    Lord Scales replied 19 years ago 2 Members · 3 Replies
  • 3 Replies
  • Lord Scales

    April 29, 2007 at 11:37 pm

    [johnnyfix] “Put another way: when button’s Z value is 0, then text’s opacity is 0,
    but when button’s value is 30 (or possibly 60), then text’s opacity is 100.”

    I would do:

    x = thisComp.layer(“name”).transform.position[2]
    linear (x, 0, 30, 0, 100)

    So, as the value of “x” changes from 0 to 30, the opacity changes from 0 to 100 in a linear interpolation.

  • Johnnyfix

    April 30, 2007 at 12:22 am

    Thank you so much.

    This works perfectly.

  • Lord Scales

    April 30, 2007 at 12:36 am

    You are welcome!

    There are some variations of it:
    x = thisComp.layer(“name”).transform.position[2]
    ease (x, 0, 30, 0, 100)

    x = thisComp.layer(“name”).transform.position[2]
    easeIn (x, 0, 30, 0, 100)

    x = thisComp.layer(“name”).transform.position[2]
    easeOut (x, 0, 30, 0, 100)

    In ease, when the value of x is 0, the velocity is 0 and when the value of x is 30, the velocity is 0 also.

    In easeIn, when the value of x is 30, the velocity is 0 and in easeOut, when the value of x is 0 the velocity is 0.

    Lord Scales

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