Forums › Adobe After Effects Expressions › Expression to use markers to control opacity
Expression to use markers to control opacity
Luca Lange
December 1, 2019 at 11:02 pmHello,
I am not that familiar with AE expressions, so excuse the (probably) basic question.
I have two layers, layer 1 with a mask on it, layer 2 with markers on it.
How can I set the opacity of the mask on layer 1 to 0% (100% otherwise), for all frames for which layer 2 has markers?Thanks,
Luca
Dan Ebberts
December 1, 2019 at 11:57 pmThis should work:
m = thisComp.layer("Layer 2").marker;
v = 100;
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (timeToFrames(m.key(n).time) == timeToFrames(time)){
v = 0;
}
}
v
Dan
Luca Lange
December 2, 2019 at 11:55 amExactly what I was looking for, thanks!
Viewing 1 - 3 of 3 posts
Log in to reply.