Skip to main content
Participant
May 9, 2022
Question

Expression fade in/out with marker

  • May 9, 2022
  • 2 replies
  • 480 views

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
}

This topic has been closed for replies.

2 replies

Mylenium
Legend
May 9, 2022

You simply reference the other layer using the common established syntax:

 

thisComp.layer("XYZ").marker.key(m).comment

 

and so on.

 

Mylenium

Participant
May 9, 2022

to be clear, i want that it is fading in/out based on markers on another layer (for example a null layer)