I’m not sure how you would do that, or how you would trigger it if you could do it.
I have no idea if this is of any use to you, but you could define a set of “action” functions that would respond to specific triggers. For example, you could set up some opacity functions that could be triggered by layer markers. In this simple example, layer markers with the comment “fadeIn”, “fadeOut”, “flickerOn”, or “flickerOff” would trigger a specific function. Each comment can also include an option duration (in frames) parameter, so, for example, you could trigger a 25-frame fadeIn with this comment: “fadeIn 25”. If no duration parameter is included, a default of 10 frames is assumed. This opacity expression is a simplified version of such a marker-triggered system:
function fadeIn(t,dur){
return linear(t,0,dur,0,100);
}
function fadeOut(t,dur){
return linear(t,0,dur,100,0);
}
function flickerOn(t,dur){
return t < dur ? (random() < 0.5 ? 0 : 100) : 100;
}
function flickerOff(t,dur){
return t < dur ? (random() < 0.5 ? 0 : 100) : 0;
}
defaultDur = 10; // default duration in frames
val = value;
m = marker;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (time < m.key(n).time) n--;
if (n > 0){
c = m.key(n).comment.split(" ");
myDur = framesToTime(c.length > 1 ? parseInt(c[1]) : defaultDur);
myT = time - m.key(n).time;
switch(c[0]){
case "fadeIn":
val = fadeIn(myT,myDur);
break;
case "fadeOut":
val = fadeOut(myT,myDur);
break;
case "flickerOn":
val = flickerOn(myT,myDur);
break;
case "flickerOff":
val = flickerOff(myT,myDur);
break;
default:
break;
}
}
}
val