ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

If / else - source text - Expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
aniello ferrone
If / else - source text - Expression
on Sep 25, 2019 at 1:38:37 pm

Hi guys,
I need your help to write this if/else expression:

I want the opacity of a layer to be 0 when the characters of a text layer are equale to 0 (so there is no text written). Is it possible?

Thank you so much in advance

Aniello

Aniello Ferrone
Viral Video Editor
http://www.fanpage.it


Return to posts index

aniello ferrone
Re: If / else - source text - Expression
on Sep 25, 2019 at 3:14:03 pm

I solved myself, like so
Thank you so much

if (thisComp.layer("Text").text.sourceText.length == 0){
0;
} else {
100;
};


Aniello Ferrone
Viral Video Editor
http://www.fanpage.it


Return to posts index

Andrei Popa
Re: If / else - source text - Expression
on Sep 25, 2019 at 3:30:32 pm

You could write it more beautiful like this:
((thisComp.layer("Text").text.sourceText =="") ? 0 : 100

Andrei
My Envato portfolio.


Return to posts index


aniello ferrone
Re: If / else - source text - Expression
on Sep 25, 2019 at 3:32:14 pm

Wow, Thank you so much!

Aniello Ferrone
Viral Video Editor
http://www.fanpage.it


Return to posts index

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