After Effects Blink Expression - What It Does & How To Use It

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.

December 11, 2024
After Effects Blink Expression - What It Does & How To Use It

Blink Expression For Adobe After Effects

What does the Blink Expression do?

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).

After Effects Blink Expression Freevisuals

Prime Frame Blink Expression

t = framesToTime(time, thisComp.frameDuration) + (thisLayer.index * 12345); function isPrime(value) { for(var i = 2; i < value; i++) { if(value % i === 0) { return 100; } } return 0; } isPrime(t);

How to use the Blink Expression

  1. Locate the Opacity Property: In your After Effects timeline, select the layer you want to apply the blink expression to. Press "T" on your keyboard, and this will bring up the Opacity property for that layer.
  2. Alt + Click: Hold down the "Alt" key (or "Option" key on Mac) and click on the stopwatch icon next to the Opacity property. This action will open up the expression editor.
  3. Enter the Expression: In the expression editor, you can type in or paste the blink expression. There are various ways to write this expression, but the core idea remains the same: to toggle the opacity between 100% and 0% based on specific conditions or timings.
  4. Fine-tune as Needed: Once the expression is applied, you can adjust parameters or conditions to get the desired blink frequency and pattern.

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.

Examples of Blink Expressions

Basic Blink for Opacity:

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;

  • Parameter: freq
    • Adjust this to set how many times per second the blink occurs.

Blinking for Visibility:

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.

Smooth Flickering Effect:

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.

Why is this expression useful?

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.

Common Uses of the Blink Expression

  1. Animating Lights
    • Simulating blinking neon lights or LED indicators for signage or UI designs.
    • Mimicking the on-off behavior of emergency or vehicle lights.
  2. Character Animations
    • Creating natural blinking movements for a character’s eyes in 2D or 3D animations.
    • Adding life to static characters by making their expressions dynamic.
  3. Visual Effects
    • Simulating warning signals, such as alarms or hazards, with a flashing effect.
    • Creating a strobe light effect for party or concert scenes.
  4. Transitions and Text Effects
    • Making text or shapes blink on and off to grab attention or emphasize elements.
    • Adding blinking effects to text in lyric videos, advertisements, or intro sequences.
  5. Digital and Sci-Fi Themes
    • Mimicking the flicker of holograms or glitchy computer screens.
    • Adding blinking effects to futuristic UI designs for immersive storytelling.

Creative Applications Of Blink Expressions

1. Neon Sign Animation

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.

2. Emergency Alarms or Hazard Lights

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.

3. Character Eye Blinking

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;

4. Text Highlighting

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.

5. Holographic Displays

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.

Tips for Advanced Blink Usage

  1. Sync with Audio: Use the Audio Amplitude feature in After Effects to sync the blink frequency with music or sound effects.
  2. Randomization: Add randomness to the frequency or timing for a more organic feel.
  3. Layer Groups: Use expressions to control multiple layers simultaneously, such as an array of blinking lights.