-
for loop
Ive been doing some extendScript training, and in an effort to better understand practical applications of a for loop in AE i rigged something very simple up to test, unfortunately with no result (no errors, but not the behavior I’m going for).
i just have 10 or so layers lined up in a row on X. All with 50% opacity except for one randomly picked layer which is 100.
Just trying to loop through to find the layer with 100% opacity, and move the expression’d layer to the same spot on X.
if i change the “100” to “50”, the object will in fact jump to the last layer, that does happen to be at 50% opacity. But it just doesn’t seem to be finding the layer with 100% opacity, does nothing. Hope this is simple enough to make sense, or anyone has some better for exercises i could play with.
Thanks
for( i=1; i <= thisComp.numLayers; i++){curLayer = thisComp.layer(i);
if(curLayer.transform.opacity == 100){
curLayer.transform.xPosition
}else{
0
}
}