Skip to main content
Known Participant
July 11, 2008
Question

Using clip markers to drive layer opacity

  • July 11, 2008
  • 4 replies
  • 2242 views
Hi folks, I need a little help with an expression. Your input would be most appreciated.

I'd like to have a solid layer in my comp which has 0% opacity most of the time, but has 100% opacity only on those frames where there is a clip marker on a specified footage layer, AND the frames where the footage layer has a clip marker on an adjacent frame.

That last part may be confusing, but the practical upshot is that the layer is transparent until a clip marker comes along, whereupon it goes opaque for the surrounding three frames.

Thanks again!
Ari
This topic has been closed for replies.

4 replies

Known Participant
July 11, 2008
Dan, you're a wizard, as usual!
Dan Ebberts
Community Expert
Community Expert
July 11, 2008
// expression 1

L = thisComp.layer("footage");
if (L.marker.numKeys > 0){
if (Math.abs(L.marker.nearestKey(time).time - time) <= thisComp.frameDuration*1.1){
100
}else{
0
}
}else{
0
}

// expression 2

L = thisComp.layer("footage");
n = 0;
if (L.marker.numKeys > 0){
n = L.marker.nearestKey(time).index;
if (L.marker.key(n).time > time + thisComp.frameDuration*1.1){
n--;
}
}
n

Dan
Known Participant
July 11, 2008
Thanks! Thanks almost it. The only thing is, I'd like it to reference markers on ANOTHER layer, rather than the current layer, how would I do that?

Also, let's say I wanted to use the same markers to increment the value of the Numbers effect each time a marker hit. How would I do that?
Dan Ebberts
Community Expert
Community Expert
July 11, 2008
This should work:

if (marker.numKeys > 0){
if (Math.abs(marker.nearestKey(time).time - time) <= thisComp.frameDuration*1.1){
100
}else{
0
}
}else{
0
}

Dan