-
marker.numKeys works sometimes, sometimes not
Hello, I’ve got this expression to display the layer’s marker comments. The expression works most of the time, and other times it works but displays an error message. I get a message saying the property has no keyframe(s).
What can I do to make it consistently work?s = thisComp.layer(“Notes”);
v = “”; // variable for comment output
k =1; // here I store my marker keyframe number. I put 1 to see if it works better than 0
if (s.marker.numKeys > 0) {
k = s.marker.nearestKey(time).index;
if (time < s.marker.key(k).time) k–; // this to make the keynumber look backwardsv = s.marker.key(k).comment;
// here I get an error saying the property has no keyframe 0 !!!
}
else {v = ” “}
v