How do I write script that will do some event every frame?
I basically need a loop that will, lets say add marker in every single frame.
example:
for(int i = 0; i<totalFrames;i++){
addmarker();
}
I basically need a loop that will, lets say add marker in every single frame.
example:
for(int i = 0; i<totalFrames;i++){
addmarker();
}
This code will process each frame on one selected layer.
var myComp = app.project.activeItem,
layer = app.project.activeItem.selectedLayers[0],
inPoint = layer.inPoint,
outPoint = layer.outPoint,
frameDur = myComp.frameDuration,
myMarker;
app.beginUndoGroup("AddMarker");
for(var t = inPoint; t< outPoint; t+=frameDur){ // change outPoint to myComp.duration to process the whole composition
myMarker = new MarkerValue(t); // change marker value
layer.property("Marker").setValueAtTime(t, myMarker);
}
app.endUndoGroup();
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.