Last active
August 18, 2020 09:52
-
-
Save forresto/7ac162e0c152a34b0d8d78fd5efce173 to your computer and use it in GitHub Desktop.
ae pingpong scripting pseudocode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Imagined API | |
import AE from 'ae' | |
// Assumes playBackwardDuration is less than playForwardDuration | |
function (clip, playForwardDuration, playBackwardDuration) { | |
let time = 0; | |
const edits = [] | |
while (time < clip.clipDuration) { | |
let playHead = time; | |
edits.push(AE.edit(playHead, playHead + playForwardDuration, 1)); | |
playHead = playHead + playForwardDuration; | |
edits.push(AE.edit(playHead, playHead - playBackwardDuration, -1)); | |
playHead = playHead - playBackwardDuration; | |
time = playHead; | |
} | |
return edits; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment