I’m assuming this is a source text expression, correct? If so, change it to this:
m = thisLayer.marker;
n = 0;
val = "";
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
if (n > 0){
val = m.key(n).comment;
}
val
and add this opacity expression:
m = thisLayer.marker;
f = framesToTime(5);
n = 0;
val = 0;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (m.key(n).time > time) n--;
}
if (n > 0){
t = time - m.key(n).time;
d = m.key(n).duration;
val = linear(t,d,d+f,100,0);
}
val