Creating a Motion Graphics Template for Color Schemes in Adobe After Effects | Sonja Geracsek | Skillshare

Creating a Motion Graphics Template for Color Schemes in Adobe After Effects

Sonja Geracsek, Motion Designer | Video Editor

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
7 Lessons (33m) View My Notes
    • 1. Introduction

      1:12
    • 2. Setting Up Effects Controls

      8:31
    • 3. Writing Expression

      5:53
    • 4. Variables & Expression Structure

      8:13
    • 5. Colour Schemes

      4:38
    • 6. Master Properties

      3:51
    • 7. Thanks for Watching!

      0:50

About This Class

About This Class

This class will teach you how to set up a multiple colour schemes of your animation within Adobe After Effects. You will be able to can switch between your colour schemes, without needing to duplicate the composition, scene or any elements of the animation.

In this class, I'll go through the process of writing expressions, using controllers, the essential graphics panel and master properties!

This class will enhance your understanding of the programming language within After Effects, how to use variables and statements. 

What You'll Learn

  • Writing Expressions
    • I will talk you through writing a statement
    • You will learn how to structure your expression by using variables
    • You will learn about arrays
  • Using Controllers
    • You will learn what you can do with controller
    • You will find out which limitations they have
  • Colour Properties
    • You will learn about the different colour properties of shapes
    • I will tell you about my experience with RGB codes
    • You will link colour properties to controllers and learn how to use them to manipulate you colours
  • Master Properties
    • You will learn how to change the colours of your scene without affecting the original properties
    • You will create multiple colour variants of your scene, with just one comp

What You'll Do

You will use Adobe After Effects to change the colours of your composition, or of your shape layers for this exercise.

Why You Should Watch

This class is a great introduction into using expressions for animation. You will be able to optimise your future projects, with this efficient set-up.

Having a foundational knowledge in expression, will give you an advantage to get your animation projects to the next level.

There is more to come, so follow me on social media to find out about upcoming classes!

Twitter - Instagram - Facebook - Dribbble - Website

 

RESOURCES

  • Text file with final expression

ATTRIBUTION

 

Transcripts

