perazite

AE - bounce expression

Mar 27th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = 0;
  2. if (numKeys > 0){
  3. n = nearestKey(time).index;
  4. if (key(n).time > time){
  5. n--;
  6. }
  7. }
  8. if (n == 0){
  9. t = 0;
  10. }else{
  11. t = time - key(n).time;
  12. }
  13.  
  14. if (n > 0 && t < 1){
  15. v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
  16. amp = .05;
  17. freq = 4.0;
  18. decay = 8.0;
  19. value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
  20. }else{
  21. value;
  22. }
Add Comment
Please, Sign In to add comment