-
Adding a checkbox if inside an already big if else loop.
Hello everyone,
First of all i wanted to say what a huge help this forum has been to my expression learning curve and especially dan (you’re a god).
Now i just made my account to join the community and because i got stuck into a really weird loop for me to handle on my own.
So here’s the thing i have a pretty big project coming some words about the project so u can get to understand better the problem that comes after.
The project is basically a “Character Creation” of sorts.
I have a comp with many slider controls controlling effects as hair / outfits / hats and so on and some color controls for the colors (duh).
And i have a text layer with a number that actually controls which character i’m editing since i can duplicate the characters with the same effects and change each on individually.
So i use a loop that goes something like this for that to happen it loops through the text layer adds some zeroes depending on the text value and finds the character we’re editing.(First Loop on the expression box)
Everything there works all sliders and so on.
My problem is i’m trying to add a checkbox control for some things.
A checkbox named Keep original that disables the colors (By adding an expression to color effect opacity turning 0 if checkbox is up and 100 if its not you know.)
and another to add weight which actually disables the first body and adds a second one which is kinda bigger.My problem is i cant seem to find a way to add my if condition inside the loop i wrote up there since i need it cause there will be many characters so i cant really just link it to
a specific one i need it to loop through and find which character im editing and make that one original / fat.You can see how i tried editing it and adding the checkbox on the second expression posted in the box below.
I tried having the if addweight statement inside the brackets outside and in every position i could think of but still no luck so far.
Any help / tips would be greatly appreciated.// Loop for character number on all sliders (Works just fine).
try{
characterN=comp("Master Panel").layer("Select Character").text.sourceText;
if (characterN>0 ){
if (characterN<10) charString="Character " +"00"+ characterN.toString();
if (characterN>9 && characterN<100) charString="Character " +"0"+ characterN.toString();
if (characterN>99 && characterN<1000) charString="Character"+ characterN.toString();
state=comp("Master Panel").layer(charString).effect("Outfit")("ADBE Slider Control-0001");
framesToTime(state);
}
else res;
}
catch(err){res};// The loop im trying to create but got stuck so hard.
try{
characterN=comp("Master Panel").layer("Select Character").text.sourceText;
if (characterN>0 ){
if (characterN<10) charString="Character " +"00"+ characterN.toString();
if (characterN>9 && characterN<100) charString="Character " +"0"+ characterN.toString();
if (characterN>99 && characterN<1000) charString="Character"+ characterN.toString();
AddWeight = comp("Master Panel").layer("charString").effect("Add Weight")("Checkbox")
}
else res;
}
catch(err){res};
if(AddWeight.value)0 else 100;


