|
|
Hi,
Just after some scripting help. I have a simple script that works fine when run without a GUI, but if I use exactly the same code in a version with a GUI it doesn’t work any more.
The aim is to sample the colour of a layer. The script applies a colour control / expression control effect, with an expression that uses sampleImage to read the RGB values. The script then reads the value of the colour control to get the RGB values.
As I said - works fine if I run the script from the scripts menu. But the same thing in a GUI and run from the ScriptsUI Panel doesn’t work. The RGB array variable is just 0. So what am I doing wrong?
Cheers,
-Chris
Offending code:
myLayer[0].property("ADBE Effect Parade").addProperty("ADBE Color Control”);
myLayer[0].property("ADBE Effect Parade").property("ADBE Color Control").property("ADBE Color Control-0001").expression="x=thisLayer.width/2;y=thisLayer.height/2; c=sampleImage([x,y], radius = [2, 2], postEffect = true, t = time);";
var RGB=myLayer[0].property("ADBE Effect Parade").property("ADBE Color Control").property("ADBE Color Control-0001").value;
|
|