When you're working in After Effects, there are times when you want an element to blink or flicker without the hassle of setting multiple opacity keyframes. This is where the blink expression comes into play. It's a powerful tool that can save you time and offer flexibility in your animations.
The blink expression in After Effects is used to make an element blink or flicker on and off. It's a more efficient method than manually setting a series of opacity keyframes, especially if you need to make adjustments later on. The expression can be applied to the opacity property of a layer, and it will control when the layer is visible (100% opacity) and when it's invisible (0% opacity).
Browse Graphics, Mockups, Brushes & More!
Search
For instance, one method shared on Reddit involves using a mathematical function to check if the current frame is prime. If it is, the opacity is set to 0, and if it isn't, the opacity is set to 100. This method results in a fairly frequent flickering effect, which might be suitable for glitchy or digital effects.
This toggles between fully visible (100%) and invisible (0%) every second.
jfreq = 2; // Blink frequency (times per second)
if (Math.sin(time * freq * Math.PI * 2) > 0) 100 else 0;
freq
For Visibility
(true/false), you can use:
javascript
Copy code
freq = 2; // Blink frequency
time % (1 / freq) < (1 / freq) / 2;
This creates a toggle effect where the layer alternates between visible and hidden.
For a less abrupt blink, create a flicker effect using a sine wave:
javascript
Copy code
freq = 5; // Frequency of flickering
amp = 50; // Amplitude for intensity
value + Math.sin(time * freq) * amp;
This expression works well for lights or effects that need a more natural pulse.
The beauty of using expressions in After Effects, like the blink expression, is that it gives you a lot of control without cluttering your timeline with keyframes. If you've set everything up correctly, you'll have all the options and avenues you'd ever want to achieve the right look. It's during this phase that you can make the majority of your creative decisions, such as timing, frequency, and even the intensity of the blink.
Blinking text mimics the behavior of flickering neon lights. Apply the blink expression to the opacity of text layers to create a realistic "faulty neon sign" effect.
Example: A store sign flickers inconsistently, giving an old-school vibe.
For warning signals, a rapid blink with red or yellow hues can convey urgency.
Example: A sci-fi spaceship panel has lights that flash at specific intervals to indicate danger.
For a 2D animated character, use a blink expression to alternate between open and closed eyelid states.
Example: A cartoon character blinks every 3 seconds with slight randomness to feel natural:
blinkFreq = 0.3; // Blinks per second
timeOffset = Math.random() * 0.5; // Add randomness
if (Math.sin((time + timeOffset) * blinkFreq * Math.PI * 2) > 0.5) 100 else 0;
Use blinking to emphasize certain words in a lyric video or announcement. The blink effect can highlight a word momentarily, syncing with audio beats.
Example: A karaoke video highlights the current lyric by blinking it.
Combine a blink expression with opacity and distortion effects to mimic a flickering hologram.
Example: A sci-fi interface with flickering text or images as though disrupted by signal interference.