Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Multiple expressions in one property

  • Multiple expressions in one property

    Posted by Gus Favoreto on July 22, 2019 at 8:35 pm

    Hi there!

    I am trying to use 2 expressions in one propertybut I don’t know how to write it correctly.
    I have a SampleImage in the Fill effect, but it is in Y position, but I need change the color in X position, and I don’t know how to have the X.

    How could I use 2 expression in one property?

    This is what I have for Y:

    Thank you,
    Gus

    target = thisComp.layer("Color_gradient");
    colorpicker = thisComp.layer("BUBBLE MASTER");
    target.sampleImage(target.fromWorld(colorpicker.position), [0.2,0.2], true, time)

    Gus Favoreto replied 7 years ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    July 22, 2019 at 8:50 pm

    >but it is in Y position, but I need change the color in X position

    What do you mean by that? How are you using x and y?

    Dan

  • Gus Favoreto

    July 22, 2019 at 9:43 pm

    I have a gradient (blue to red) from the bottom to top that is changing the color when I move in Y position. But I would like to have an Grey area like 20px on the left and when reach some position in X that turns grey.

  • Dan Ebberts

    July 22, 2019 at 10:34 pm

    I’m still a little confused. If there’s an actual grey strip on your gradient, it seems like your expression should work. If you want to force the result to grey when x is less than 20, something like this should work (not tested):


    target = thisComp.layer("Color_gradient");
    colorpicker = thisComp.layer("BUBBLE MASTER").position;
    if (colorpicker[0] < 20){
    [.5,.5,5,1]; // grey
    }else{
    target.sampleImage(target.fromWorld(colorpicker), [0.2,0.2], true, time);
    }

    Dan

  • Gus Favoreto

    July 23, 2019 at 9:01 pm

    Oh, you are right. I just added a grey strip on the left edge and worked perfect.
    But I will use your expression in other situation that I have here ????

    Thank you Dan,
    Gus

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