Copy link to clipboard
Copied
Hi,
I want to control the opacity of a layer by the position of another layer. I dnt know why my expression is not working. Please correct me where I am making mistakes. Thank you.
I want the eye corner to be visible only when the eyes moved to teh last positinon (here 990,403), before this it's opacity will be zero,
Thank you.
Assuming that the Face layer is an ellipse with the anchor point in the center of the ellipse, it is below the Shadow layer, and the Anchor Point of the Shadow layer is at the center of the shadow on the right, this expression should give you the results you want.
Adjusting the offset with a Slider controls the timing of the fade-in for the shadow layer.
ofst = effect("Slider Control")("Slider"); // adjust value to time fade in
sp = position[0];
face = thisComp.layer(index + 1);
fSiz = face.con
...
Thank you so much.
Copy link to clipboard
Copied
I think you just need to change the second line to this:
j[0] < 999 ? 0 : 100
Copy link to clipboard
Copied
Thank you so much.
Copy link to clipboard
Copied
Assuming that the Face layer is an ellipse with the anchor point in the center of the ellipse, it is below the Shadow layer, and the Anchor Point of the Shadow layer is at the center of the shadow on the right, this expression should give you the results you want.
Adjusting the offset with a Slider controls the timing of the fade-in for the shadow layer.
ofst = effect("Slider Control")("Slider"); // adjust value to time fade in
sp = position[0];
face = thisComp.layer(index + 1);
fSiz = face.content("Ellipse 1").content("Ellipse Path 1").size[0]/2;
fPos = face.position[0] + fSiz;
ofst + fPos - sp;
The expression compares the position of the Face layer + the radius of the face with the position of the Shadow layer plus an offset value so the shadow appears with a quick fade in as the face moves into position. Adjusting the offset value will control the timing. It's more complicated than Dan's solution, but it gives you a quick fade-in for the shadow layer.
Copy link to clipboard
Copied
😮 wow! Thank you so much for teaching me this! I never knew!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now