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

how to change layer property based on other layer keyframes time reached?

Community Beginner ,
Jul 23, 2020 Jul 23, 2020

Copy link to clipboard

Copied

So I have 2 layers and i want to automatically change the 1st layer opacity turns from 100 to 0 and vice versa after the time reach every 4 keyframes on 2nd layer scale property.

Im sorry for my bad explanation xD. Please help. Thanks!

TOPICS
Expressions , How to , Scripting

Views

193

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 , Jul 23, 2020 Jul 23, 2020

Like this maybe:

 

n = 0;
s = thisComp.layer("2nd layer").scale;
if (s.numKeys > 0){
n = s.nearestKey(time).index;
if (time < s.key(n).time) n--;
}
Math.floor(n/4)%2 ? 0 : 100

 

Dan

Votes

Translate

Translate
LEGEND ,
Jul 23, 2020 Jul 23, 2020

Copy link to clipboard

Copied

Could be as trivial as something like that:

 

mLay=thisComp.layer("XYZ");
mScale=mLay.transform.scale;
mKeys=mScale.numKeys;

linear(time,mScale.key(mKeys-1).time,mScale.key(mKeys).time,0,100)

 

Mylenium

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
Community Expert ,
Jul 23, 2020 Jul 23, 2020

Copy link to clipboard

Copied

LATEST

Like this maybe:

 

n = 0;
s = thisComp.layer("2nd layer").scale;
if (s.numKeys > 0){
n = s.nearestKey(time).index;
if (time < s.key(n).time) n--;
}
Math.floor(n/4)%2 ? 0 : 100

 

Dan

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