-
Using a marker with specific name to trigger animation multiple times
I’ve got two markers on a shape layer each called “Click.” I use this expression to animate the scale:
rampStart = marker.key("Click").time;
rampEnd = marker.key("Click").time + .15;
startVal = [100,100];
maxVal = [85,85];rampMid = rampStart + (rampEnd - rampStart)/2;
if (time < rampStart || time > rampEnd){
value
}else if (time < rampMid){
ease(time,rampStart,rampMid,startVal, maxVal)
}else{
ease(time,rampMid,rampEnd,maxVal,startVal)
}
Using the code found here, I want to replace the “wobble” effect with my own scale expression above AND have it specify the marker by name, not just any marker on the layer.
n = 0;
t = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if (n > 0) t = time - marker.key(n).time;amp = 15;
freq = 5;
decay = 3.0;angle = freq * 2 * Math.PI * t;
scaleFact = (100 + amp * Math.sin(angle) / Math.exp(decay * t)) / 100;
[value[0] * scaleFact, value[1] / scaleFact];
But I’m not conversant enough in expressions to make it happen. Can anyone help? I’m sure it’s super obvious to someone who knows what they’re doing.