-
Controlling shape opacity with an expression
Hi guys.
I’m busy with an animation for a client, that relies heavily upon the expression for sampleImage()
I’m using the expression on Evan Abrams’ youtube, where the shape’s size or scale is connected to a control layer via the following expression:sourceLayer = thisComp.layer(“gradientControlLayer_comp”);
sampleSize = [1,1];
samplePoint = transform.position;
colour= sourceLayer.sampleImage(samplePoint,sampleSize);
x=colour[0]*16;
[x,x]Now I want to see what the possibility would be, to link this to an opacity property, instead of a size or scale.
I tried adjusting the expression myself, but failed horribly and I would like to ask if any of you would be bale to assist me?The core of this enables me to control the shape of multiple objects, using a gradient animation in a comp as a control layer. I would like to do the same for opacity, if that is possible ?
Thanks!
NealsourceLayer = thisComp.layer("gradientControlLayer_comp");
sampleSize = [1,1];
samplePoint = transform.position;
colour= sourceLayer.sampleImage(samplePoint,sampleSize);
x=colour[0]*16;
[x,x]