0

I want each frame of video to get added on top of the previous frames. I don't want any of them to fade out. I am shooting locked down with a black background. A model moves through the frame with a light. I want to stack the frames one on top of the others so that the light moves through the frame and the last frame shows the path taken as a light trail.

What is the easiest way to add each new frame on top of the rest? I would like to avoid putting a separate layer for each frame manually.

3

Use "Echo" effect. I believe it will suite you.

You need adjust it. Make number of echos equal to your frame count.

-1

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();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.