Hi,
i know this post ist almost a year old but this expression is the closes to what I need and I’m not a smart person if it comes to expression.
I intend to do the exact same thing, only that I have 3 Markers on my Layer “(014_DM_GT_IN_OR_2LINES)”. I named my first one “Start” my second “In” and my third “Out”. My goal is to fade on the opacity at “Start” and fade off at “Out”.
I copied the given expression on a second Layer “(BG Multiply)” and substituted “…(tag== “In”)…” with “…(tag== “Start”).
It looks good on the first few frames but it suddenly turns off right between my “Start” marker and my “In” Marker. The “In” marker should be completely irrelevant for this expression.
Could someone help me ?
L = thisComp.layer("014_DM_GT_IN_OR_2LINES");
fadeFrames = 1; m = 0; t = time;
if(L.marker.numKeys > 0) {
m = L.marker.nearestKey(time).index;
tag = L.marker.key(m).comment;
if (tag== "Start") { t = L.marker.key(m).time - time}
else if(tag=="OUT") {t = time-marker.key(m).time}
linear(t, 0, framesToTime (fadeFrames), value, 0)
}
else {value}