Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Need one layer to reference the markers and expression on the layer above

  • Need one layer to reference the markers and expression on the layer above

    Posted by Chris Huggett on March 26, 2007 at 4:36 pm

    hi guys

    i have a white solid that has a bunch of markers on it. when the markers occur, the solid dissolves up and down again over a given period of time, using the solid composite effect and an expression slider

    I need to have 2 layers do this, but one of the layers needs to take the other layers markers and controls. Heres my expression on my master layer

    try{
    flashWidth = effect(“Opacity Flash – layer markers”)(“Slider”) / 2000;
    timeToMarker = Math.abs(time – marker.nearestKey(time).time);
    easeOut(timeToMarker, flashWidth, 0, 100, 0)
    }catch(err1){
    100
    }

    The second slave layer is called White_Dissolve2

    Im sure i dont need the effects and can just use a white layer that dissoves up and down based on markers, but i borrowed this code from version 7s presets, and im using version 6.5

    Cheers
    Chris

    Chris Huggett replied 19 years, 1 month ago 2 Members · 8 Replies
  • 8 Replies
  • Chris Huggett

    March 26, 2007 at 5:06 pm

    ok so i was thinking about what i need and it might be simpler to have a solid white layer, that has an expression slider effect, that looks at the layers below it and based on the in and out points, the opacity of the white solid is opaque at the cut point and then based on the slider value, fades up or down over 6 frames.

    Is this possible?
    Thanks once again
    Chris

  • Dan Ebberts

    March 26, 2007 at 6:35 pm

    More info would help. So are you trying to get the white solid to fade up as you approach a layer’s Out Point and fade down as you move away from it?

    Dan

  • Chris Huggett

    March 26, 2007 at 7:16 pm

    Sorry Dan… I just assumed coz you know everything about expressions you could also see inside my head aswell 😉

    What i have is a sequence of 3second clips, arranged one after the other. At the out point of each clip, i would like a white solid layer to be 100% opaque and then over 6 frames dissolve to 0% transparencey, similar to a white flash/dissolve, but because there will be so many clips, i thought it would be easier to set an expression that looked at the in and out points of the layers beneath it.

    I hope this is alot clearer.

    thanks alot once again.
    Chris

  • Dan Ebberts

    March 26, 2007 at 7:33 pm

    Something like this should work. It assumes that the In Point of the currently visible layer is where you want the flash to occur. It also suppresses the flash at time = 0.

    
    
    
    fadeFrames = 6;
    
    fadeTime = fadeFrames*thisComp.frameDuration;
    opat = 0;
    for (i = 1; i <= thisComp.numLayers; i++){
      if (i == index) continue;
      L = thisComp.layer(i);
      if (! (L.hasVideo && L.active)) continue;
      if ((time > fadeTime) && (time <= L.inPoint + fadeTime)){
      opat = easeOut(time, L.inPoint, L.inPoint + fadeTime, 100, 0)
        break;
      }
    }
    opat
    
    
    

    Dan

  • Chris Huggett

    March 26, 2007 at 7:53 pm

    thanks Dan, thats great, but is it possible to have it also fade up as the time approaches the outpoint of the layer also

    thanks for helping. i really appreciate it.
    chris

  • Chris Huggett

    March 26, 2007 at 8:02 pm

    thanks Dan, thats great, but is it possible to have it also fade up as the time approaches the outpoint of the layer also

    thanks for helping. i really appreciate it.
    chris

  • Dan Ebberts

    March 26, 2007 at 8:08 pm

    Give this one a try:

    fadeFrames = 6;

    fadeTime = fadeFrames*thisComp.frameDuration;
    opat = 0;
    for (i = 1; i <= thisComp.numLayers; i++){ if (i == index) continue; L = thisComp.layer(i); if (! (L.hasVideo && L.active)) continue; if ((time > fadeTime) && (time <= L.inPoint + fadeTime)){ opat = easeOut(time, L.inPoint, L.inPoint + fadeTime, 100, 0) break; }else if (time > L.outPoint – fadeTime){
    opat = easeIn(time, L.outPoint – fadeTime, L.outPoint, 0, 100);
    break;
    }
    }
    opat

    Dan

  • Chris Huggett

    March 26, 2007 at 8:24 pm

    NT

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