-
Expression efficiency (sampleImage)
An RGB value from one layer needs to affect another layer’s Opacity and Scale. So there are two options – use the sampleImage function in both scale and opacity OR reference scale in opacity:
Scale
target = thisComp.layer(“Layer1”);
value = target.sampleImage([x,y],[5,5])[0]*100;Opacity
target = thisComp.layer(“Layer1”);
target.sampleImage([x,y],[5,5])[0]*50;—–OR——
Scale
target = thisComp.layer(“Layer1”);
value = target.sampleImage([x,y],[5,5])[0]*100;Opacity
transform.scale[0]*0.5Is on of these options more efficient/faster/will cause me less trouble?