-
Marker triggered animation, more than one set of keyframes
I’m using the expression below to trigger animation each time a marker is passed. Right now it works for one single type of animation, for example movement in x.
Is there a way to revise the expression so it triggers different events based on markers? That way it would do a first set of x movement keyframes on the first marker, but then a completely different animation, for example movement in y on the second marker and so on. Each animation would have its own set of keyframes, independent from each other.Maybe the second animation could follow markers in the layer, not the timeline? No idea.
As always, thanks everyone for your help.
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}if (n > 0){
valueAtTime(time-marker.key(n).time);
}else{
valueAtTime(0);
}