ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Multiple expressions in one property

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gus Favoreto
Multiple expressions in one property
on Jul 22, 2019 at 8:35:14 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)



Return to posts index

Dan Ebberts
Re: Multiple expressions in one property
on Jul 22, 2019 at 8:50:30 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



Return to posts index

Gus Favoreto
Re: Multiple expressions in one property
on Jul 22, 2019 at 9:43:26 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.


Return to posts index


Dan Ebberts
Re: Multiple expressions in one property
on Jul 22, 2019 at 10:34:41 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



Return to posts index

Gus Favoreto
Re: Multiple expressions in one property
on Jul 23, 2019 at 9:01:50 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]