Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to write expression in such case-17 (position + opacity)

Enthusiast ,
Oct 04, 2025 Oct 04, 2025

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.

 

how2.gif

 

TOPICS
Expressions
92
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Oct 04, 2025 Oct 04, 2025

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
...
Translate
Enthusiast , Oct 05, 2025 Oct 05, 2025

Thank you so much. 

Translate
Community Expert ,
Oct 04, 2025 Oct 04, 2025

I think you just need to change the second line to this:

j[0] < 999 ? 0 : 100
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 05, 2025 Oct 05, 2025

Thank you so much. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2025 Oct 04, 2025

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 05, 2025 Oct 05, 2025
LATEST

😮 wow! Thank you so much for teaching me this! I never knew!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines