Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random Lines – movement from a certain point

  • Random Lines – movement from a certain point

    Posted by Katherine Landgrebe on November 18, 2009 at 5:08 pm

    Hi,

    I’m working with Dan’s Random Lines Expression.
    Now I tried to set a certain starting point, which works fine when I set the startVal = value[0], but there is a jump to the next frame. How can I make the line move without a jump?

    if (time<=3) {
    value
    }

    else {
    tMin = .5; //minimum segment duration
    tMax = 6; //maximum segment duration

    end = 0;
    j = 0;
    while (time >= end){
    j++;
    seedRandom(j,true);
    start = end;
    end += random(tMin,tMax);
    }
    endVal = random(thisComp.width);
    seedRandom(j - 1,true);
    x = random(); //this is a throw-away value
    startVal = value[0];
    x = ease(time,start,end,startVal,endVal);
    [x,value[1]]
    }

    Katherine Landgrebe replied 16 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 18, 2009 at 7:05 pm

    Try this:

    beginTime = 3;

    if (time<=beginTime) { value }else { t = time - beginTime; tMin = .5; //minimum segment duration tMax = 6; //maximum segment duration end = 0; j = 0; while (t >= end){
    j++;
    seedRandom(j,true);
    start = end;
    end += random(tMin,tMax);
    }
    endVal = random(thisComp.width);
    seedRandom(j – 1,true);
    x = random(); //this is a throw-away value
    if (j > 1){
    startVal = random()*this_comp.width;
    }else{
    startVal = value[0];
    }
    x = ease(t,start,end,startVal,endVal);
    [x,value[1]]
    }

    Dan

  • Katherine Landgrebe

    November 18, 2009 at 7:37 pm

    Perfect!!!
    Thank you so much. You saved my day 🙂 *curtsy*

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