Adding a checkbox if inside an already big if else loop.
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.
Does removing ".value" from the last line do anything?
Senior Graphic Designer
Hello there and thanks for the reply !
No removing the .value doesnt seem to do anything it still crashes.
The position of the if addweight seems to be wrong as well in the example but its just an example as i said i tried it in any other position past and after any collumns but still no luck. cant get this to actually work.
It's hard to tell what would serve you best from your description.
How are your 2nd set of bodies stacked up (the heavier ones)? If you are going to have a 2nd set of frames with larger bodies for all of the characters and you simply time-remap for various assets, simply offset their values by a number larger than your total assets (in this case I have added 500, change that number for as many as you would need).
so in my example, if they are regular, character 145 would have a body frame 145, but if they were fat, they would be 645, etc.
If you were referencing specific layers, do a label check instead, and call the 2nd set "heavy_character", then just have a 2nd set of body layers, rather than time remapping, to draw from.
Simply un-comment one of the test examples and see what you'd prefer. When you decide one, add another check for the color as well.
Hey there alex and thanks for that awesome reply,
Though indeed you cant understand much of whats happening in my comps with what i said so id try to explain it better.
Think is i have a Character 001 with many slider controls and color controls that actually choose frames of clothes etc.
So when slider control outfit is on 1 the outfit is for example a doctor one.
but i also have layers enabling body parts as hands feet etc so the heavier ones are another layer that contains all the heavy parts.
Thing is when addweight is ticked the normal parts get an opacity of 0 and the heavy ones an opacity of 100.
Which parts are to appear are controlled by the outfit slider already so no need to change that just the opacity thingie.
The whole characterN loop only serves to choose which character we are editing in that case Character 001 or 002 or 003 etc which are all duplicates of Character 001 with different slider values.
So the offset wont really work since im not doing anything with it (as far as i get it that is im not really sure)
and the label call wont work either cause the whole heavier parts aint Character calls but layer calls inside a slider.
Ill try to upload some images for better clarification and a better understanding Thanks for all the effort though.
Character Slider controls etc.
Character Part comps
Clothes etc comps.
Ok, If I'm understanding correctly, you are time-remapping asset layers in your subcomp "Character Parts" to choose the shape, and you have separate asset layers to hold the fat and regular shapes.
Something like this should work in the opacity code for the fat asset opacity:
and something like this in the regular asset opacity:
note that the only difference is the final line inside the If statement is that if the checkbox is checked, the outputs for the layers swaps 100/0 to 0/100.