Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Cross fade multiple layers using an adjustment layer with a slider control

  • Cross fade multiple layers using an adjustment layer with a slider control

    Posted by Rens Wegerif on July 7, 2014 at 11:45 am

    Hello everybody,
    Have been looking around over here, but just can’t seem to find a satisfying code for the following:
    I am trying some multiple camera editing in After Effects. The idea is to load in footage of three different camera angles in one compostion. The opacity of the layers is then parented to one adjustment layer’s slider control.

    What I want to achieve is that when the value of the slider is 1, the first layer is visible. When it then crosses over to 2, the second camera angle footage will gradualy become visible. And so on for the next.

    I’ve found some code that makes it possible to switch between zero and 100, but is it also possible to gradually make this transition…?

    Cheers,
    Rens

    Dan Ebberts replied 11 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    July 7, 2014 at 2:15 pm

    I think the simplest way would be to use something like this:

    s = thisComp.layer(“controls”).effect(“Slider Control”)(“Slider”);
    linear(s,index,index+1,100,0)

    so layer 1 disappears as the slider goes from 1 to 2 (so it would be 50% visible at 1.5), layer 2 disappears as it goes from 2 to 3, etc.

    The (much more complicated) alternative would be to have the slider value trigger an opacity animation when the slider reaches the layer’s index number, if the simple version above doesn’t meet your needs for some reason.

    Dan

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