Expression Copied to Clipboard! 🗂
← Back to Expressions

Trigger Expression on Marker - After Effects Expression

Boilerplate expression to trigger actions with markers

Trigger Expression on Marker

if(marker.numKeys>0) {
 if(marker.key(n).time>time) {
 } if(n==0) {
 } else {
  t=time-marker.key(n).time; //time since marker
  //Do Stuff
} else {

Copied to Clipboard!
if(marker.numKeys>0) { n=marker.nearestKey(time).index; if(marker.key(n).time>time) { n--; } if(n==0) { value; } else { t=time-marker.key(n).time; //time since marker //Do Stuff }
} else { value;

How To Use This Expression

Replace ‘//Do Stuff’ with the code to be triggered at a marker.

Example Use

You can trigger keyframed animation from the begining of the layer


More expressions you might like...