AfterEffects Strobe Expression

There’s some awful information out there on how to do strobe effects in AfterEffects. Let’s save some time. Put this as an expression on your opacity property:

if( timeToFrames( time ) & 1 ) { 100 } else { 0 };

Using a simple & operator on the current frame count makes the output alternate between 100 and 0 each frame. Want a strobe every other frame? time/2

Simple. Or in fact even better, let’s just do it with a ternary operator:

timeToFrames( time ) & 1 ? 100 : 0