Repeating Expression (not trying to make a looping expression)
This is a little hard to explain, so if I'm confusing in any way, please let me know so I can clarify.
I have this code expression:
L = thisLayer;
s = thisComp.layer("Controller").effect("Speed")(1)*thisComp.frameDuration;
t2 = key(1).time;
t1 = t2-s;
t4 = key(2).time;
t3 = t4-s;
v1 = thisComp.layer("Controller").effect("Color 1")(1);
v2 = thisComp.layer("Controller").effect("Color 2")(1);
fadeIn = linear(time,t1,t2,v1,v2);
fadeOut = linear(time,t3,t4,v2,v1);
if (time<t1) {v1}
else if (time<t2) {fadeIn;}
else if (time<t3) {v2}
else if (time<t4) {fadeOut;}else{v1}Currently, this code only works with 2 keyframes. It starts at v1; then Keframe 1 starts a linear transition (length dictated by "s" value) from v1 to v2; then Keyframe 2 starts a linear transition from v2 back to v1.
Here's what I would like to do: I would like to make it such that the code makes it automatically transition from v1 to v2 to v1 to v2 etc. no matter how many keyframes I have (not just with 2 keyframes). Is there a way to do this, or is this simply too crazy to be done?
I appreciate your time. Thanks for any help you can give! 🙂
