Search code examples
expressionafter-effects

After Effects Expressions: getter/setter functions


I'm trying to figure out if you can write an After Effects expression that works as a setter function. The pick whip basically works as a get function:

// vars s and c generated from the pick whip:
var s = thisComp.layer("debugger").text.sourceText;
var c = effect("my checkbox")("Checkbox");

However, I can't seem to set a value somewhere else from within that same chunk of code.

 // doesn't work:
 s = (c==true)?"a":"b";

Is there a way to set the value of a property from code somewhere else, like another layer?


Solution

  • Expressions modify the value of their host property, and nothing else.