Voila!
I’m here to teach, so please ask questions for anything you don’t understand.
// we might make a lot of comps, so let's make sure we can un-make them easily!
app.beginUndoGroup("Make some comps!");
// set originalSource to refer to the footage item you want to offset across your comps
var originalSource = app.project.item(1);
// how many seconds should each comp be?
var compDuration = 30;
// how much time should we offset in each new comp we create?
var timeOffset = 10;
// keep creating comps until we've offset the entire duration
for (var i = 0; i < originalSource.duration / timeOffset; i++) {
// make the new comp with the same properties as the originalSource, but at our custom duration
var newComp = app.project.items.addComp("Comp " + (i+1), originalSource.width, originalSource.height, originalSource.pixelAspect, compDuration, originalSource.frameRate);
// add the originalSource as a new layer in that new comp
var newLayer = newComp.layers.add(originalSource);
// pull the start time back according to the total offset for this specific comp, then trim the inPoint back to zero for cleanliness's sake
newLayer.startTime = -timeOffset* i;
newLayer.inPoint = 0;
// delete the comp if the duration of the trimmed footage is less than the duration -- no blank spaces!
if (newLayer.outPoint < newComp.duration) newComp.remove();
}
app.endUndoGroup();
Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive | RenderBreak [blog] | Profile [LinkedIn]