Skip to content

Instantly share code, notes, and snippets.

@animoplex
Created December 25, 2018 02:32
Show Gist options
  • Select an option

  • Save animoplex/bcf2b9a63f11106a2a129d5e980f4831 to your computer and use it in GitHub Desktop.

Select an option

Save animoplex/bcf2b9a63f11106a2a129d5e980f4831 to your computer and use it in GitHub Desktop.
While Loop Example - After Effects Expression by Animoplex
// JavaScript While Loop Example - Created by Animoplex: www.animoplex.com
// The JavaScript While Loop and how it can be used in After Effects.
// Full Tutorial: https://www.youtube.com/watch?v=SG3NyHmfc0s&t=225s
src = thisComp.layer("Control").effect("Acceleration")("Slider");
dur = thisComp.frameDuration;
dist = 0;
t = 0;
while (t < time) {
dist += src.valueAtTime(t) * dur;
t += dur;
}
value + dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment