FORUMS: list search recent posts

Using distance to control transparency

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gerard Bowden
Using distance to control transparency
on Jul 14, 2013 at 5:24:42 am

Hi, Im trying to control the transparency of an object by using the distance of it with another object. Any help would be much appreciated. thanks

object1=transform.position;
object2=thisComp.layer("object2").transform.position;

distance=length(point1, point2);
tMin=250;
tMax=50;
value1=0;
value2=100;


transform.opacity =linear(distance, tMin, tMax, value1, value2);


Return to posts index

Dan Ebberts
Re: Using distance to control transparency
on Jul 14, 2013 at 7:40:26 am

Something like this should work. If what you want is just the opposite, switch value1 and value2.

point1=transform.position;
point2=thisComp.layer("object2").transform.position;
distance=length(point1,point2);
tMin=50;
tMax=250;
value1=100;
value2=0;
transform.opacity =linear(distance, tMin, tMax, value1, value2);


Dan



Return to posts index

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