Skip to content

Instantly share code, notes, and snippets.

@animoplex
Last active August 10, 2023 00:30
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save animoplex/a0428652adce0ffa6ef931b7a742c235 to your computer and use it in GitHub Desktop.
Save animoplex/a0428652adce0ffa6ef931b7a742c235 to your computer and use it in GitHub Desktop.
Auto Fade Opacity - After Effects Expression by Animoplex
// Auto Fade Opacity - Created by Animoplex: www.animoplex.com
// Automatically fades a layer in and out based on the inPoint and outPoint of the layer.
// Full Tutorial: https://www.youtube.com/watch?v=BOPfs49VfLE&t=188s
fade = 1; // fade duration in seconds
fadeIn = (time - inPoint) / fade;
fadeOut = (outPoint - time) / fade;
if (time < inPoint + fade) {
ease(fadeIn, 0, 1) * value;
} else if (time > outPoint - fade) {
ease(fadeOut, 0, 1) * value;
} else {
value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment