-
Trigger animation by trim path
Hello all, obligatory I’ve looked for this everywhere and can’t seem to find an answer, so thanks in advance for your patients! I’m making a video that features an animated timeline. As time passes in the video the timeline is highlighted to show where we are in time, and I want thumbnails to pop up at various intervals as the highlighter reaches that point. So a picture for 2010 pops up as the highlighter passes 2010.
What I’ve done is added a trim path to the highlighter shape, then used a linear function to remap the percentage to correspond to the x values in the comp (0 to 1920). Then I created a conditional function on the scale property of the first thumbnail that looks the xPosition of the highlighter trim path and compares it to the xPosition of the current Thumbnail. When the highlighter passes the thumbnail, the condition is met. Here’s my problem:
I want the thumbnail to actually animate on (as opposed to being a binary on or off). So I added a linear function, but I can’t figure out what to do about time. If the reference for time is static, I have to change it for every layer (and pretty much making this whole exercise pointless as I could simply precomp the animation and change in the in points to roughly coincide with the animation of the timeline). But if the reference for time is relative it creates an infinite loop. I couldn’t do time and time + 3 for example because it continues on forever without actually getting there.
So my question is, what can I put for t1 and t2 in the below example in order for the linear function to start exactly when the condition of the if statement is met?
t1 =
t2 =
S = linear(time, t1, t2, 0, 100);
if (thisComp.layer(“Timeline Animation”).effect(“Trim Path to Pixels”)(“Slider”) < transform.xPosition) {[0,0]} else {[S,S]}