Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Create a reference layer for an expression

  • Create a reference layer for an expression

    Posted by Rens Wegerif on June 22, 2015 at 12:00 pm

    Hello everybody,

    Here is a problem that occurs with my projects quite often. I am working on a project on wihich I have over hundred layers. I have written some expression for the opacity value for the layers, and copied it to all other layers. It’s kinda tedious work. Now I want to change the code, but I have to go through all the layers once again 🙁 Is there a way to get the expression from one layer, like reference to that layer in the expression box? I tried linking to a marker comment, linking to a text layer’s source text, but both don’t seem to work….

    Thanks in advance 🙂

    thisComp.layer("wiggle(.5,12)").text.sourceText

    and this one:

    n = 0;
    if (thisComp.layer("markers").marker.numKeys > 0){
      n = thisComp.layer("markers").marker.nearestKey(time).index;
      if (thisComp.layer("markers").marker.key(n).time > time){
        n--;
      }
    }

    if (n == 0){
     "";
    }else{
    opacity=thisComp.layer("markers").marker.key(n).comment;
    }

    Rens Wegerif replied 10 years, 10 months ago 1 Member · 1 Reply
  • 1 Reply
  • Rens Wegerif

    June 22, 2015 at 2:08 pm

    Found it!

    Create an extra comp called “// Controller” with a Text layer called // Expression.
    For the source text of this text layer, apply your expression.

    Ad the following expression to all the layers that need that same expression:

    eval(comp("// Controller").layer("// Expression").text.sourceText.toString())

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