-
Time Remap to Markers
I’ve got a pretty simple project that I’ve got mostly working. I’ve got a pre-comp with some footage (named “Footage”) with some composition markers designating crucial spots. It’s nested within the main comp which also possesses a layer called “some.wav” that has its own set of markers.
The idea is to set up markers at key spots in the “some.wav” (the soundtrack) layer and have the footage randomly jump between the marked positions whenever the playhead passes the soundtrack’s markers.
Everything seems to work with the following expression, except only one frame will play from the marked spot in “Footage” before it returns to the beginning of the pre-comp. I’d like to have it play continuously until another jump is triggered. This expression lives on the Time Remap effect on the “Footage” pre-comp.
Advice would be really appreciated. Thanks.
markerLayer = thisComp.layer("some.wav");
myNearestKey = markerLayer.marker.nearestKey(time);n = comp("Footage").marker.numKeys;
i = Math.floor(random(1,n));if (time >= myNearestKey.time){
markerCounter = comp("Footage").marker.key(i).index;
timeRemap.valueAtTime(comp("Footage").marker.key(i).time);}
else{
framesToTime(markerCounter );}