I'm new to this scripting thing - I've dabbled with expressions, and I can generally program computers (ie. I generally understand it). But I'm trying to do something here which is driving me mental, because it should be simple.
I'm trying to create a script which will firstly, randomise the linking of footage from a pool of source footage. Then secondly, as the pool contains footage of different lengths, I want to enable time remapping for each layer and on the last keyframe of each, hold the keyframe until the end of the comp. The effect is to create a 5x5 grid of clips all running out and holding on the last frame at different times (reason why I'm scripting this is because I need to create thosands of these 'panes' of 5x5 and tile them up and pull a camera out to give the impression of zillions)
My lame code so far is as follows:
Code: Select all
myComp = app.project.item(2); // how do I refer to an item by name, not index?
for (j = 1; j <= 25; j++) {
myComp.layer(j).timeRemapEnabled.TRUE;
tDur = myComp.layer(j).source.duration;
tStart = Math.random()*tDur;
myComp.layer(j).inPoint = tStart;
myComp.layer(j).startTime = -1*tStart;
}
Also, I should say I'm using 6.5.
Any pointers would be much appreciated - thanks.
Regards,
Paul.