Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Affecting opacity of a layer with the xposition of a null

  • Affecting opacity of a layer with the xposition of a null

    Posted by Liam Morris on February 25, 2017 at 8:20 pm

    Hi at the moment i have a script which effects the opacity of a layer to be at 100% opacity when the xposition of a null is at 3. However when the null position is on 4 i would like the opacity of the layer to go back to 0% opacity.

    this is the script i have currently. Its placed in the layers opacity.

    x = thisComp.layer("Null").transform.position[0]
    linear (x, 2, 3, 100, 0)

    Rob Mcgowan replied 9 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Rob Mcgowan

    February 26, 2017 at 11:17 pm

    How about you test to see if x is less than 3. If it is use linear else set 0. Something like

    x = thisComp.layer(“Null”).transform.position[0];
    if (x<3) {
    linear (x, 2, 3, 100, 0)
    } else {0}

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