-
React layer properties with the inPoint and/or outPoint of another layer
Hello everyone! I’m new here, and in expression/scripting after effects stuffs.
A little ago, I just learned how to fadein and fadeout expression for opacity, and then, i have used it a lot of times in others kind of properties (like audio volume, opacity, position, etc). the expression I usually use is that bellow:
fade = 1;
fadein = (time - inPoint)/fade;
fadeout = (outPoint - time)/fade;
if(time < inPoint + fade)(linear(fadein,0,1)*value)
else if(time > outPoint - fade)(linear(fadeout,0,1)*value)
else(value
)And it fits great for me, when I need a simple auto fade in that case.
But, when I try to link this to another in/outpoint’s layer, the outPoint doesn’t work that good. The expression I try is the bellow one example:
fade = 1;
x = thisComp.layer("whatever1");
y = thisComp.layer("whatever2");
fadein = (time - x.inPoint)/fade;
fadeout = (y.outPoint - time)/fade;
if(time < x.inPoint + fade)(linear(fadein,0,1)*value)
else if(time > y.outPoint - fade)(linear(fadeout,0,1)*value)
else (value)
Someone could help me with that?
And please, if it’s in a wrong place or I place the code wrong, give me some advice .\”I never quit trying. I never felt that i didn\’t have a chance to win!\”
