setting a property to an expression from within script
Posted: September 5th, 2008, 12:36 pm
Hi I am making a script that makes an adjustment layer with a levels effect on it and I would like the the rgb gamma property to be an expression deriving its value from the input white property. Although I can get the expression to work as a simple number eg:
I can't seem to get it to work as a string expression pointing to another property (in this example I get an error):
Anyone know what's up with that?
Pete O'Connell
Code: Select all
myComp = app.project.activeItem;
mySolid = myComp.layers.addSolid([0,0,0], "colorCorrect", myComp.width, myComp.height,1);
mySolid.startTime = 0
mySolid.adjustmentLayer = true;
myEffect = mySolid.property("Effects").addProperty("Levels (Individual Controls)");
myEffectProperty = myEffect.property("Gamma");
var myEffectPropertyExpression = "5"
myEffectProperty.expression = myEffectPropertyExpression;
Code: Select all
myComp = app.project.activeItem;
mySolid = myComp.layers.addSolid([0,0,0], "colorCorrect", myComp.width, myComp.height,1);
mySolid.startTime = 0
mySolid.adjustmentLayer = true;
myEffect = mySolid.property("Effects").addProperty("Levels (Individual Controls)");
myEffectProperty = myEffect.property("Gamma");
var myEffectPropertyExpression = "effect("Levels (Individual Controls)")("Input White")"
myEffectProperty.expression = myEffectPropertyExpression;
Pete O'Connell