Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script – to “wiggle” opacity of many layers

  • Script – to “wiggle” opacity of many layers

    Posted by Michael Becke on July 14, 2006 at 9:37 am

    Hi,
    I need to randomly change the opacity levels of many layers, but don’t want to add a wiggle script to every layer since there are hundreds.
    Mainly because if I want to change a setting later on I don’t want to have to change every layer.

    I am currently doing the above (terrible) solution but any help with a much quicker and more streamlined solution would be appreciated.

    Thank you very much!!
    Michael

    Andreas Braendhaugen replied 15 years, 6 months ago 4 Members · 7 Replies
  • 7 Replies
  • Steve Roberts

    July 14, 2006 at 12:30 pm

    Create a null layer and apply the “slider” expression control effect twice. Name one “amp slider” and the other “freq slider”. Apply the wiggle expression to one layer’s opacity, just using freq and amp. You’ll probably get an error – ignore it. Select the word “freq” in the expression, and pickwhip it to the value of the “freq slider”. Do the same for the amp slider. Your wiggle expression should now be tied to the sliders. Change their values to test the wiggle.

    Now select the opacity and edit>copy expression only. Select all the other layers and select edit>paste. They should all now have a wiggle expression. To change freq and amp, change the sliders.

    Does that work for you?

  • Michael Becke

    November 13, 2006 at 3:21 pm

    Thanks Steve,

    That was just what I needed… much appreciated!
    And now I also know you can simply pick whip to add to the expression 😉

    Thanks,
    Michael

  • Andreas Braendhaugen

    September 16, 2010 at 10:06 am

    I’ve found good use for this as well. Thank you, Steve!

    I’m trying to do something slightly different with this expression – is it possible to have the layers fade in/out completely on each wiggle, instead of jumping to random values?

  • Dan Ebberts

    September 16, 2010 at 8:45 pm

    It would be very helpful if you could describe in greater detail, exactly the animation you’re trying to achieve.

    Dan

  • Andreas Braendhaugen

    September 16, 2010 at 9:01 pm

    Hi Dan,

    Sure!

    I have a bunch of shape layers (dozens), that I want to fade in/out and have visible for random periods of time. The length of the fade in/out should be constant for all layers, but the duration of it should be random (between 2 and 20 seconds, roughly). Any suggestions/input would be greatly appreciated.

    I’ve used expressions before, but I’m not quite there when it comes to writing my own.

  • Dan Ebberts

    September 16, 2010 at 10:06 pm

    Play around with this one:


    fadeTime = .25;
    minHold = 2;
    maxHold = 20;

    seedRandom(index,true);
    preRun = random(maxHold);
    if (time >= inPoint + preRun){
    t = inPoint + preRun;
    t0 = t;
    i = 0;

    while (time >= t){
    t0 = t;
    t += random(minHold,maxHold);
    i++
    }

    if (i%2)
    ease(time,t0,t0+fadeTime,0,100)
    else
    ease(time,t0,t0+fadeTime,100,0);
    }else{
    0
    }

    Dan

  • Andreas Braendhaugen

    November 2, 2010 at 1:35 am

    That’s exactly what I needed!

    Dan, thanks a lot.

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