FORUMS: list search recent posts

include a script from another layer?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Greg Neumayer
include a script from another layer?
on Nov 19, 2010 at 12:27:32 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
http://www.antifreezedesign.com


Return to posts index

Dan Ebberts
Re: include a script from another layer?
on Nov 19, 2010 at 1:47:41 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



Return to posts index

Greg Neumayer
Re: include a script from another layer?
on Nov 19, 2010 at 5:26:25 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
http://www.antifreezedesign.com


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]