Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions alpha in/out on markers with option to flicker

  • alpha in/out on markers with option to flicker

    Posted by Juanluis Vich on June 25, 2016 at 8:35 pm

    Hi!
    I am working with an alpha in/out when reaching the markers called “in” and “out” . It works good, but I’d need to add an extra option with a checkbox to add a flicker only when the fade in and out is there. I did a close try, but when I add the flickering option, it never stops, so I was wondering if you could give me a clue?
    This is the expression on the alpha I’m using (without the flickering option)

    durIn =effect("duracionIn")("Slider")
    durOut = effect("duracionOut")("Slider")
    di=framesToTime(durIn)
    do=framesToTime(durOut)
    if (marker.numKeys > 1){
    t1 = marker.key("in").time;
    t2 = marker.key("out").time;
    if (time < (t1+t2)/2)
    ease(time,t1,t1+di,0,100)
    else
    ease(time,t2+do,t2,100,0);
    }else
    value

    I think it’s pretty easy, but not achieving it to work at 100%!
    Thanks!

    Santi Agustí replied 10 years, 1 month ago 2 Members · 3 Replies
  • 3 Replies
  • Santi Agustí

    June 28, 2016 at 12:50 am

    what about this?
    it works for me:

    freq = effect("freq")("Slider");
    amp = effect("amp")("Slider");

    din=framesToTime(effect("durationIn")("Slider"))
    don=framesToTime(effect("durationOut")("Slider"))

    seedRandom(index,false);
    initVal=0;
    endVal=100;
    wendVal =wiggle(freq,amp)

    if (marker.numKeys > 1){
    t1 = marker.key("in").time;
    t2 = marker.key("out").time;

    animateIn = ease(time,t1,t1+din, initVal,endVal);
    animateInFlickr = ease(time,t1,t1+din, initVal,wendVal);
    animateOut= ease(time,t2+don,t2,endVal,initVal);
    animateOutFlickr=ease(time,t2+don,t2,wendVal,initVal);

    if (time < (t1+t2)/2)
    if(time>=don){endVal}else{
    if(effect("flickr in")("Checkbox")==true)
    { animateInFlickr;}else{animateIn;}}

    else{
    if(time

    I know it's messy and dirty, if any expression meister here could tidy up the code maybe it can look better, buuut anyway now it works...

    //

    You can also add an extra nice pulse opacity effect linking the endVal to a slider. You should also add a checkbox, and this code on the slider (which can be called endVal)


    freq = 5;
    amp = 3;
    base = 90;
    innerPulse=base + amp*Math.sin(freq*time*Math.PI*2)

    if(effect("innerPulse")("Checkbox")==true){
    innerPulse;}else{value}

    so when the checkbox is on, there will be a pulse between the "in" and "out" markers, but if checkbox is off, just the value at the slider. Of course the more sliders you link paramerers to, more options you will have in order to animate, but it can get a bit messy on the Effect Controls (I'd use Pseudo Effects to have it less messy)
    happy flickering!

  • Juanluis Vich

    June 28, 2016 at 6:45 pm

    thanks, it seems to work!!

  • Santi Agustí

    June 29, 2016 at 4:18 pm

    wait, there was a couple small bugs!
    I’m attaching here a fixed working file:
    10243_alphaflickr.aep.zip

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