Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random number held for a specific amount of time

  • Random number held for a specific amount of time

    Posted by Corben Marroquin on June 2, 2015 at 8:38 pm

    I currently have an expression in place that ties each layer’s opacity in a comp to a slider outside of that comp(if the slider is at value 16 then layer 16 inside that comp is 100% opacity, all other layers are 0%). I would like to add a variability to it, so that the slider could or couldn’t turn on a layer and then I want to hold that outcome for some time. I thought perhaps random could work but I’m unsure how to implement this idea. The current expression is below

    C = comp("PARENT COMP");
    ctrl = C.layer("CHILD COMP").effect("Slider Control")("Slider");
    L = C.layer(thisComp.name);
    val = Math.round(ctrl.valueAtTime(time+L.startTime));
    if (Math.abs(index - val) <= 0) 100
    else 0;

    Toma Ever replied 10 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply

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