extendscriptafter-effects

Get frames of layer ExtendScript (After Effects)


Does anyone know I can get all frames of a layer with their pixels with ExtendScript js? I got the selected layer and I want to be able to loop through the frames and compare the pixels of them. But I can't find a property called frames or so on the layer object.


Solution

  • There is no direct access to frames in the API. Frames aren't really a thing, basically you have Comps, Layers, and Properties.

    If you want to examine the pixels of a layer there is no way to do that within the API either, apart from adding an expression that uses the sampleImage() expression method, and getting the value it returns. To do this for every pixel would be glacially slow.

    Think of scripting as automating the UI. There's pretty much nothing you can do with scripts that you couldn't achieve as a user using the program, just much slower. To access and change the pixels in a layer you really need to be using the SDK and C++, not extendscript.