Tag: expressions

Color Linking in After Effects

Learn how to link color across your entire project. In this tutorial, I show how you can use a color expression control to drive color for text across a project. This can also be used for shape layers or any other single-color element. Why would you do this instead of just setting all colors individually? This makes it easier to change colors for a few reasons—in my case, while I’m concepting, for later client changes, and versioning a video to different brand/product/style colors.

As you use this technique, I’d recommend defining color controls based on the color use, rather than the color itself. For example, I have “Item”, “Brands”, and “Price Point” instead of just “Blue”, “Gray”, and “Red”. This makes it easier later when colors inevitably change.

Steps in this tutorial:

  • Setup a comp, in my case called “_control”.
  • Create a new adjustment layer and Add an expression control – Effects:Expression Controls:Color Control.
  • Lock Effects panel so it is still visible from other comps.
  • Add a Fill effect to the text layer you want to control – Effects:Generate:Fill.
  • Option-/Alt-click the stopwatch for color.
  • Pickwhip the color control to your expression control.
  • Copy & paste effect or text layer as much as needed.
  • Change the color control as needed and see it reflected across your project.

Global & Local Variables in AE Expressions

I spend a fair amount of time working with expressions, mostly for linking properties to other layers and driving animation from fewer keyframes. (It can save time when I ultimately have to retime animations or reuse them in different ways.) One thing that’s always bothered my about expressions is not being able to share variables between properties. Sure there are workarounds like using expression controls, but in all honesty, I like clean code. It’s easier to set up circleRadius = this.effect("Width").slider; once and use circleRadius in all the expressions in that layer (or comp) instead of always retyping this.effect("Width").slider or pickwhipping each time I want to use it.

By using a local or global variable, it would reduce complexity in the expressions. It would also have the added benefit of being able to change one line of code and affecting everywhere that variable was used. Say, for example, I was referencing transform.position.key(3) in 20 places in my layer. If I wanted to now use key(1), or if I added a keyframe and what was key(3) is now key(4), I’d have to change all 20 of those expressions. With local/global variables, I could change one line and it would be done.

The tricky part is how this could be accomplished. Here’s an example of some recent expression sets I’ve written to drive two Beam effects based on the position of a shape layer.

This is a fairly uncomplicated example, but shows using the same values many times.

As I mentioned earlier, what if I added new keyframes to the beginning of the shaper layer. It would change all the key values and I’d have to dig in and change all the expressions. A workaround would be to create a new null, parent, and animate that1. But who likes workarounds?

What if instead there were an extra layer property called “Expression Variables”? This way, you could set up variables that can be used by any property in the layer using local, or the entire comp with global declarations.

Click for larger image.

In the end, it’s possible to work around all of this, but for anyone working extensively with expressions, it could save a lot of time and frustration.

  1. Or, since I’m really animating the shape transform, I could animate the position of the actual shape layer. []

Free AE Preset: Stop Motion Wiggle Type

Stop Motion Wiggle Type is a preset I developed a while ago for an animation. I’ve decided to share it here for anyone to use.

The usage is fairly simple:

  1. Apply the preset to a type layer.
  2. Adjust the settings as follows:
    • Random Seed: Changes the seed for the random position.
    • Wiggle ƒ: Frequency of the wiggle. Think of this as your stop motion FPS.
    • Wiggle A X: Amplitude of the x wiggle.
    • Wiggle A Y: Amplitude of the y wiggle.

That’s all there is to it. Have fun!

[Update: As pointed out below, the preset will not work in CS4. I’ve now uploaded a CS4 version of the preset as well.]