Created
July 18, 2020 15:44
-
-
Save positlabs/5fda638fc6701905883d06029e35009b to your computer and use it in GitHub Desktop.
Spark frame pulse
This file contains hidden or 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
const R = require('Reactive') | |
const Patches = require('Patches') | |
const Animation = require('Animation') | |
let frame = 0 | |
const td = Animation.timeDriver({durationMilliseconds: 1, loopCount: Infinity, mirror: false}) | |
td.onAfterIteration().subscribe(() => { | |
frame ++ | |
Patches.inputs.setScalar('currentFrame', frame) | |
Patches.inputs.setPulse('frame', R.once()) | |
}) | |
td.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment