ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

long expression for if/then/else

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
constanti dinu
long expression for if/then/else
on Jan 15, 2020 at 11:28:13 am

hello guys, i need to find out a sollution for an expression.
i'm using a checkbox that switches colours based on selection.

logically it will be if a=0 then b else c.

a should be
(comp("countries").layer("color scheme").effect("activate")("Checkbox") == 0)

b should be
try{NUME = thisComp.layer(index).name.split(" ")[0];
x = Math.floor(comp("countries").layer(NUME).effect("color scheme")("Slider"));
comp("countries").layer("color scheme").effect("land " + x)("Color");
} catch(err) {
x = [1,1,1,1]
}

c should be
comp("countries").layer(thisLayer.name).effect("country colour")("Color")


i don't know how to include these expressions into if then else text.
please help


Return to posts index

Andrei Popa
Re: long expression for if/then/else
on Jan 15, 2020 at 2:21:35 pm

I think this should work.

if (comp("countries").layer("color scheme").effect("activate")("Checkbox") == 0){
try{
NUME = thisLayer.name.split(" ")[0];
x = Math.floor(comp("countries").layer(NUME).effect("color scheme")("Slider"));
comp("countries").layer("color scheme").effect("land " + x)("Color");
} catch(err) {
x = [1,1,1,1]
}
}else{
comp("countries").layer(thisLayer.name).effect("country colour")("Color")
}


Andrei
My Envato portfolio.


Return to posts index

constanti dinu
Re: long expression for if/then/else
on Jan 15, 2020 at 2:40:13 pm

worked like a charm! you're a genius ☺

multumesc mult


Return to posts index


Andrei Popa
Re: long expression for if/then/else
on Jan 15, 2020 at 4:19:11 pm

Cu placere!
Spor la animat!

Andrei
My Envato portfolio.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]