Learn how to write an expression to automatically fade a layer in and out in Adobe After Effects. Instead of having to adjust keyframes, all you have to do is adjust the duration of the layer and it will automatically fade in and out based on the start and end of the layer. This expression works on any layer or precomp that has the opacity property. You’ll also learn how to save the expression as a preset so you can easily reuse it in any After Effects project.
0:36 - Fade in expression
2:16 - Fade out expression
4:33 - Save as preset
4:56 - Use preset
5:32 - Learn more about reusable assets
Copy and paste the expression here:
fadeDuration = .5;
Math.min(linear(time,inPoint,inPoint + fadeDuration, 0, 100), linear(time,outPoint - fadeDuration,outPoint,100,0))
If you like creating efficient, reusable assets like this, I think you'll also like the classes below. Does an auto-resizing text box sound handy? Purchase my text box preset & mogrt or learn how to create your own in class...
Learn how to animate reusable motion graphic templates in Adobe After Effects to customize in your Premiere Pro video projects.
Learn how to create a reusable text box in After Effects that automatically resizes to fit your text.