Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Opacity change with multiple layer markers

  • Opacity change with multiple layer markers

    Posted by Naoko Hara on January 30, 2019 at 9:48 pm

    I want to trigger multiple (two in this case) opacity changes via layer markers on a single layer.

    I used below to trigger one opacity change.
    if (marker.numKeys > 0 && time >= marker.key(1).time){
    thisComp.layer(“N_Op_text”).transform.opacity.valueAtTime(time-(marker.key(1).time));
    }
    else{value}

    The expression looking at a null layer with opacity change. “N_Op_text” makes the opacity go from 100 to 50%.
    If I want to manipulate this exp so it would be able to trigger another opacity animation (eg. it will look at a different null layer named “N_Op_out” that makes the layer go from whatever current value is to zero), how would I do that?

    THANKS

    if (marker.numKeys > 0 && time >= marker.key(1).time){
    thisComp.layer("N_Op_text").transform.opacity.valueAtTime(time-(marker.key(1).time));
    }
    else{value}

    Kalleheikki Kannisto replied 7 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    February 3, 2019 at 12:58 pm

    You could do it like this, if you need it to go to 0. If you need it to match the opacity of another layer, replace the “0” by pick-whipping the opacity of that other layer.

    if (marker.numKeys > 1 ){
    if (time >= marker.key(1).time){
    thisComp.layer("N_Op_text").transform.opacity.valueAtTime(time-(marker.key(1).time));
    if (marker.numKeys == 2 && time >= marker.key(2).time){0};
    }else{value}
    }else{value}

    (Will only work properly if you have two markers on the layer.)

    Kalleheikki Kannisto
    Senior Graphic Designer

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