Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Define a range of value for a position

  • Define a range of value for a position

    Posted by Julien Mercier on February 24, 2022 at 1:43 am

    Hi all,
    I am trying to create an expression that would change the intensity of a sharpen effect according to the position (or even better, anchor point) of a layer.
    Basically I would use an “if/else” expression that would look like this :

    if(thisComp.layer(“Nul 2”).transform.xPosition==[959.9,960.1]){

    0;

    }else{

    20;

    }

    ;

    As you can see I want the intensity to be set at 0 between 959.9 and 960.1, otherwise to be set at 20.
    It works with only one value but I don’t know how to create a range of value.
    Thanks !
    Julien

    Dan Ebberts
    replied 4 years, 6 months ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    February 24, 2022 at 8:01 am

    Like this maybe (note that I left “Nul 2” spelled the way you have it):

    x = thisComp.layer("Nul 2").transform.xPosition;

    if(x >= 959.9 && x <= 960.1){

    0;

    }else{

    20;

    }

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