Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions include a script from another layer?

  • include a script from another layer?

    Posted by Greg Neumayer on November 19, 2010 at 12:27 am

    I’d like to have the same expression applied to every layer (text object), and I’d like to get the script from a “master script” location, presumably on another layer.

    For example, I’m using a helpful script that I got from the cow (see expression box), but I’d simply like to reference the script from another layer, since it’s going to be the same for every text layer. I can set up my numbers in a null, but I’d like to be able to test the effects of an entirely new script on everyone without having to swap out the script on all of them. If I use the pic-whip to reference the null’s script, it almost works, but the “inPoint” property refers to the null’s inpoint instead of the layer the script is applied to. I’d like something like a layer #include. Is there such a thing?

    Thanks,
    Greg

    startScale = 0; // percent of Scale at start
    endScale = 20; // percent of Scale at end
    scaleUpTime = 10; // time to scale up from inPoint in seconds

    s = [endScale - startScale] /scaleUpTime;
    sx = startScale + ((time-inPoint) * s);

    ss = clamp(sx,endScale,startScale);

    value+[ss,ss]

    Antifreeze Design
    https://www.antifreezedesign.com

    Greg Neumayer replied 15 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 19, 2010 at 1:47 am

    Probably the closest you can come would be to stick your expression in a text layer (named “expression”, let’s say) and access it from your other layer like this:

    expr = thisComp.layer(“expression”).text.sourceText.toString();
    eval(expr)

    Dan

  • Greg Neumayer

    November 19, 2010 at 5:26 am

    Perfect. Thank you.
    This lets me change one script to audition a different expression on my 100 or so text layers.
    -Greg

    Antifreeze Design
    https://www.antifreezedesign.com

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