
1. Re: Help Combining two Expressions
Mylenium Nov 4, 2017 1:58 AM (in response to Sully Taylor)I'm not clear what you are hoping to achieve. You totally nixed the conditional statemnets to retrieve the keyframe info, so this cannot work  the evaluation condition simply is never valid. That being said, the "trans" stuff would have to be applied as a filter curve to the result of the overshoot expression, not added or subtracted. In effect this simply means where "time" is used in the zoom expression's easIn() and easeOut() you fill in the result of your overshoot. It's a simple case of modulating one result with another. Of course it may require some tweaking, but it's to ealry in the morning for me to realyl get into it...
Mylenium

2. Re: Help Combining two Expressions
Dan Ebberts Nov 6, 2017 10:58 AM (in response to Sully Taylor)1 person found this helpfulThis might work:
zoom = 5000; //distance to zoom
trans = 4; // transition time in frames
trans = trans * thisComp.frameDuration;
if (time < inPoint+trans){
value + easeIn(time, inPoint, inPoint + trans, [0,0,zoom], [0,0,0]);
}else if (time > outPoint  trans*2){
value  easeOut(time, outPoint, outPoint  trans*2, [0,0,0], [0,0,zoom]);
}else{
freq = 3;
decay = 5;
amp = 80;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n;
}
if (n > 0){
t = time  key(n).time;
amp = velocityAtTime(key(n).time  .001);
w = freq*Math.PI*2;
value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}else{
value;
}
}
Dan
[EDIT] This is probably better:
freq = 3;
decay = 5;
amp = 80;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n;
}
val = value;
if (n > 0){
t = time  key(n).time;
amp = velocityAtTime(key(n).time  .001);
w = freq*Math.PI*2;
val += amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}
zoom = 5000; //distance to zoom
trans = 4; // transition time in frames
trans = trans * thisComp.frameDuration;
if (time < inPoint+trans){
val += easeIn(time, inPoint, inPoint + trans, [0,0,zoom], [0,0,0]);
}else if (time > outPoint  trans*2){
val = easeOut(time, outPoint, outPoint  trans*2, [0,0,0], [0,0,zoom]);
}
val
Dan