Copy link to clipboard
Copied
Hi!
I'm trying to create an expression that would have the following logic:
-Check if layer myLayer is positioned over a certain area in the composition when playhead is at frame 50
-If true, permanently set opacity of layer revealedLayer to 100%
Is that kind of logic possible in AE? My trouble is that I can't figure out how to se the opacity change to be permanent. In the code I have the opacity stays at 100 only as long as myLayer is still positioned over the trigger area:
if(thisComp.layer("myLayer").transform.position[0]>910 && thisComp.layer("myLayer").transform.position[0]<940 && thisComp.layer("myLayer").transform.position[1]>460 && thisComp.layer("myLayer").transform.position[1]<490) 100 else 0
yes, you can use valueAtTime:
var myTime = framesToTime(100);
var myPosition = thisComp.layer("myLayer").transform.position.valueAtTime(myTime);
if(myPosition[0]>910 && myPosition[0]<940 && myPosition[1]>460 && myPosition[1]<490) 100 else 0
Copy link to clipboard
Copied
yes, you can use valueAtTime:
var myTime = framesToTime(100);
var myPosition = thisComp.layer("myLayer").transform.position.valueAtTime(myTime);
if(myPosition[0]>910 && myPosition[0]<940 && myPosition[1]>460 && myPosition[1]<490) 100 else 0
Copy link to clipboard
Copied
Thank you very much!