-
Return the index value of the previous keyframe on a different layer
Hello. I have a null layer called “Controller” that has a Slider Effect on it named “Slider”. This slider effect has five keyframes on it spread out over time. I then have a text layer named “Keyframe Index” and I’d like the Source text to return the index value of the previous keyframe on the slider.
For example, I have a keyframe on the slider at 0 sec, 1 sec, 5 sec, 6 sec, and 11 sec. When the playhead is between 0 and 1 sec I’d like the source text to display “1” (because the first keyframe is at 0 sec). When the playhead is between 1 sec and 5 sec I’d like the source text to display “2” (because the second keyframe is at 1 sec). When the playhead is between 5 sec and 6 sec I’d like the source text to display “3”. When the playhead is between 6 sec and 11 sec I’d like the source text to display “4”. And when the playhead is after 11 sec I’d like the source text to say “5”.
Essentially I’m just looking for the source text to display the index of the previous keyframe on the slider layer. I hope that makes sense. Thank you.