copy script source?

What type of scripts do you need?

Moderator: byronnash

Post Reply
daniel
Posts: 7
Joined: January 17th, 2007, 5:24 am

Hi,

is there a way to make a "live copy" of an expression? I wanna like to do somthing like

on Layer 1 (scale):
mul(scale,2);

and on Layer 2 (scale)
"copy script from layer 1"

this means, i don't wanna have the result of expression 1 i only want the script. This would simplify the development on redundant scripts because now only one script has to be edit. Any ideas?

thanks for your time
daniel
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

The only way I can think of to do it would be to put the expression in a text layer and then link your slave expressions to it with an expression like this:

eval("s = " +thisComp.layer("text expr").text.sourceText)



Dan
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

Not sure what I was thinking - this should work better:

eval(thisComp.layer("text expr").text.sourceText.toString())


Dan
daniel
Posts: 7
Joined: January 17th, 2007, 5:24 am

Hi Dan,

thanks for your answer! Really good. I made the expression on "Source" and put the code between quotes.

thanks again
daniel
Post Reply