Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Arslan-TR/48625c6c6fdd6ffc968bb522e0cebd9e to your computer and use it in GitHub Desktop.
Save Arslan-TR/48625c6c6fdd6ffc968bb522e0cebd9e to your computer and use it in GitHub Desktop.
Autofade for opacity After effects experssion
//this is auto fade expression. with this u just have to cut the layer and its gonna fade-in & Out automaticly
//Autofade (linear) Add the experssion to opacity of the layer
transition = 8; // transition time in frames u can adjust it!
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
linear(time, inPoint, inPoint + tSecs, 0, 100) - linear(time, outPoint - tSecs, outPoint, 0, 100)
}else{
linear(time, inPoint, marker.key(1).time, 0, 100) - linear(time, marker.key(2).time, outPoint, 0, 100)
}
-----------------------
-------------------------
//Autofade (ease) Add the experssion to opacity of the layer
transition = 10; // transition time in frames u can set to 8 (optionaly).
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
ease(time, inPoint, inPoint + tSecs, 0, 100) - ease(time, outPoint - tSecs, outPoint, 0, 100)
}else{
ease(time, inPoint, marker.key(1).time, 0, 100) - ease(time, marker.key(2).time, outPoint, 0, 100)
}
-----------------------
-------------------------
//easearrr version
//Autofade2: Add to opacity
fadeInTime = .25; // fade in time (seconds)
fadeOutTime = .25;
Math.min(linear(time,inPoint,inPoint + fadeInTime,0,100),linear(time,outPoint - fadeOutTime,outPoint,100,0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment