Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random Jump Cuts — sliding off the end of the footage?

  • Random Jump Cuts — sliding off the end of the footage?

    Posted by Jason Guest on November 29, 2012 at 6:23 pm

    Hello! I have a query about the Random Jump Cuts expression which appears on Dan Ebberts’ famous website. It’s a bit of a favourite of mine. The code is as follows:


    segDur = .5;// duration of each "segment" of random time
    minVal = inPoint;
    maxVal = outPoint - segDur;

    seed = Math.floor(time/segDur);
    segStart = seed*segDur;
    seedRandom(seed,true);
    startVal = random(minVal,maxVal);
    endVal = startVal + segDur;
    linear(time,segStart,segStart + segDur, startVal, endVal);

    In the third line the variable “maxVal” is changed to the layer’s Out Point minus the segment duration so that we don’t slide off the end of the footage. Except that this doesn’t seem to work anymore. It now does slide off the end of the footage and shows a held final frame.

    I’ve used this expression quite a few times and have never encountered a problem before – could it be to do with switching from CS4 to CS5? I can’t for the life of me find anything wrong with the code.

    Can anybody help?

    J. J. Guest

    Jason Guest replied 13 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 29, 2012 at 7:45 pm

    Did you extend the duration of the layer after you turned on time remapping? That would do what you’re seeing.

    Dan

  • Jason Guest

    November 30, 2012 at 10:46 am

    Hi Dan,

    I might have moved the whole clip along the timeline. I find that if I start the clip on frame one (or pre-compose it) the problem goes away…

    Jason

  • Dan Ebberts

    November 30, 2012 at 4:05 pm

    This variation might work better for that situation:

    segDur = .5;
    dur = key(2).time – key(1).time;
    maxVal = dur – segDur;
    seed = Math.floor(time/segDur);
    segStart = seed*segDur;
    seedRandom(seed,true);
    startVal = random(maxVal);
    endVal = startVal + segDur;
    linear(time,segStart,segStart + segDur, startVal, endVal);

    Dan

  • Jason Guest

    November 30, 2012 at 4:29 pm

    Thanks Dan! That’s smart.

    — Jason

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