Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions exponential blinking

  • exponential blinking

    Posted by Marc Rühl on December 25, 2012 at 3:29 pm

    I try to do an animation, where you see a black square, which disappears after 10 frames, but only for one frame. Then it disappears after 9 frames, again only for one frame etc. till it blinks every frame.
    Would be great if it would continue in the opposite direction: invisible for 2 frames, visible for one, invisible for 3, visible for one etc.

    First I tried it with a sinus function, but that seems to be the wrong way. Do I have to use exp()?
    Would be nice if someone just point me in the right direction.

    http://www.schwarzgrau.com

    Marc Rühl replied 13 years, 3 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    December 25, 2012 at 8:09 pm

    That’s a tricky one. I think it’s going to be something like this:


    sf = [0,11,21,30,38,45,51,56,60,63,65,68,72,77,83,90,98,107,117,
    128,138,147,155,162,168,173,177,180,182,185,189,194,200,207,215,224];
    on = [10,9,8,7,6,5,4,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,4,5,6,7,8,9];

    f = timeToFrames(time-inPoint)%234;
    i = 0;
    if (f >= sf[sf.length-1]){
    i = sf.length-1;
    }else{
    i = 0;
    while (sf[i] <= f) i++;
    i--;
    }
    d = f - sf[i];
    if (d >= on[i]) 0 else 100

    Dan

  • Marc Rühl

    December 25, 2012 at 11:55 pm

    I didn’t expected someone to answer during the christmas holidays, so thank you a lot for this. Unfortunately the script doesn’t work like expected.
    My javascript-knowledge is too bad to understand everything in this expression, otherwise I could try to adjust it.

    I expected something like a halfway simple solution, which is just a little bit to complicated for someone like me.
    Would it be easier if it don’t need to be exakt 10, 9, 8, 7 etc.? just a blinking, which gets faster and faster, without exakt numbers? or if a slider is involved?

    I’m really really sorry to bother you again, especially on the holidays.
    By the way merry christmas and again thank you a lot.

    Marc

    http://www.schwarzgrau.com

  • Dan Ebberts

    December 26, 2012 at 12:25 am

    Speed control is not something that is easy to do with expressions. This will give you some background:

    https://www.motionscript.com/articles/speed-control.html

    Dan

  • Marc Rühl

    December 26, 2012 at 12:30 am

    Thank you a lot Dan!

    Marc

    http://www.schwarzgrau.com

  • Marc Rühl

    January 17, 2013 at 6:49 pm

    I tried it again and found a solution. Maybe it’s usefull for someone else:

    I created a black solid and attached a slider to it. The value of the slider is keyframed from 10 (at the beginning) to 2 at the end.
    Then I created 11 keyframes on the transparency. Except of the 10th keyframe, which got the value of 100%, all the keyframes got 0% as value.

    Now I used this expression on the transparency.

    pausectrl = effect("Slider Control")("Slider");
    loopOut(type = "cycle", numKeyframes = pausectrl)

    http://www.schwarzgrau.com

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