Copy this script into a text file and save it as stackinator2000.jsx then in AE go to File>Scripts>Run Script File and load the file you saved. Then select a layer and run it.
NOTE
- It will take a long time if the comp is long.
- It will create a layer for every frame. I hope you've got a fast machine.
- save your project before trying it. I've tested it and it works here, but all care, no responsibility, yadda yadda.
- It is important that the script is saved as stackinator2000.jsx—trust me on this one. If that's unacceptable then calling it The_Mighty_Stackatron.jsx or stackMeister_77.jsx is a possible workaround, but it will be 25% less awesome.
app.beginUndoGroup('stackinator2000');
var theComp = app.project.activeItem
if (!theComp) {
//no comp selected, silly rabbit
alert('choose a layer in a comp');
} else {
var theLayer = theComp.selectedLayers[0];
if (!theLayer) {
//no layer selected
alert('choose a layer');
} else {
var firstFrame = Math.max(theLayer.inPoint / theComp.frameDuration, 0);
var lastFrame = Math.min(theComp.duration, theLayer.outPoint) / theComp.frameDuration
var frame;
//set the blending mode while we're at it
theLayer.blendingMode = BlendingMode.LIGHTEN;
//turn on time remapping
theLayer.timeRemapEnabled = true;
//delete the last key to make it a freeze frame - this will remove any other time remapping set
while (theLayer.timeRemap.numKeys > 1) {
theLayer.timeRemap.removeKey(2)
}
//step forward one frame at a time
for (frame = firstFrame; frame +1 < lastFrame; frame++) {
//duplicate the layer and work with the new layer
theLayer = theLayer.duplicate();
//offset the inpoint by one frame
theLayer.inPoint = (frame + 1) * theComp.frameDuration;
//prevents weirdness with the out point that I don't understand
theLayer.outPoint = lastFrame * theComp.frameDuration;
//set the time remapping for the first frame of the layer
theLayer.timeRemap.setValueAtTime(theLayer.inPoint, theLayer.inPoint - theLayer.startTime);
//delete the old key which should be before the current one
while (theLayer.timeRemap.numKeys > 1) {
theLayer.timeRemap.removeKey(1);
}
}
}
}
app.endUndoGroup();