Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Need to randomly fade-in/fade-out layers

  • Need to randomly fade-in/fade-out layers

    Posted by James Huenergardt on March 16, 2007 at 2:47 pm

    Hi,

    I have a map with dots representing cities.
    Between the cities are lines representing communication between them.

    Each line between each city is it’s own layer.

    I would like to randomly fade-in/out each line layer so that some lines are visible and others are not.

    I would like the ‘fade’ to be a set amount (if possible), but the time between fades to be random for each layer.

    Is this even possible?

    Thanks,

    Jim

    Reel Inspirations

    Chris Wasmer replied 5 years, 6 months ago 3 Members · 3 Replies
  • 3 Replies
  • Filip Vandueren

    March 16, 2007 at 7:48 pm

    Hi there,

    I changed this from Dan’s expressions in the tutorial on randomizing motion:
    you can set the timing by customizing the first 5 variables, expressed in seconds.

    !!warning!!
    The following expression can probably NOT be copied from the Email response,
    go to the website and copy it from there.
    It contains some characters (greater than, lesser than) that get screwed up in the email.

    Add this expression to each opacity property:


    //customize
    ONmin = 1; //minimum time to stay on
    ONmax = 2; //maximum time to stay on
    OFFmin = .2; //minimum time to stay off
    OFFmax = 1; //minimum time to stay off

    fadeTime=0.5; //time to fade between on or off

    i =1;
    seed_random(i,true);
    ONtime= random(OFFmin,OFFmax);
    //initial conditions
    OFFtime= ONtime;
    LOOPtime= ONtime;

    while (time >= LOOPtime){
    i = i+2;
    seed_random(i,true);
    ONtime = LOOPtime;
    OFFtime=ONtime+fadeTime+random(ONmin,ONmax);
    seed_random(i+1,true);
    LOOPtime=OFFtime+fadeTime+random(OFFmin,OFFmax);
    }
    if (time<OFFtime) {
    linear(time,ONtime,ONtime+fadeTime,0,100);
    } else {
    linear(time,OFFtime,OFFtime+fadeTime,100,0);
    }

  • James Huenergardt

    March 16, 2007 at 11:34 pm

    Cool man, thanks a bunch!

    Reel Inspirations

  • Chris Wasmer

    November 17, 2020 at 8:31 pm

    Thank you.

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