Copy link to clipboard
Copied
Hello,
Can someone help me with changing the expression below, I tried some things but didn't work:
so the expression below is to do a fade in/out on based on markers on the layer itself. Can someone tell me how to customize to fade in/out on another layer?
fadeFrames = 30; m = 0; t = time;
if (marker.numKeys > 0) {
m = marker.nearestKey(time).index;
tag = marker.key(m).comment;
if (tag == "In") { t = marker.key(m).time - time }
else if (tag == "Out") { t = time - marker.key(m).time }
linear(t, 0, framesToTime(fadeFrames), value, 0)
} else {
value
}
Copy link to clipboard
Copied
to be clear, i want that it is fading in/out based on markers on another layer (for example a null layer)
Copy link to clipboard
Copied
You simply reference the other layer using the common established syntax:
thisComp.layer("XYZ").marker.key(m).comment
and so on.
Mylenium