Disable an effect with expressions?

Hey i’m an expressions noob and I was wondering; is there a way to completely shut off an effect through expressions? (specifically check-box) And also be able to re-enable the given effect.

-Graham

Nevermind…stupid question; figured out how.

Mods can delete

Wich type of efftect, per example, “fill effect” : alt clic on opacity timewatch and type :

C = thisComp.layer(yourlayer).effect(yourcheckbox)“checkbox”;

If (c=true){
value=100
}else{
value=0
}

//// “c” is your condition, your chekbox here
If your checkbox is enabled the effect parameter value will be 100, if checkbox is disabled, your effect parameter value will be 0.
Replace these value by your effect value…
I hope I’m clear… :wink:

Thanks DarkPulse that was helpful. What i’m trying to do is have the ability to enable or disable a “Turbulent Displace” effect that is animated so that the displace amount starts at 100 and ends at 0 after 5 seconds, right now I have one of the two expressions to use each of them has problems:

(comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”) * 150)-(time * 20);

(comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”)*150)/(time+10);

The first one does not work because it continues to subtract thus going into negative numbers. The second expression does not work because it can never get to zero. How would I fix this so the expression would give a value of 0 at 5 seconds while also animating down from 100?

I’m not at home right now ( I’m on my iphone), so it’s not easy to understand your probleme. Simply try to duplicate your layer/comp and disable FX on one of them : put the layer with the displacement effect on top of the original. Apply my expression on the opacity layer value to get somerhing like that :

A : layer/comp with displacement FX
B : original layer/comp (without displacement)

Apply expression with inverted consequence, when checkbox = ON > opacity layer A = 100% & opacity layer B = 0%
when checkbox = OFF > opacity layer A = 0% & opacity layer B = 100%

GrizzleFX said

Thanks DarkPulse that was helpful. What i’m trying to do is have the ability to enable or disable a “Turbulent Displace” effect that is animated so that the displace amount starts at 100 and ends at 0 after 5 seconds, right now I have one of the two expressions to use each of them has problems:

(comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”) * 150)-(time * 20);

(comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”)*150)/(time+10);

The first one does not work because it continues to subtract thus going into negative numbers. The second expression does not work because it can never get to zero. How would I fix this so the expression would give a value of 0 at 5 seconds while also animating down from 100?

a = comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”) * 150 - (time * 20);

clamp(a, 0, 100000000000);

felt_tips said

clamp(a, 0, 100000000000);

Thanks both of you! This is what I was looking for :slight_smile:

a = comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”) * 150 – (time * 20); clamp(a, 0, 100000000000);

Please guys, follow the rules…use english :smiley:

1 Like
flashato said

Please guys, follow the rules…use english :smiley:

Tell me about it! :wink:

flashato said
a = comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”) * 150 – (time * 20); clamp(a, 0, 100000000000);

Please guys, follow the rules…use english :smiley:

:smiley:

flashato said
a = comp(“Comp 1”).layer(“Main Controls”).effect(“Turbulent Displace”)(“Checkbox”) * 150 – (time * 20); clamp(a, 0, 100000000000);

Please guys, follow the rules…use english :smiley:

HAHAHAHA

By the way, do you know any good resource where I can learn scripting for AE?

[edit] oops… thought you said expressions…

There aren’t many…

http://aenhancers.com/ is a forum - you may get some good advice

Lloyd Alvarez did a getting started with scripting tutorial, which I think is available from Lynda.

These are the best places though…

the manual

the other manual

acuredreamgift SAYS
By the way, do you know any good resource where I can learn scripting for AE?

3dbacks said

acuredreamgift SAYS
By the way, do you know any good resource where I can learn scripting for AE?

That’s expressions though. Acure asked about scripting… that’s an altogether different thing.

@acure … did you actually mean scripting or did you mean expressions?

Expressions are the code that you put on to various properties inside of Ae. Scripts are written externally using a different language and then run as an interface panel inside Ae.

Expressions are relatively easy to get into. Scripts are not.

felt_tips said
3dbacks said

acuredreamgift SAYS
By the way, do you know any good resource where I can learn scripting for AE?

That’s expressions though. Acure asked about scripting… that’s an altogether different thing.

@acure … did you actually mean scripting or did you mean expressions?

Expressions are the code that you put on to various properties inside of Ae. Scripts are written externally using a different language and then run as an interface panel inside Ae.

Expressions are relatively easy to get into. Scripts are not.

Yes, sorry, I meant expressions. And thank you guys for links, I’ll have stuff to do when I get back home in September.

acuredreamgift said
felt_tips said
3dbacks said

acuredreamgift SAYS
By the way, do you know any good resource where I can learn scripting for AE?

That’s expressions though. Acure asked about scripting… that’s an altogether different thing.

@acure … did you actually mean scripting or did you mean expressions?

Expressions are the code that you put on to various properties inside of Ae. Scripts are written externally using a different language and then run as an interface panel inside Ae.

Expressions are relatively easy to get into. Scripts are not.

Yes, sorry, I meant expressions. And thank you guys for links, I’ll have stuff to do when I get back home in September.

Ah, okay. There aren’t all that many sources…

I’d recommend checking out Dan Ebberts’ Motion Script

There are a couple of bits and pieces over at http://ae.tutsplus.com - search "expressions"


I’ve also made a couple of expressions tuts in response to questions over here… https://vimeo.com/channels/222304

There’s a good Ae expressions forum over at Creative Cow too.