1. Introduction: Hi, My name is Sonya. I'm Emotion graphics designer. I animate entertaining educational videos, client ads on a whole range of engaging online short form video content. If you spend any time on YouTube, you might have seen some of my work in my class. I'll be teaching you how to set up your animation in adobe aftereffects with color on slider controls to create multiple color schemes off your scene. I will include practical skills like writing expressions as well the share knowledge about work flow techniques. This class is perfect for animators who are already comfortable with after effects and are looking to advance their skills in writing expressions. No previous knowledge of expressions is needed. You will be using your own assets for this class. Also, by the end of this class, you will have foundational knowledge and fighting expressions from understanding a statement to sitting up variables to linking effects controls. You will be able to switch between multiple color schemes off you animation. With just one controller and one animation. You can take this knowledge into your next project. Ready? Let's get started 2. Setting Up Effects Controls: Hi, guys. So, sure you what the final product looks like before I'll jump in and explain how to get the So this is my preset animation. It's made up off one composition. So one cup. Andi, if I change these two different numbers which will set up later, you can see that the color changes. But nothing changes inside of this comes So this is the original color of set up a bunch of controls here. These are actually just reference colors. This is the code right here that I've set up to say. If I type in a certain number in my controller here, it will change to this set up so I can go two different number and then will be this color combo. And everything changes outside of the original comp. So you can have literally one animation set up all of your color combos the way you want them to be, and then you can switch around without affecting your original animation. Okay, let's jump into it. I already have a composition set up over here, but if you don't just for the sake of this exercise, you can just create a shape layer. You can come up here to the rex angle tool on, just click it and either drag a shape. It will create a shape like this, or you can double click, and then it will make it the size of the composition. Here, a Z can see I've named my layers, so they're not all shape layer 1 to 100. I can hit, enter on and change that to whatever name you would like it to be. You can also change the group color. If you don't have this open like I do, we can open labels of here and you make can make them different colors. Different colors can then also be selected by the label group. That's quite handy for other types of animations. You can check my other classes. I describe it well, the but we don't need this right now, so I just turn that off So we have a little bit more real estate here. One important thing is make sure you don't have any layers highlighted when you create a shape without the rectangle to, because then you'll be either. If it's already shape, you'll be creating another shape on top of it. If it's an imported illustrator layer. You'll be creating a mask on top of it, so make sure no layers are highlighted before you're creating your shape layer. Just either bring in your shape players or create a shape. Next thing you want to do you want to create a null object, which will be using as a controller for our color control. So hit control or command shift old. Why my start off my comp at one hour? I also go into more detail on my other classes. If interested, you can check that out on D. I cut my layers at the beginning off my scene on Die. Also name my layers immediately, so there's a nice clean workflow I will name. This control color will actually bring back the labels. Controllers acts as as a master control for whatever you parenting to it. You're either using them to control something. In this case, we're going t add effects on them, and we're going to use them to control the colors off our shapes. Other times you may want to pair in something to this controller. Now you want to open the effects on presets window. If you don't already have that open. You can hit control five and open that. I've already got it docked here that I'm going to search for color control. When you have the control layer highlighted, you can just double click this control and will immediately added to that layer. You can also drag and drop. I'm going to lock this. I'm gonna toggle the view. Look, that way it doesn't disappear when I click on other layers will always see this one. Whereas if I don't have the struggled and I click on other letters then it will show me the effects controls of the other layers which we don't. We don't have anything on those effects control, so we'll just lock this. So just to demonstrate, you can also drag this over here and then you have it like that. So that also works. Now, if I go to my background layer, you can just go to whichever shape layer you have highlighted and then go to this such window and type in color and it will show you all the color options that this layer has. This layer has a stroke option, Onda a fill option. I want to actually link this fill color to the color control. I'll hit old and click and then with this little pick whip over here, I'm gonna drag it over to this color. So the reason why we locked this is also so that we can just drag it over here. The other option is to hit he wants. Then you can toggle down and then you can do the same thing to reveal an expression which is what we just created with the linking. That's an expression. By hitting each wise, he can reveal that Andi it's the same over here you can just drag it over and it will also appear like that. Now what this does is it links Whatever color is appears in our color control will appear in the Phil color off that shape. So the fine now change this to something else that's a blue. This will then also be blue. So we can't see. So this is my background color right now, So whatever this does, this will repeat. So this is the first step to creating our color scheme. So although this works best with shape players, you can also use this technique. If you're animating with imported illustrator layers, you can add a fill effect, so that's this guy to your layers. Or you can create shapes from your vector layers to achieve that same outcome. If you're working on a big animation, be careful with the amount of shape players you have. It really slows down your workflow and render preview if you have too many. So you need to consider that when applying this technique. Ah, lot of shape players means heavy project. So now we're going to add a slider Control to this. I can just type in control. As you can see, there are multiple different controls and I'm gonna choose the slider control and added to our control layer on what we want to do with this slider control. This is going to be the controller that will control the color scheme. So I will show you how to link your color control to your slider controls so that when you say when I type in one, I want this to be blue. When I type in two, I want this to be read and so on. So we'll get into that in the next chapter. So unfortunately, linking at the same ways we just linked the color to the colored for control does not work . So if I did this, it doesn't nothing. It just turns to white. Andi, you conduce whatever you want. It's not gonna change the color, mainly because you haven't even told the expression what color to change too. But it just needs a few more steps for this to work, so I'll take you through them. 3. Writing Expression: this is the expression will be writing today. I won't include a text file so you can save and go back at any time. I'll go through this with you, step by step, so let's begin. You want to have your color of your color control toggled open all you want to have it over here. Click while holding Ault. This will open the expressions panel. First, I'll add a statement, a statement also known as an assignment operations. The part of you expression, it tells the property. It's on what it should do. I want my statements to say that the color should be black on the RGB, a value off black is 001 the A in our to be a stands for Alfa, which is why there is a one. But we don't need to worry about that part anymore than I've mentioned now. So we can forget about that for now. On. Did you can use any are to be a value that you would like to use in your animation. The colors are here, so this would be the RGB. As I said, the A is irrelevant. So you would just use these numbers and add them to your array. Now an array is written in square brackets. Anything written inside of swear brackets is called an array for our final outcome. We want multiple colors for our color scheme, so I'll add of humor colors on. We'll see what happens. I want to add a comma, another square brackets and some other colors. Like I said, you can use whichever colors he would like for this. I'm just gonna go with some basic colors of a here. Make sure you don't have any additional brackets in your expression. As as you can see here after expects is trying to help you and create the double brackets. But we only want to Brackets per array on now is you can see the color changed, its now reading the last color in my statement, which is red. It's kind of works, but I would like to tell my expression which one of these color arrays to read not just pick whatever is the last. In order to tell the colored control which color to read, all of them need to become array elements as part of a larger array, so we'll add brackets all around our colors. Every number you have written in your arrays of an array elements of this 00 this year in this one is part of this array. And this a ray is an array element off this entire statement. So now we'll add an operator again, Make sure that after fix doesn't add any additional brackets. And this time we don't want a comma here. Hit. Enter on your numb key. Bad not on your normal Keep out If you and hit enter there, you'll just make a paragraph. So if you haven't extended keyboard hit, Enter there Just klick outside off your expression area. Andi Now I'm telling this expression to read the first array element. And every array element has an index number within the array and it starts with zero. So the first array element this one in my case is zero. The 2nd 1 is one in this 3rd 1 is two and so on. So if I write two over here, then it will be my second color and my third color. Sorry, my second color is one. And then it will be this one. So now we want this operator. This index number to be controlled by our slider so that we can switch these colors without going into the expression weaken. Just use that slider over here, but it's not enough to just link them like we linked the color and the color control. So I can't just go over here. Andi, pick with that. That's That's not gonna work. It's not enough information for the expression. In order for the statement to work, we need to convert the index number using a function called past interview. So that works like this. You can go ahead on and link this because we will need this link either way. But you can also just start from scratch. We'll get rid of that for now, and we want to rights pass into your This is the thing that we want. And then inside of these brackets, we want the link I just showed you. So you'll just use the Pickwick, drag it over to the slider hit, enter or click outside on. I don't have five colors, so it's telling me something's wrong here, so I need to put it down to whatever colors working whatever color exists. In my expression, I can use this. But the problem with using the actual slider is it does decimals, and that doesn't work in our expression. So we're using the slider and just typing in the numbers on now. This works and nicely. It's flipping between my three array elements, my three colors. Now in the next part, we're going to clean this up a little bit because it's a little bit messy. You don't know which ones these colors are. You kind of have to memorize what the RGB codes are. That's not really useful if you're writing a long piece of code, so let's clean this up. 4. Variables & Expression Structure: If you have been using other RGB values than me, you may have encountered a hitch. At this point, your colors are not being output correctly. I'll show you what I mean by this. If I make this any other cover on and calling the first color, our expression needs our RGB values to be output in decimals between zero and one. This means we need to divide our entire statement by 255 as our RGB values range from zero to 255. Our expression should now be working the way you wanted to, but it looks a little bit messy and for the sake of learning a clean workflow, especially for when you want to write more complex code in the future, let's clean this expression up. Also reset. This will add some variables to define my RGB color values. I have black whites on and read on, and I will take my color arrays. I'll cut them out of your You can also just copy and paste replace it with my variable. Andi, I'll add the color array here. I'm just pasting it in, and I'll do the same for the other values. Always close your variable statement with a semi colon. Now what a variable does it kind of replaces any type of statement? You could have a complex statement in here and you just name in that entire thing with just one word. You can actually use any letters. Numbers underscores and dollar signs in this variable, and you can then place it in other variable so you can kind of stack variables on top of each other to create your statement. Now I want to do the same for the slider control. So I will create a variable for the slider control cooling it color slider, and I will remove this and replace it with the variable at this. Think of the here. Close it with a semi colon. Everything works. Now what I've done here. I've used the Camel case naming convention camel cases often used in coding. When a string of words is written without spaces, this is to either have it more compact than using an underscore. I couldn't have used space spaces indicate there is a new piece of code and you piece of information, so it no longer acts as the same element. So you either need to use an underscore or camel case or dollar sign or whatever would you would like to use. So I've decided to go with the Camel case. That means the first letter off the word is low case and then every subsequent word has a capital. First letter kind of visually separates the words from each other, even though they're written together now, Additional thing I would like to do. I would like to clean up our colors here, so I'm gonna put them in yet another variable which will act as an array, right colors, open heart brackets, and then I'll give it some space ended with a semi colon. Now I'm going to add our color variables in here. I can also use tab to in Dent what is inside off another one statement and inside of that statement, we have other statements. So I'm going to indent this ad. The variables separate them with a comma can add is when he colors. Is he, like, in here as many as you have. And now I'm going to replace this array with our color variables. All that is in here is already in here, so all I need to do is use this variable now. One thing that you need to be aware with writing your expressions. It's sequential. So if I waas to use this very bowl with my colors inside before I had defined what these variables mean, it wouldn't work. So first I need to tell the code. What does black mean? Black means. This ought to be a value, and then I can use it in another variable or in another statement, and that will then work. You can add comments to your code as well, by adding a double forward slash before any text in your expression. Onda. I would like to give it the index number, but of course the index number for the first position. Zero. This is one, and this is to and actually I will use a tab here instead of a space. That way they are nicely aligned again. And so if you have 20 colors here, when you're creating your color scheme and you want to match certain backgrounds with certain shape colors, you then no long have to count down. OK, so this one is index zero. The other one is index so and so and how do I want to match them? You can now just add the's comments, and you can refer to that index numbers here. So that's quite handy for quick looking and comparing if you have multiple shapes with multiple different colors set up like this, which we will get into as well. Now, just to explain, I do have I've been using a color control to create these colors, and I've been calling RGB a values instead of just pick whipping to this color control right so it wouldn't work to directly link color values to another color control. The expression just basically can't read that. So writing the values the way I've done it in this expression, Andi identifying each color value with a variable is the best way I have found this expression toe work. You can create further color controls as reference as I've shown you earlier so I could have another color control here, and I could say I want us to be pink forward of a reason I could come here and I can see the RGB values on. I can add them to my code, but I wouldn't be able to just simply pick whip to this color it. As you can see, it doesn't make it pink. It's not not effective. Yeah, this is the way I found it. To work with adding the A D B A values rather than pick whipping to another color control. You can also add more color controls to your now objects, but they will only work is visual reference. They can't be used within the expression. As I mentioned before. You can also use the eyedropper tool to find out the RGB value off and image in editing app like illustrator and photo shop. All right, let's move on to creating our color schemes. 5. Colour Schemes: I'll now show you how you can create complimenting color schemes with different objects you have in your animation. I'll duplicate the color control we've set up before, and I'll rename it one to shape color and want to be G that stands for background color. So this one's already set up with our background or with my background over here, since we have duplicated it and I have the same code in both of these colors. Don't expand this. I want to have no layers highlighted and type in color over here. This is now going to show me all of the color options of all the shapes I have in my animation, and now I'm going to link that to my shape color controller. I'll go ahead. Andi linked both the stroke. End the film regardless off if it has a stroke or feel that way. I know that is definitely coloring the right thing in. I'm going to lock the taco viewer as well. And now I will old clicks and drag the pick whipped over to the shape color controller. I can then right click copy expression. Only then, with control or command V, I will pace this into place. You cannot, however, highlight multiple and pasted. It will then create a new fills in new strokes. Let's not do that. If I was to highlight just a stroke, that would work. So if I just highlight the Phil of all of these, I can pace it once to all of my shape players, and I'll do the same for the stroke. Now, if I hit E twice, I can see that the code has been applied to all of my shape players. Now what I want to do is I want to rearrange the colors between the shape, color control and the background color control. So obviously a concierge anything, because both my background and my shapes are the same color. So now this is where the index numbers come in handy. So when the background is black, let's say I want my shapes to be white, so index number zero needs to match a different color. So just in this white Andi, when my background is white, I want this to be black on when my background is a red. I want this to be black. Also, you can continue this on. You can use more colors. You can use the same colors and different combinations. You can just continue creating more index numbers here within your colors. Variable. So as you can see now, my shapes and my background, I have a different color, and I can now change this. The background and the shapes re color themselves, depending on what I set within my color scheme. If I said this to to, then I have the the red combo. And as I mentioned before, you can't go any higher than the amount of index numbers. Oh, are the amount off, uh, color variables that you have set ups? If I go to three now, it goes to an era as I don't have more than three, so I have. My 1st 1 is zero. My 2nd 1 is one my third ones, too, which means the index number three doesn't exist. Toads throwing up. It's an era, and now we'll show you how you can set this up so that you can have this type of a set up so that you can change these colors that you've set up inside of your composition outside so you'll be able to change them without impacting your original animation. Let's go ahead and do that 6. Master Properties: Now for this last part, I'll show you how you can use a single comp multiple times with different color schemes without creating new comes or changing anything inside of your original composition. Come for short, We will ness overcome containing our animation inside what I call a main comp. So my comp is this color control. I can drag it over to create a new composition, and I'll call this main. Maybe I want to call it acclamation Main Oh, color control main whatever you like. So this is now my make composition. A Z can see it comes with the Marcus I have set inside of it. Just zoom in here using altered and the scroll wheel of my mouse, and now you want to have your essential graphics panel open. If you don't have this open already, you can go to window a central graphics and then dockets somewhere that works for you. Now, in the name, we have a color scheme. You can call this anything you like, and then you want to choose the composition that you've created. Your color control in mind is called color control. So that's the one I'll be choosing then we'll go back into a composition. We'll make sure that our controls are shown here. Give do that by toddling this little arrow, and you want to drag the slider control into the essential graphics window. Now we can rename that color scheme. Now we'll go back into the main. You could just toggle down the little arrow and then total down this guy Andi to singularly show this color steam just hit s twice and then we'll hide everything else that isn't here . And now if you change the index number on this master property So first I need to go to the first friend that is visible for me. So let's say around here. So now I can see my animation. And if I change the index number here, my color changes without anything changing inside. So now I couldn't can create multiple animations. And now you can change you animation without your original composition being affected. Of course, you need to be careful that if you creating a transition like this that the background colors or the shape some match up some of my color schemes don't work together of it. Apart from that, it's exactly what we've tried to achieve, and this is how you can create multiple color schemes with just one animation and one slider control. You can even create more complex color schemes by adding more color controls or more colors , more shapes on creating an interesting dynamic with just one flick of a switch, so to speak. 7. Thanks for Watching!: That's the end of our class. Today you learned how to write an expression, used the essential graphics panel on how to set up master properties to create multiple color schemes of your animation with a single composition. Congrats well done on completing this class. I'm glad to have taught you something new. Getting the knack of programming can be tricky. Feel free to send me your questions and comments, and I'll do my best to help. I'd also appreciate if you could leave a review on this class. It helps me tweak my future content so you get the most out of it and it helps others to see the class. I'm looking forward to seeing your projects using the techniques you lead in this class. Follow me on social media for updates about upcoming classes. Thank you for taking this class