-
Can I merge these two expressions into one?
Im trying to control a single parameter on the Y position, it works great, but I’d like to add a marker control to trigger the animation, Im not certain how to go about it. Any help appreciated.
if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
v1 = 0;
v2 = thisComp.layer("y position").effect("Slider Control")("Slider").value;
linear(time,t1,t2,v1,v2);
}else
valueif (thisProperty.numKeys == 0) { t = 0; }
else {
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){ n--;}
}if (n == 0){ t = 0; }
else{
m = marker.key(n);
t = time - m.time;
}
}
valueAtTime(t)