ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Controlling shape opacity with an expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Neal Strydom
Controlling shape opacity with an expression
on Oct 8, 2018 at 8:45:11 am

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!
Neal

sourceLayer = thisComp.layer("gradientControlLayer_comp");
sampleSize = [1,1];
samplePoint = transform.position;
colour= sourceLayer.sampleImage(samplePoint,sampleSize);
x=colour[0]*16;
[x,x]


Return to posts index

Dan Ebberts
Re: Controlling shape opacity with an expression
on Oct 8, 2018 at 1:09:41 pm

Try replacing the last two lines with this:

colour[0]*100


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]