ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Inverse opacity based on sample Image

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Austin Alexander
Inverse opacity based on sample Image
on Jan 7, 2019 at 9:49:14 pm

I'm looking for an expression that samples a gradient ramp to affect opacity. But the kicker is because the gradient ramp is also affecting other properties, I need to make it so that opacity is at 100% when the sample point is black and 0% at white.

How do I go about doing this without affecting the other expressions too much or at all?

x = thisComp.layer("gradient").sampleImage(transform.position, [.5,.5]/2, true, time)[0];

100*x


Return to posts index

Dan Ebberts
Re: Inverse opacity based on sample Image
on Jan 7, 2019 at 10:21:05 pm

Try changing the last line to:

100*(1-x)


Dan



Return to posts index

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