-
Wildcard characters in expression
I am hoping someone has a solution to this?
I am using if else statements to offset pre comps in a main comp. This works great. But I want to offset the comps different for the x and y values. I am using the layer index as my initial value.
For the y value I have it working and have my comps set into rows. This worked fine. Now I would like my x to change with every 10th comp. So all layer index ending in 1 would have the same value; everything ending in 2 would have another value etc…
Is there a wild card character that can be used in expressions?
layNum = thisLayer.index;
/*if else to determine x offset starting over every 10 images*/
if (layNum ==*1) {xlayOff = 1}
else if (layNum == *2 ) {xlayOff = 2}
/*if else to determine y offset every 10 images*/
if (layNum <=10) {ylayOff = 0}
else if (layNum >=11 && layNum <=20) {ylayOff = 1}
else if (layNum >=21 && layNum <=30) {ylayOff = 2}
else if (layNum >=31 && layNum <=40) {ylayOff = 3}
else if (layNum >=41 && layNum <=50) {ylayOff = 4}
else if (layNum >=51 && layNum <=60) {ylayOff = 5}
xOff= thisComp.layer("expression controls").effect("x offset")("Slider");
yOff =thisComp.layer("expression controls").effect("y offset")("Slider");
xNew = xOff*xlayOff;
yNew = yOff*ylayOff;
position = [xNew,yNew]-BK