Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions random pick a comp, play through it, random pick another

  • random pick a comp, play through it, random pick another

    Posted by Victor Jantea on February 11, 2018 at 11:16 pm

    hi everyone
    what i would like to ideally have happen is this:
    one of 7 comps is randomly chosen, it fades in, plays through, another one of the comps is chosen, the first fades out as the second fades in and so on.

    i am selecting one of the comps with a (random) slider, and ideally, when the slider animates (and holds for a while) to an integer between 1 and 7, that comp starts to fade in (as the old one fades out), holds 100% opacity for a while, fades out and so on… the big advantage being that i can smoothly scale the durations of the fade in/out/hold of the comps

    so far i’ve managed to: get some checkboxes to randomly turn on one at a time and get a comp to fade out every time a checkbox turns to OFF. but i can not figure out how to get it to also fade in as the checkbox turns to ON in the same expression, it’s either one or the other and i need both… i probably need a WHILE or a FOR expression going back from current playhead time but it’s really exhausted me just from figuring the rest out… help? ☺ thank you!

    t=time
    fadeTime=effect("fade")("Slider")
    threshold = 0.5
    above = false
    frame = Math.round(time / thisComp.frameDuration)

    while (true){
    t = frame * thisComp.frameDuration;
    if (above){
    if (thisComp.layer("test slider to checkbox").effect("check 1")("Checkbox").valueAtTime(t) < threshold){
    frame++;
    break;
    }
    }else if (thisComp.layer("test slider to checkbox").effect("check 1")("Checkbox").valueAtTime(t) >= threshold){
    above = true;
    }
    if (frame == 0){
    break;
    }
    frame--
    }
    if (! above){
    t = 0;
    }else{
    t = time - frame * thisComp.frameDuration;
    }

    ease(t,0,fadeTime,value,0)

    //https://forums.adobe.com/thread/2267339

    Victor Jantea replied 8 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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