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

If X happens during certain time period, do Y

Enthusiast ,
Oct 26, 2015 Oct 26, 2015

Copy link to clipboard

Copied

Hi!

I'm trying to create an expression that would have the following logic:

-Check if layer myLayer is positioned over a certain area in the composition when playhead is at frame 50

-If true, permanently set opacity of layer revealedLayer to 100%

Is that kind of logic possible in AE? My trouble is that I can't figure out how to se the opacity change to be permanent. In the code I have the opacity stays at 100 only as long as myLayer is still positioned over the trigger area:

if(thisComp.layer("myLayer").transform.position[0]>910 && thisComp.layer("myLayer").transform.position[0]<940 && thisComp.layer("myLayer").transform.position[1]>460 && thisComp.layer("myLayer").transform.position[1]<490) 100 else 0

TOPICS
Expressions

Views

505

Translate

Translate

Report

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 1 Correct answer

Community Expert , Oct 26, 2015 Oct 26, 2015

yes, you can use valueAtTime:

var myTime = framesToTime(100);

var myPosition = thisComp.layer("myLayer").transform.position.valueAtTime(myTime);

if(myPosition[0]>910 && myPosition[0]<940 && myPosition[1]>460 && myPosition[1]<490) 100 else 0

Votes

Translate

Translate
Community Expert ,
Oct 26, 2015 Oct 26, 2015

Copy link to clipboard

Copied

yes, you can use valueAtTime:

var myTime = framesToTime(100);

var myPosition = thisComp.layer("myLayer").transform.position.valueAtTime(myTime);

if(myPosition[0]>910 && myPosition[0]<940 && myPosition[1]>460 && myPosition[1]<490) 100 else 0

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

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 26, 2015 Oct 26, 2015

Copy link to clipboard

Copied

LATEST

Thank you very much!

Votes

Translate

Translate

Report

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