ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to use markers to control opacity

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Niklas Lange
Expression to use markers to control opacity
on Dec 1, 2019 at 11:02:59 pm

Hello,

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


Return to posts index

Dan Ebberts
Re: Expression to use markers to control opacity
on Dec 1, 2019 at 11:57:09 pm

This 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



Return to posts index

Niklas Lange
Re: Expression to use markers to control opacity
on Dec 2, 2019 at 11:55:17 am

Exactly what I was looking for, thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]