So now, I’m stumped again. I’m working with the same project and wanted to adapt your expression to flip a CC composite effect from 0 % opacity to 100 %.There’s also an if clause that checks the layer’s y-position to see, if it’s been moved from a fixed position. If that is true, CC composite’s opacity is also turned on.
I get an error message that “startTime” is not defined and might lie outside of the array’s valid space. But I think, that’s not all that is wrong here.
Here’s the code:
startTime = thisLayer.inPoint;
truePos = thisComp.layer(“CONTROL_politicalParties”).transform.position[1];
tag = “full”;
t = 999999;
for (i = 1; i <= thisComp.numLayers; i++){
s = thisComp.layer(i).marker;
if (s.numKeys > 0){
n = s.nearestKey(time).index;
if (time < s.key(n).time) n–;
for (j = n; j > 0; j–){
if (s.key(j).comment == tag){
t = Math.min(t,time – s.key(j).time);
break;
}
}
}
}
if (t < startTime) {
if (truePos == 757) {
0;
}else{
100;
}
}