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!
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
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
Copy link to clipboard
Copied
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