Skip to content

Instantly share code, notes, and snippets.

@fk128
Created June 18, 2017 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fk128/47637b400b57f60c40a0bed7acb4ee88 to your computer and use it in GitHub Desktop.
Save fk128/47637b400b57f60c40a0bed7acb4ee88 to your computer and use it in GitHub Desktop.
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)
}
//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.
//linear
transition = 15; // transition time in frames
var v = transform.opacity;
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
linear(time, inPoint, inPoint + tSecs, 0, v) - linear(time, outPoint - tSecs, outPoint, 0, v)
}else{
linear(time, inPoint, marker.key(1).time, 0, v) - linear(time, marker.key(2).time, outPoint, 0, v)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment