Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Object in Z space w/ Random Velocity Part 2

  • Object in Z space w/ Random Velocity Part 2

    Posted by Bryan on January 7, 2007 at 1:20 am

    This script worked great:

    minV = 100; // min velocity (pixels per second)
    maxV = 500;
    seedRandom(index,true);
    V = random(minV,maxV)
    value + [0,0,time*V]

    Thanks!

    Now, not to be a pest, but: What if I wanted at say, frame 45 or 1 and half seconds into the animation (at a give point in the timeline at any rate), the animation reversed direction and all layers came back to zero and landed. Also what would it be if they reversed and came back in z and continued on into -z. Also, what if I wanted the layers to just go in the -z direction to begin with. What would these scripts look like?

    Sorry to be a pest. Thanks SOO much, Dan. That script saved my bacon.

    -bryan keeling

    Bryan replied 19 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 7, 2007 at 4:22 am

    These should work (in the order you asked for them):

    switchTime = 1.5; //time to reverse direction
    minV = 100; // min velocity (pixels per second)
    maxV = 500;
    seedRandom(index,true);
    V = random(minV,maxV);
    if (time < switchTime){ value + [0,0,time*V]; }else if (time < switchTime*2){ value + [0,0,(2*switchTime - time)*V]; }else{ value } switchTime = 1.5; //time to reverse direction minV = 100; // min velocity (pixels per second) maxV = 500; seedRandom(index,true); V = random(minV,maxV); if (time < switchTime){ value + [0,0,time*V]; }else{ value + [0,0,(2*switchTime - time)*V]; } minV = 100; // min velocity (pixels per second) maxV = 500; seedRandom(index,true); V = random(minV,maxV); value - [0,0,time*V] Dan

  • Bryan

    January 7, 2007 at 5:01 am

    Dan, you totally rock. Thanks.

    -b

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy