opacity depending on another layer position
3 posts • Page 1 of 1
opacity depending on another layer position
Hi guys, I need some help. I would like to change the opacity of a layer (from 0 to 100%, "hold keyframes" style) based on the position of a layer on another comp.
So basically, it would be a layer showing up once we move another layer (in another comp) to a certain position.
Any help is welcome, thanks!
So basically, it would be a layer showing up once we move another layer (in another comp) to a certain position.
Any help is welcome, thanks!
- huesped
- Posts: 6
- Joined: 09/6/2012, 7:56 am
Re: opacity depending on another layer position
Still looking for a way how to do this 

- huesped
- Posts: 6
- Joined: 09/6/2012, 7:56 am
Re: opacity depending on another layer position
Hello huesped,
try this Expression (copy/paste to the Layer Opacity):
if (thisComp.layer("Solid 1").transform.position[0] <900) {0}
else {100}
Solid 1 = Layer you want to move.
thisComp.layer("Solid 1").transform.position[0] <900 -if the X position is lower then 900, opacity is set to 0- {0}
-if not, opacity is set to 100- else {100}
These two lines are for the Y Position:
if (thisComp.layer("Solid 1").transform.position[1] <500) {0}
else {100}
You can only use X or Y, not both at the same time.
For more Information see here: http://www.motionscript.com
http://www.motionscript.com/mastering-e ... ing-4.html
Hope this can help you.
Hans
try this Expression (copy/paste to the Layer Opacity):
if (thisComp.layer("Solid 1").transform.position[0] <900) {0}
else {100}
Solid 1 = Layer you want to move.
thisComp.layer("Solid 1").transform.position[0] <900 -if the X position is lower then 900, opacity is set to 0- {0}
-if not, opacity is set to 100- else {100}
These two lines are for the Y Position:
if (thisComp.layer("Solid 1").transform.position[1] <500) {0}
else {100}
You can only use X or Y, not both at the same time.
For more Information see here: http://www.motionscript.com
http://www.motionscript.com/mastering-e ... ing-4.html
Hope this can help you.
Hans
- hans123
- Posts: 1125
- Joined: 12/28/2012, 1:37 am
- Location: Paris / France
3 posts • Page 1 of 1