Blog


After Effects Automatic Fade-Out Expression

May 23 2007

So, many of you are not really big on using Adobe After Effects for video compositing, but I know some of you are.

I just made a quick little expression that will put a half second fade out on the tail of any layer. It uses the layer’s outpoint as the source for the fade-out, so you don’t have to do any keyframing. Just trim the layer where you want it to end, and this expression will add the fade out. Just copy and paste this as an expression for the opacity property:

if(time<(this_layer.out_point -0.5)){
    transform.opacity;
} else {		
    ( (this_layer.out_point-time)/0.5) * transform.opacity;
}

Hope you find it useful. I am posting it because I searched all over the web looking for just such a thing and couldn’t find it anywhere.

I’ve tweaked it a little - now the fade time is set in a variable, and the expression will fade the layer in and out:

var fadeTime = 0.5;
if(time>(this_layer.out_point - fadeTime)){
((this_layer.out_point-time)/ fadeTime) * transform.opacity;
} else if (time<(this_layer.in_point + fadeTime)) {
((time-this_layer.in_point)/ fadeTime) * transform.opacity;
} else {
transform.opacity;
}
</pre>

-M

By Mike on May 25 2007


Cool! Thanks, Mike. I’ll use this snippet for sure.

By John Adams on June 05 2007


Nothing would please me more than your comment.

Name:

Please enter the word you see in the image below:




The following fields are optional:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?