Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Ebberts Random Motion flip position

  • Ebberts Random Motion flip position

    Posted by Jason Jantzen on November 10, 2015 at 2:02 am

    I can’t for the life of me figure out how to flip the random motion from X position to Y position motion. Anybody know how this works?

    Here’s the code from Dan’s site
    segMin = .3; //minimum segment duration
    segMax = .7; //maximum segment duration
    minVal = 0;
    maxVal = thisComp.width;

    end = 0;
    j = 0;
    while ( time >= end){
    j += 1;
    seedRandom(j,true);
    start = end;
    end += random(segMin,segMax);
    }
    endVal = random(minVal,maxVal);
    seedRandom(j-1,true);
    dummy=random(); //this is a throw-away value
    startVal = random(minVal,maxVal);
    y = position[1];
    ease(time,start,end,[startVal,y],[endVal,y])

    Jason Jantzen
    vimeo.com/jasonj

    Jason Jantzen replied 10 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 10, 2015 at 4:37 am

    This should switch it to y:


    segMin = .3; //minimum segment duration
    segMax = .7; //maximum segment duration
    minVal = 0;
    maxVal = thisComp.height;

    end = 0;
    j = 0;
    while ( time >= end){
    j += 1;
    seedRandom(j,true);
    start = end;
    end += random(segMin,segMax);
    }
    endVal = random(minVal,maxVal);
    seedRandom(j-1,true);
    dummy=random(); //this is a throw-away value
    startVal = random(minVal,maxVal);
    x = position[0];
    ease(time,start,end,[x,startVal],[x,endVal])

    Dan

  • Jason Jantzen

    November 10, 2015 at 4:41 pm

    Aha! I see now. It’s just the last two lines that change. I didn’t think about the ease expression values.

    Thanks Dan!

    Jason Jantzen
    vimeo.com/jasonj

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