Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Posterize Time with offset

  • Posterize Time with offset

    Posted by Eric Barker on February 8, 2012 at 11:47 pm

    This is a common problem I’ve run into, but never been able to figure out. Often times, I want expression values to change at a rate slower than the composition fps. But I’ll have several layers that I want to change at different times from each other, like flashing christmas light bulbs, or something of that nature. If I use posterizeTime(), I can set the rate of change, but the phase is global for the entire composition, so no matter when a layer begins, all layers will change at the same time.

    How would I have two layers that change at the same framerate, but are offset from each other?

    Currently, I am randomly picking “source text” values for text layers, so as to display temperatures. I have a bunch of these layers on screen at once, and I want each one to change independantly of each other.

    Television Producer
    KTVF-11 Fairbanks, Alaska
    video.ericbarker.com

    Eric Barker replied 14 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 9, 2012 at 12:41 am

    I’d do my own posterizing, with something like this:

    period = 2; // 2 seconds
    txt = [“0″,”1″,”2″,”3″,”4”];

    seedRandom(index,true);
    phase = random(period);
    seed = Math.floor((time+phase)/period);
    seedRandom(seed,true);
    idx = Math.floor(random(txt.length));
    txt[idx]

    Dan

  • Eric Barker

    February 9, 2012 at 1:12 am

    That worked great! I modified it to randomly generate numbers instead of choosing from a list of elements, but basically, that was it.

    After a little bit of studying, I understand how it works. This will help me a lot in the future when trying to figure out how to control random number generation, as well as managing time.

    Thanks, Dan!

    Television Producer
    KTVF-11 Fairbanks, Alaska
    video.ericbarker.com

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