And... here we are! Ready to start our own first animated project in Adobe After Effects! Yes! It has been an exciting journey, and we've learned loads of new words, concepts, and tools. Looking back, it seems like ages ago when we started talking about Lottie, don't you think? Not because of the matter of time, but because we've learned so many new things! In the first part of the book, we learned what Lottie and LottieFiles are, we went through the history and principles of 2D classic animation, and got our hands on the Adobe After Effects working area and main animating features. Now, we are all ready and set to animate our icon.
In this chapter, we are going to go step by step through creating our animated icon. Get ready, as we are going to put everything we've learned so far on the table, all the knowledge we've gained about Lottie, classic animation, and Adobe After Effects. We will learn how to import our assets from different vector-based tools, we will create and adjust our composition, create keyframes, and change layer properties to give the illusion of animation. We will also learn how to animate a path, adjust the timing, and apply ease, based on classic animation concepts, to give our icon a more trustable movement. So, by the end of this chapter, we will have our first animated icon ready to be exported for LottieFiles.
In this chapter, we are going to cover the following topics:
Remember that this chapter is a hands-on project, and in order to be able to complete it successfully, it is important you have the following tools up and running:
Cool, let me recap a bit here. Sometimes you may think, why go through all this effort to create an animation if we could just have a text or an illustration instead? Well, as we mentioned earlier, animations can be so helpful in terms of UX. They help us to talk to our users; we've learned how animation can communicate so many things, such as actions or emotions.
If we go back to our brief, remember we've decided to create a check icon that will show the user the purchase has been successfully made and the money is safe and well spent.
So, in UX terms, what sort of emotions do we want our users to feel? I guess something like the following:
When animating, we are not just talking about some cool motion graphics that will show up in our app to make it look better; instead, we are talking about making our users' lives easier and happier. We are talking about making people feel better! Can you see the power we've got in our hands? So, let's not waste any more time. Let's make our users feel great!
Let's start by importing our assets to AE. To do that, we assume you already have your icon design ready in any of these three vector-based tools: Sketch, Figma, or Adobe XD.
Important
If you don't have any vector-based tool chosen yet, I would recommend using Adobe XD, which will save you time and effort. The exporting option for XD is already included in XD and there is no need to add any extra extensions or plugins. However, if you already use Sketch or Figma, no worries, we will cover that too. Also, you can find more information about how to install the plugins in Chapter 6, Don't Stop! Exploring Plugins and Resources That Will Keep You Going, of this book.
In order to avoid some animation issues, I always recommend keeping the illustrations as tidy and as simple as possible. For example, some Boolean operations, text layers, or symbols can generate problems when exporting to AE.
That said, let's open our icon in Sketch. Go to the top bar menu and select File | Open Local Document:
Go to the Files folder provided with this book and open lottie/chapter04/ sketch/lottie_sketch.
Now is the time to install the AEUX plugin for both Sketch and AE. You'll find more information on how to install AEUX for Sketch and AE in Chapter 6, Don't Stop! Exploring Plugins and Resources That Will Keep You Going.
Important
If you installed the plugin without following our instructions, please check the How to set up AEUX in AE section in Chapter 6, Don't Stop! Exploring Plugins and Resources That Will Keep You Going, as some options have to be selected.
Once we have our AEUX plugin installed in Sketch, let's open it up and check the panel. To do that, go to the top bar menu and select Plugins | AEUX | Open panel:
As we can see in Figure 4.3, this is a very simple panel with just three different options:
So, as we can see here, our icon is composed of just two single layers: check for the blue check sign and Oval for the white circle. The layers are basic simple shapes that won't give us any trouble when exporting. Perfect!
Now that we've got our icon ready and tidy, let's export it to AE:
Great! We've got our icon perfectly imported into AE and ready to be animated. Just save it! Now, let's see how to do the same using the Figma tool.
To export your illustrations from Figma to AE, the process is quite similar. You can go to Chapter 6, Don't Stop! Exploring Plugins and Resources That Will Keep You Going, where you'll find a guide on how to install the plugin for Figma and also AE. Remember, if you have installed the plugin on your own, please check the How to set up AEUX in AE section to be sure the selected options are the same as you have.
Now that you have your plugins up and running, let's open the icon in Figma. How to do that? Follow these instructions:
Cool! Now, we've got lottie_Figma.fig imported.
As we can see in Figure 4.10, this is a very simple panel with just three different options:
As we mentioned earlier, it is very important to keep our illustration as simple as possible, as some effects can generate issues. You'll notice our illustration is very simple; it is made of just two layers named check and Oval, and that's all we need.
Now that our icon is done and tidy, let's export it to AE:
Cool! We've got our icon ready to go in AE; now, remember to save it! Let's see how to do the same with XD.
Exporting your icon from XD to AE is probably the easiest way that exists right now. There is no need to install any plugin as Adobe XD already includes an exporting option for AE. Let's have a look. Let's open the XD file provided with this book.
Let's open our icon in Adobe XD. To do this, just follow the next steps:
Now, you'll see how easy it is to export our icon to AE:
And, voilà! AE will open automatically, and our icon will be ready to be animated. Easy, right?
Save the project and let's start animating!
Before we start messing around with AE, I want to share with you the workflow I normally use when animating.
You'll see we've been through half of the process already; now, we just need to bring it to life. And please, take this workflow as a suggestion and feel free to change it in any way to meet your own requirements. Here is my workflow:
We have already covered all of these:
We will cover the following in Chapter 5, Share It With the World: Working With LottieFiles:
I know, this process might look a bit long, but this is just an example that covers the whole process of a complex project. Sometimes, there won't be any need to run user interviews, or at some point, you won't need to draw a storyboard or wireframes as these will be in your head.
Let's go back and see where we were, let's see where we left our storyboard. Let's recap; what was our icon doing?
At this point, we have given you all the elements, resources, and tools necessary to have everything ready to start animating. We've been through a few main UX concepts, learned how to import our files to AE, checked one of many animation workflows, and gone through the storyboard again to refresh our minds.
So, now that we've got a pretty clear idea in our heads and on paper about how the animation is going to look, what needs to be done, and the steps to follow, let's start animating! Let's create our compositions.
Remember back in Chapter 3, Learning the Tools: Getting Familiar With After Effects, we talked about compositions, what they are, and what we use them for? Cool. Now is the time to start putting everything we've learned into context.
When we import our icon to AE, it normally gets imported as a composition. Remember, compositions are shown in the Project panel, and to open one, we just need to double-click on it.
Now, how is this composition imported to AE? Are the main specifications of this composition the ones we want? Let's check it out. Let's check our Composition Settings icon:
Let's adjust some of these settings. Remember how to do that? Here are the instructions:
That was easy, right? Now that we've got our composition ready, let's move to the Layers panel.
We've got our icon composition sorted and adjusted to our needs; now is the time to understand how our icon is built in terms of layers, so, let's check what we've got in our layers panel.
As you can see in Figure 4.18, when we check the Layer panel, we find the same two layers we had in our illustration file that we just imported, check and Oval.
Just to be clear, check is a stroke and Oval is a shape. This is important and will help us to give the effect that we want to the check layer. But, don't worry for now; we will see that a few steps further in this section.
Also, as you can see in the preceding screenshot, each of our layers has a lot of sub-layers. We are going to be seeing this in the next steps.
But first, let's recap. Remember, our animation will start with the oval getting bigger.
Suggestion
Since we are going to be focusing on the Oval for now, I recommend blocking and hiding the check layer as it is not relevant at this stage. Of course, we've just got two layers and there's probably no need to start hiding or blocking other layers, but when we start working with some more complicated projects, this is good to have as a habit.
Click the little eye and lock icons from the Layer panel to hide and block any layer you want, as shown in the following screenshot:
Great! Now that we are more familiar with our layers, and the Oval is on its own, and there's no danger that we are going to move the check icon, even by mistake, let's start creating some movement.
Remember back in Chapter 3, Learning the Tools: Getting Familiar With After Effects, when we talked about keyframes? Exactly! Keyframes are used to create movement and to do that, we need at least two of them: one keyframe as a starting point and one as an ending point.
That said, we want our Oval to grow from 0 to 100%, right? Any idea about how to do that? Sure, we will create two keyframes and change the scale of the Oval, so one keyframe will be 0% and the other 100%. Let's do that now.
We are going to start by animating the scale. How do we do that? By adjusting the scale's Oval properties, at specific keyframes. Here's how to do it:
Now, let's move the time slider left and right; can you notice anything different? Of course not. We've just created the keyframes but haven't changed the Scale property yet. Let's do that as follows:
Now, going back to our storyboard, we've defined the Oval as scaling up to 110-120% and then going back to 100%. But, why are we doing that? Remember when we talked about 2D animation principles? For this little icon animation, we will be applying the Exaggeration and Stretch and Squash principles to our Oval, to give an idea of flexibility, mass, weight, and speed. So, simply exaggerating the size of it will give this impression.
How to do that? Easy. Follow these steps:
Press the spacebar to play our animation again. What do you think? With just this little tweak, our animation looks more real now; of course, the timing is still not good and is missing some Ease, but we are getting there.
Let's stick to the Oval. Let's adjust the timing. To do that, we just need to drag our keyframes. I encourage you to play around and move them around the timeline to see how Oval behaves. I'll set my Oval keyframes between frame 0, frame 18, and frame 21:
Let's move the time slider to 0 and play it again a few times. What do you think? It looks better now, right? What about scaling up and down, maybe we could adjust the size a little bit? Let's adjust the second keyframe to make it subtle, the one that scales up to 120%, and take it down to 110%. Play again, and... it now looks smoother. Right! Let's keep moving! Let's tweak the Opacity property to make our illustration even smoother.
Now that we've got the Scale property as we want it, let's adjust the opacity. To do that, we are going to follow the same steps as we did in the previous section. Of course, we could have done both at the same time, but I preferred to show you step by step; there will be plenty of time to do things quicker, but we want to have the basics clear, right?
Important
From now on, I'm going to start introducing some shortcuts that will save you tons of time and will help you be more productive. The shortcuts I'm using here are for macOS. Most of them are the same for macOS and Windows; however, if you are using a Windows system and you are not sure which shortcut to use, check Chapter 6, Don't Stop! Exploring Plugins and Resources That Will Keep You Going, for a list of the most common and useful shortcuts for macOS and Windows.
That said, let's change the opacity:
Nice! That's the first keyframe created with a value of 40% opacity. Let's create a second keyframe:
Looks good to me, at least for now. Once we add some ease to the animation, it will look much more realistic and flexible. But, let's go first to animate check.
So, check behaves differently; it doesn't scale up or down or fade in, and is not rotating or moving either. What we've decided check will do is draw itself. How do we do that? Well, I'm going to show you how to use Trim Paths.
To show and hide a path or reveal a part of it, we could be working with masks; however, Lottie doesn't work very well with them, at least not yet. Using masks can get us in trouble so we are going to try to avoid them and try something else.
Another option could be to draw our check animation frame by frame, so the following keyframe always shows a little bit more of the drawing than the first one, but this would be very time-consuming!
This is where Trim Paths comes into the picture. Using this option can be very helpful and time-saving. Let's see what this can do for us:
Now, let's check our Layer panel; what happened there? As you can see, a layer called Trim Paths 1 has appeared. Let's open it up by clicking on the little arrow. A few different options come up; what are these?
These new options will let us decide whether the check path starts drawing itself from the beginning of the path or the end. Instead of a drawing effect, it is more of an erasing effect.
Let's mess around a bit with these options:
What's happening here? It looks like check is doing what we wanted but the other way around. Instead of drawing itself, it is erasing itself. Right, this feature can be a bit confusing sometimes, but don't get frustrated! It took me a while to understand the logic behind it, and even now, sometimes I have to try it a few times to get it right. So, I encourage you to play around with the Start and End values to get used to the effect and its behavior.
Now let's swap the values and try to get it right:
Great! Now, the check icon is doing it right. It starts from nothing to drawing itself, as if someone was writing it, right? We've got it! However, the animation is not placed in the right place.
Notice that the check animation is starting before the Oval is 100% on screen. If we take a look at our timeline (see Figure 4.30), we can see that both layers have the keyframes within the same time. Both are starting at frame 0, which is why the check icon is playing at the same time as the Oval.
Remember that when we defined our storyboard, we decided check was going to be drawn after the Oval was shown on screen. So, to do that, we need to adjust a couple of things:
Let's check our keyframes on the Layer panel. We can see both animations are starting at frame 0. Instead, based on our storyboard, the check animation should start once the Oval is fully 100% on screen. That means, we need to move the check keyframes to the end of the Oval animation. We can do that by selecting both the check keyframes and just dragging them to the right. You'll know both keyframes are selected as they both will be blue:
Cool! Looks perfect to me now! However, it looks a bit slow, don't you think?
Perfect, we've got it! We are getting there. Now, we are going to add the sparks.
To add some fun to our animation, we are going to add little sparks coming out of Oval. To do that, we could animate each individual sparkle on its own, drawing little circles, and changing the Position, Scale, and Opacity values for each of them. However, we are going to try something different here. I'm going to teach you how to create a radial burst, a really cool effect that is going to save us a lot of time.
So, let's do it! Let's start by creating a new composition by pressing + N and naming it Sparks. We don't need to change any more settings.
Follow these steps:
For this effect, we are not going to use the Transform options we've been using up till now; instead, if we want the radial burst effect to work, we are going to be working with the Transform options we can find inside the Contents option:
As you can see in Figure 4.36, we find almost the same options as we found earlier in the Transform tools:
Now, let's change the Scale property so it will scale out at the end:
While we are at it, let's make our circle fade out, so let's change Opacity:
Good! Can you feel it? We are animating with no effort at all! Now, your timeline should look something like the one shown in the following screenshot:
Let's open it up and see what's in there. As you can see in the following screenshot, we find new properties and values. As always, I encourage you to play around with the values here:
Let's continue. For our animation, I suggest you do the following:
And then, press play!
Isn't that cool? In just no time, we've created our version of sparks by just animating one circle. Imagine what we could do if we start adding some more elements!
Now, let's go back to our main composition:
Let's finish our animation:
Now, let's play the animation! What do you think? I'm going to adjust Scale of Sparks a little bit; I'm going to change the value to 110%. Let's do that and play it again. Nice! We are nearly done!
Good job! We've come a long way! In this last section, we've learned about and practiced so many new things. We got hands-on with our first animated icon. We now know how to create keyframes and change the property values to create the illusion of motion and animation. We know that by changing the layer's scale, rotation, position, and transparency, we can achieve great effects.
We also learned two cool techniques that will save us a lot of effort when animating: Trim Paths and radial burst. We also applied some of the principles we learned in the first part of this book.
But, before we move to exporting and handing off our animations, I want to show you the Ease effect I've been talking about in the last two chapters. So, let's move forward; let's discover Ease!
Now that we've got our animation up and running, let's nail it by adding some Ease. Remember the anticipation principle we talked about back in Creating the illusion: Get Rolling with the Basic Principles of 2D Classic Animation? That's what we can achieve with Ease: the perception of acceleration and slowing down with just one click. And, this little tweak is going to make our animation look much nicer, smoother, and professional. Here's how to do it:
Now, let's do the same with the last keyframe, the one placed at frame :1.
Let's check the Ease panel. Click on the little icon from the timeline. From the graph, we can predict the velocity of the animation; it will accelerate exponentially at the beginning and slow down at the end.
Now, let's play our animation. What do you think? Can you tell the difference? I bet you can! Now, the animation looks smoother. But, before we move to do the same to the check layer, I suggest you play around with values and options. You know, learn by doing!
Great! We've got our Oval looking quite cool, so now let's do the same with check:
It's getting there! Now, to finalize it, I'm going to do that in the spark composition as well:
Our animation is done!
As you've just experienced, Ease is a really powerful tool that will make your animations look stunning in no time. Of course, there is a lot more to learn about it; we've just gone through a couple of aspects of it so that you have the basic skills to learn further on your own.
As we mentioned at the beginning of this book, we are not aiming to be an AE tutorial book; instead, we want to give you enough knowledge, background, and resources for you to start creating animations on your own, from concept to hand-off. So, I encourage you to explore and read more about Ease.
If you don't know where to start, you know we've got you sorted, so just keep reading as, in Chapter 6, Don't Stop! Exploring Plugins and Resources That Will Keep You Going, you'll find more resources about Ease and much more!
It wasn't that hard, was it? We've finished our first professional-looking animation in no time! Our customers won't feel confused after the purchase and our app will look much better. Win-win-win!
In this chapter, we've been through a real project and learned the UX animation AE workflow. We have now covered the whole process, from ideation to final animation. We know how to read and understand storyboards, we've learned how to import our assets to AE, set up a composition, create keyframes, and modify layer properties such as Scale, Position, Rotation, and Opacity to create our animation. We've also learned how to use Trim Paths and radial bursts to create special effects, how to adjust timing, and how to apply Ease to finalize our project.
Let's move on to the next chapter, where we will learn how to export our animation as a .json file and preview it on the LottieFiles platform. See you there!