To find out how many layers are in a clip:
this.layersCount = this.timeline.layers.length;
To find out how many frames are inside a layer:
this.firstLayerFrameCount = this.timeline.layers[0].frames.length;
(Increase the 0
inside the brackets to find how many frames are inside another layer)
To find out how many total frames are inside of the clip:
var a = 0;
this.timeline.layers.forEach(function(value){
a += value.frames.length;
})
this.totalFrames = a;
(Note: Let’s say you had 3 frames, each one is 2 frames long, last one stopping at 6, this.totalFrames will be set to 3 and not 6)
To find out where the frames stop (at what number):
var a = 1;
this.timeline.layers.forEach(function(value){
value.frames.forEach(function(frame){
if(frame.end>a){
a=frame.end;
}
})
})
this.timelineEnd = a;
If you use any of the code above, make sure to place it inside of the default script
I hope this helped :)
To summarize:
clip // = the name of the clip
clip.timeline // = refers to the timeline of the clip
clip.timeline.layers // = an array of all the layers inside the timeline
clip.timeline.layers[0].frames // = an array of all the frames inside a layer
clip.timeline.layers[0].frames[0].end // = where a frame stops in the timeline
Also, welcome to the forums @lazybutter!
: )