Activity › Forums › Adobe After Effects Expressions › Layers opacity dependent on each other
-
Layers opacity dependent on each other
Albert Kowalski replied 8 years, 2 months ago 3 Members · 12 Replies
-
Steve Sierra
February 15, 2018 at 4:57 pmHere goes :
Let’s say you have 4 mouth shapes.
You create a shape or a solid which will be your rig. name it “RIG”
Create 4 text layers, each one with a mouth shape.
Distribute them along the x axis of your comp.
Now we divide your comp in the number of mouth shapes you have (4 in our case so if your comp width is 1920px, than each mouth shape “zone” will be of 480px).
In each mouth shape opacity prop, you have to put an expression like this :for 1st mouth shape :
var rigXPos = thisComp.layer(“RIG”).transform.position[0];
if(rigXPos >= 0 && rigXPos < 480){100}else{0};for the second :
var rigXPos = thisComp.layer(“RIG”).transform.position[0];
if(rigXPos >= 480 && rigXPos < 960){100}else{0};for the third :
var rigXPos = thisComp.layer(“RIG”).transform.position[0];
if(rigXPos >= 960 && rigXPos < 1440){100}else{0};and the last :
var rigXPos = thisComp.layer(“RIG”).transform.position[0];
if(rigXPos >= 1440 && rigXPos < 1920){100}else{0};Make sure your keys are set on hold and you should be good to go !
Cheers 😉
-
Albert Kowalski
March 2, 2018 at 12:08 pmThank you! I had different stuff to do, but now I will definately check your code 🙂
Reply to this Discussion! Login or Sign Up