Skip to content

Instantly share code, notes, and snippets.

@StephanBaum
StephanBaum / autoFadeEase.jsx
Created August 8, 2019 13:41 — forked from fk128/autoFadeEase.jsx
After Effects Expressions
//Autofade: Add to opacity
// If there are two markers on the layer, then they are used to set the duration; otherwise, a default value is used.
transition = 15; // transition time in frames
var v = transform.opacity;
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
ease(time, inPoint, inPoint + tSecs, 0, v) - ease(time, outPoint - tSecs, outPoint, 0, v)
}else{
ease(time, inPoint, marker.key(1).time, 0, v) - ease(time, marker.key(2).time, outPoint, 0, v)
}