Andy Ford's tutorial for Auto Fade In and Out in Adobe After Effects

After Effects Tutorial – Auto Fade In and Out

If you create an expression to automatically fade a layer in and out, it can be efficient in the long run. This is because you’ll be able to adjust the beginning and ending times of the layer without having to adjust keyframes.

To get started, create an expression on your layer’s Opacity keyframe. Then, determine how long you want the fade to be. By setting a variable for this time, you can easily change it later if needed. For example, you can do: fadeTime =.33;

This is basically 1/3 of a second, or ~10 frames in a 29.97 composition.

Next, create a variable for the fade in and use the linear expression. The linear expression has been covered by one of my previous tutorials in 2021. It is written:

Linear(var, varMin, varMax, value1, value2)

In our case, the variable will be time because we’re looking at when a layer starts. The varMin is exactly the time the layer starts, which is written as inPoint. The varMax is when the fade should end. In our case that is inPoint+fadeTime that we set previously. Then value1 and value2 are 0 and 100, which is the starting and ending opacity.

Written out, it looks like this:

fadeIn=linear(time,inPoint,inPoint+fadeTime, 0, 100);

Next, we create a variable for the fade out and use another linear expression. Since we are dealing with the layer’s out point, we can use outPoint. The varMax in this instance is when the fade starts, or outPoint-fadeTime. Written out, it looks like this:

fadeOut=linear(time,outPoint,outPoint-fadeTime, 0, 100);

Finally, we combine the two to get the output:


In entirety, the expression looks like this:

fadeTime =.33;
fadeIn=linear(time,inPoint,inPoint+fadeTime, 0, 100);
fadeOut=linear(time,outPoint,outPoint-fadeTime, 0, 100);

To change the length of fade, change the numeric value .33 to whatever you desire. You can change the layer’s starting and ending points as desired and the fade will adjust accordingly thanks to the expression.

Some contents or functionalities here are not available due to your cookie preferences!

This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

Color Match with Lumetri in Premiere Pro
The Lumetri Color panel in Premiere Pro is an excellent color correction …
Export with Alpha Channel in After Effects
An Alpha channel defines the transparency in a video clip or image. …

Enjoying this tutorial? Sign up for the Creative COW Newsletter!

Sign up for the Creative COW newsletter and get weekly updates on industry news, forum highlights, jobs, inspirational tutorials, tips, burning questions, and more! Receive bulletins from the largest, longest-running community dedicated to supporting professionals working in film, video, and audio.

Enter your email address, and your first and last name below!

Sign up:

* indicates required


We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy