-
combining multiple if else statements
Hi all, I thought I saw this posted here, and I searched I cannot find it, but is there a way to rewrite this expression in a better way ( but not using an index method just in case the order of things gets changed ) .
I thought a ternary operator would maybe save some lines if i set some variables first.
there are 6 layers in a composition and i want the position in a different composition to change based on which precomp the user has turned on.
thanks so much
if(comp(“EDIT”).layer(“1”).active) -133.2; else
if(comp(“EDIT”).layer(“2”).active) -57.2; else
if(comp(“EDIT”).layer(“3”).active) -15.2; else
if(comp(“EDIT”).layer(“4”).active) 61.2; else
if(comp(“EDIT”).layer(“5”).active) 61.2; else
179.2