-
Illegal use of Reserved word – multiple If/Else statements
So I have an index based expression applied to rotation so that when I duplicate that layer it keeps the layers split evenly spread on 360 degrees. Which works well.
I’m adding an expression to the X position so that when I duplicate the layers I can control the width of the circle depending on its rotation value. Since each layer’s rotation changes based on how many layers I have, I have four If/Else conditions driving the value. I’m taking that value and multiplying it by a slider. My hopes are that the Top and bottom layer (0º and 180º) stay put, while the further right and left (90º and 270º) the more that layer is effect by my slider value.
Basically I’m trying to get these values, based on the layers rotation. And use those values as it’s factor to spread out more exponentially.
12863_scalexposbasedonrotation.png.zipHere is the expression
I hope this makes sense.
Rot = transform.rotation;
Ctrl = thisComp.layer("Controller").effect("Width")("Slider");
Factor = if(Rot >0 && <180) {
Rot;
} else if(Rot >90 && <180) {
180 - Rot;
} else if(Rot >18 && <270) {
180 - Rot;
} else if(Rot >270 && <360) {
(360 - Rot)*-1;
} elsevalue;
Factor * Ctrl;