-
Use markers to drive text highlight and fade
I’ve been thinking about this and, here is what I’m trying to accomplish: Ideally, each time we reach a marker a word would go to 100% opacity and then immediately start fading. That fade would continue as we hit the next marker/word, with something like a 1.5 second delay.
Howdy,
I have markers (on another layer) driving a text highlight by animating the offset of an animator.
I have one animator set zero opacity, full range.
Then the second animator set to 100% opacity, range of one word, then I apply this expression to the offset:
let myMarkers = thisComp.layer(index-3).marker;
let n = myMarkers.nearestKey(time).index; // get index of the closest key in time
if (time < myMarkers.key(n).time) { n–; } // make sure n == most recent key index only
linear(time,myMarkers.key(n-2).time,myMarkers.key(n-1).time,n-2,n-1);
It does a good job of highlighting the selected word, but it’s not easing at all–just looks like I have hold keyframes for each value.
Any thoughts? Or maybe a different way to do this. My other thought was to ease the opacity from 100 to 0 each time we hit a new marker, but that seems like it could have the same problem.
Thanks!