ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Affecting opacity of a layer with the xposition of a null

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Liam Morris
Affecting opacity of a layer with the xposition of a null
on Feb 25, 2017 at 8:20:37 pm

Hi at the moment i have a script which effects the opacity of a layer to be at 100% opacity when the xposition of a null is at 3. However when the null position is on 4 i would like the opacity of the layer to go back to 0% opacity.

this is the script i have currently. Its placed in the layers opacity.

x = thisComp.layer("Null").transform.position[0]
linear (x, 2, 3, 100, 0)


Return to posts index

rob mcgowan
Re: Affecting opacity of a layer with the xposition of a null
on Feb 26, 2017 at 11:17:41 pm

How about you test to see if x is less than 3. If it is use linear else set 0. Something like

x = thisComp.layer("Null").transform.position[0];
if (x<3) {
linear (x, 2, 3, 100, 0)
} else {0}


Return to posts index

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