Page 1 of 1

value change when Null getting closer to layer

Posted: December 3rd, 2008, 9:03 pm
by madli
hi to all expression jedi...

Is there any expression that effect layer properties eg: opacity or scale, when null getting closer to layer position. Its more like tsunami menu in flash.

layer fade in..when the null getting closer, and layer fade out.. when the null get far from layer.. and the opacity in and out calculated according the distant value between the null n object...

see the attachment file i got from net. i think u got what i mean...
please help me!! :oops: , thank you...

madli

Re: value change when Null getting closer to layer

Posted: December 4th, 2008, 7:02 am
by kobyg
Try applying the following expression to the opacity.

Code: Select all

D_opaq = 100;
D_trans = 300;
d = length(position, thisComp.layer("Avoid Me").transform.position);
ease(d, D_opaq, D_trans, 100, 0)
It will keep the layer transparent as long as the Null ("Avoid Me") is farther from the layer by "D_trans" or more pixels,
and will gradually increase the opacity as the Null gets closer to the layer, until 100% opacity will be achieved
when the distance between the layer and the Null is "D_opaq" or less pixels.

Koby.

Re: value change when Null getting closer to layer

Posted: December 4th, 2008, 8:32 pm
by madli
thanks koby,

Its worked. thank you very much. im happy. :D
but cant apply to scale properties.

madli

Re: value change when Null getting closer to layer

Posted: December 5th, 2008, 3:08 am
by Paul Tuersley
That's probably because Scale is a 2 dimensional property so the result needs to be in the form of [xValue, yValue]. Try this:

Code: Select all

D_opaq = 100;
D_trans = 300;
d = length(position, thisComp.layer("Avoid Me").transform.position);
result = ease(d, D_opaq, D_trans, 100, 0);
[result, result]

Re: value change when Null getting closer to layer

Posted: December 9th, 2008, 12:22 am
by madli
many thankss...hehe! love u guys.