Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random roation at a layer marker

  • Kalleheikki Kannisto

    May 6, 2019 at 6:50 am

    Since you are using markers, you would not need to loop every frame, just every marker. You can use the number of markers that you have passed as the loop end number and the current iteration in the loop as the randomSeed, adding the rotations up inside the loop.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Jonas Millgård

    May 6, 2019 at 9:42 pm

    Thanks Kalleheikki for the guidance! It really helped me head in a good direction.

    This is what I came up with and it seems to work.

    rotateTime = .6;
    rotateAmt =0;
    minVal = -270;
    maxVal = 270;
    accum = 0;
    j = 1;

    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time)n--;
    }
    if (n > 0){
    t = time - marker.key(n).time;
    while (j < n) {
    seedRandom(j,true);
    accum += random(minVal,maxVal);
    j++;
    }
    seedRandom(j,true);
    rotateAmt = random(minVal,maxVal);
    r = accum + ease(t,0,rotateTime,0,rotateAmt);
    value + r;
    }else
    value

  • Kalleheikki Kannisto

    May 8, 2019 at 2:49 pm

    ????

    Kalleheikki Kannisto
    Senior Graphic Designer

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