Playing every Nth frame, then repeating with the next set and so on

What type of scripts do you need?

Moderator: byronnash

Post Reply
Caprinicus
Posts: 1
Joined: January 16th, 2021, 5:28 am

Hey there, this is an odd request. I hope I can explain it well, and that it's even possible! There are a couple of scripts that come close here but I'm having a hard time wrapping my head around the final trick.

I have a video of which I want to play every 36th frame, but then when that is done, repeat from the beginning starting with the first unrendered frame

So the order would be 1, 37, 73, 109... etc, until done, then 2, 38, 74, 110, then 3, 39, etc and so on. So that all frames of the clip get rendered, but are basically divided up into 36 little clips played sequentially

I've found an extremely tedious manual way to do this by exporting as pngs and renaming with a script I made, and then reimporting each set as a new sequence, but as that would have to be redone every time the file changes, I would love to find a way to time remap inside after effects.

This is the first time I have tried something like this, any help at all would be much appreciated!

crossrad
Posts: 9
Joined: May 1st, 2021, 1:36 pm
Contact:

I achieved this with an expression in time remapping the footage, but unlike most properties, if there is no time remapping, there is no stopwatch symbol to Alt-click. However, I found that by selecting "Time->Enable Time Remapping" on the footage layer it creates two keyframes which effectively mean no-remapping. I found that you can Alt-click the stopwatch symbol and enter an expression which overrides the keyframes.

You don't say but I have assumed that the footage is a multiple of 36 frames. I tried this expression:

Code: Select all

target=Math.round(time/thisComp.frameDuration)*36
d=Math.round(thisComp.duration/thisComp.frameDuration)
cycle=Math.floor(target/d)
offset=Math.floor(target%d)
choose=offset+cycle
choose*thisComp.frameDuration

My worry is whether this completely correct in the use of Math.floor/Math.round to get correct results despite javascript maths being floating point.

Post Reply