Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Complicated Opacity/Random/Layers Expression Help.

  • Complicated Opacity/Random/Layers Expression Help.

    Posted by John Cuevas on February 6, 2007 at 9:17 pm

    Hi all, hoping someone might be able to help with this.

    I have a composition with 8 different color solids. Each solid layer is broken up into 24 square masks. These squares need to fade up(18 frames) hold for 3 seconds, then fade down(18 frames).

    What I need to happen is that the boxes will fade up, then fade down into different colors. I copied one of Mr. Ebberts expressions:

    A = 3;
    B = 7;
    C = 5;
    D = 11;

    f = Math.round(time/thisComp.frameDuration);
    t = 0;
    j = 0;
    while (f >= t){
    j++;
    seedRandom(j,true);
    period1 = Math.round(random(A,B));
    period2 = Math.round(random(C,D));
    t += period2 + period1 + 2
    }
    if (f < t - (period2 + 2)){ 0 }else if (f < t - (period2 + 1)){ random(100) }else if (f < t - 1){ 100 }else{ random(100) } Using this expression + an expression on the actual layer opacity is very close, but these boxes flash way too fast & I don't have any clue how to change the parameters to what I need. Perhaps there is a much better way to approach this, but I'm not sure what they approach would be. Sorry for the double post(here & the AE forum didn't see this new forum) Thanks Johnny Cuevas Ck&Co Media Productions Johnny Cuevas, Editor http://www.ckandco.net

    Dan Ebberts replied 19 years, 6 months ago 2 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    February 7, 2007 at 2:11 pm

    It’s hard to figure out what you’re trying to do. Your description doesn’t mention randomness at all but the expression you’re using uses it. If you could specify more exactly what you’re going for, you might get some takers.

    Dan

  • John Cuevas

    February 7, 2007 at 2:43 pm

    Sorry for not making myself clear, I think it would be easier to show you what I’m trying to accomplish.

    ftp://tower:@ftp.ckandco.net

    In the “out” folder I put a windows media of what I’m trying to do with 1 color. I created that using fractals though, so no alphas, which doesn’t really help me.

    The “goal” file is a picture of the schools new fall catalog that is what I’m trying to mimic for video. With the boxes in each changing from one color to another in the pallete. I’ll be layering video over in NLE.

    Thank you Mr. Ebberts for taking the time to help me out with this.

    Johnny Cuevas, Editor
    http://www.ckandco.net

  • Dan Ebberts

    February 7, 2007 at 3:28 pm

    I can’t make your link work.

    Dan

  • John Cuevas

    February 7, 2007 at 3:31 pm

    Sorry, I needed to mention you need to download them. For some reason I can’t figure out how to make them play off the FTP.

    Thanks for taking the time Mr. Ebberts.

    Johnny Cuevas, Editor
    http://www.ckandco.net

  • Dan Ebberts

    February 7, 2007 at 3:38 pm

    OK – I’m willing, but I can’t get to anything to download with that link.

    Dan

  • Dan Ebberts

    February 7, 2007 at 3:40 pm

    If I use http://ftp.ckandco.net, I at least get to an ftp logon screen, but it wants a username and password.

    Dan

  • John Cuevas

    February 7, 2007 at 3:50 pm

    No password, but the username is tower.

    Very strange, I just checked the ftp and it was working fine…

    One more thing for me to look into this week.

    Johnny Cuevas, Editor
    http://www.ckandco.net

  • Dan Ebberts

    February 7, 2007 at 5:40 pm

    OK – play around with this. Add a slider control to each of your segments and add this expression to the slider:

    minDuration = 5;
    maxDuration = 7;

    tEnd = 0;
    n = 0;
    seedRandom(n, true);
    preRun = random(maxDuration);
    while (time + preRun >= tEnd){
    n++;
    seedRandom(n,true);
    dur = random(minDuration, maxDuration);
    tEnd += dur;
    }
    t = time + preRun – (tEnd – dur);

    Add this expression to Opacity:

    fadeIn = 18;
    hold = 90;
    fadeOut = 18;

    d = thisComp.frameDuration;

    t = effect(“Slider Control”)(“Slider”);

    Math.min(linear(t,0,fadeIn*d,0,100), linear(t,(fadeIn + hold)*d,(fadeIn + hold + fadeOut)*d,100,0));

    Add a Fill effect and add this expression to Fill Color:

    fadeIn = 18;
    hold = 90;
    fadeOut = 18;

    minColor = [.5,.5,.5,1];
    maxColor = [.75,.75,.75,1];

    seedRandom(index,true);

    onColor = random(minColor,maxColor);
    offColor = random(minColor,maxColor);

    d = thisComp.frameDuration;

    t = effect(“Slider Control”)(“Slider”);

    if (t < fadeIn * d){ linear(t,0,fadeIn,offColor,onColor); }else{ linear(t,(fadeIn + hold)*d,(fadeIn + hold + fadeOut)*d,onColor,offColor); } See if that gets you closer. Dan

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