Advertisement
zebadeee

Random Number, Random Time

Apr 22nd, 2020
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. segMin = .3; //minimum segment duration
  2. segMax = .7; //maximum segment duration
  3. minVal = [0.1*thisComp.width, 0.1*thisComp.height];
  4. maxVal = [0.9*thisComp.width, 0.9*thisComp.height];
  5.  
  6. end = 0;
  7. j = 0;
  8. while ( time >= end){
  9.   j += 1;
  10.   seedRandom(j,true);
  11.   start = end;
  12.   end += random(segMin,segMax);
  13. }
  14. endVal =  random(minVal,maxVal);
  15. seedRandom(j-1,true);
  16. dummy=random(); //this is a throw-away value
  17. startVal =  random(minVal,maxVal);
  18. ease(time,start,end,startVal,endVal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement