-
Triggering linear animation / time-remapping with markers
Hello everybody,
I’m trying to trigger an animation within a precomp with markers on the precomp layer. Inside the precomp I’ve put composition markers whenever a new part of the animation starts. It is based off of Dan Ebbert’s marker animation script.
The main difference is: I’m trying to have the time gradually increase from the one precomp marker’s time to the next. Also I want it to loop through the precomp’s markers/animation for as long as there are markers on the precomp layer.
I’m really not sure why it’s not working, but I’m just starting to learn more about AE Scripting so I’m hoping anybody can tell me whats wrong with my expression.
This is the expression on the Time-Remap of the precomp layer.
preComp = comp(name);var previousMarker;
nextMarkerPrecomp = 0;if(marker.nearestKey(time).time <= time){
previousMarker = marker.nearestKey(time).index;
}else{
previousMarker = marker.nearestKey(time).index -1;
}if(previousMarker > marker.numKeys) {
if(time >= marker.key(previousMarker).time && time < marker.key(previousMarker+1).time){
if (nextMarkerPrecomp == preComp.marker.numKeys - 1) { // If next Precomp Marker is the last, reset the PreCompMarker index
nextMarkerPrecomp = 0;
}
else {
nextMarkerPrecomp = (marker.nearestKey(time).index % preComp.marker.numKeys) - 1;
}
linear(time, marker.key(previousMarker).time, marker.key(previousMarker+1).time, preComp.marker.key(nextMarkerPrecomp-1).time, preComp.marker.key(nextMarkerPrecomp).time);
}
}Edit: To be more precise: What’s happening now is that at every marker on my precomp layer the time remapping function increases by one second without any interpolation between the markers