
įor the above example we will use the greater than (>) operator. The following chart explains what equality operators you can use in After Effects. Set Your Equality OperatorĪn equality operator is essentially a small formula designed to tell your expression what to do. So in that example we would pickwhip to the opacity of the white shape. For the example above, the input value came from the opacity of the white shape. Using the pickwhip tool select the value you want to input into your If/Else statement. What do each of the parameters in this expression mean? Let’s break them down step by step: If(thisComp.layer(“WhiteShape”).transform.opacity>50) 100 else 50 The expression used in the example above is: Simply open up your expression editor by holding down Option and clicking on the stopwatch next to the parameter you want the If/Else statement to effect. Writing an If/Else statement is fairly straight forward. How to Write an If/Else Conditional Expression Here’s what our After Effects timeline looks like for this example: If the white squares opacity is less than 50% the text opacity will be 50%. In this example, the code states that if the white shape’s opacity is more than 50% than the text opacity will be 100%. Let’s take a look at a really basic model: If this sounds confusing, don’t worry! It’s simplier than you might think.


What is an If/Else Expression in After Effects?Īn If/Else expression in After Effects is a line of code that will change it’s output value based on the input value.

You don’t have to be a computer programmer to get a handle on expressions in After Effects. Let’s dig into the powerful If/Else expression in After Effects. If/Else expressions are incredibly useful in After Effects…if you know how to use them.
