From the course: Motion 5.3 Essential Training

Animating line graphs

- [Instructor] In this video, we're going to apply multiple techniques together to actually create one finished animation. So if we look at our project here, I want you to notice that we have this graphic area over on the side which is where we're going to animate a line graph to appear. Now if we look in the Layers panel, you can see I have a bunch of different groups that were used to create this scene. Now I don't want to mess up anything that's already been created so I'll make sure everything's locked off. So I'll just click these locks to make sure they're locked off and we want the Graphics group to remain open cuz that's where we're going to add our graphics. So the first thing we need to do is actually create a line. So to do that I'm going to go down to my Bezier pen tool right here and I'll click and hold for the Bezier tool, alright? And choose that tool. And let's start here on the lower left side and we can start outside of the graphic area, we can fix this later. So I'll click out here and then I'll click up and drag to the right to change the handles of my path. So I want to have a nice round edge to the path and then we'll just come maybe halfway in the middle of the box and click and drag out to have a nice rounded, roller coaster kind of look. And then I can come back up here and have that draw out like so and here we could go ahead and draw out the last line here. Now I see a little bit of a bump here so here I'm just going to go 'head and move this and drag this out, drag that out and there we go, kay? You want to crate something relatively smooth. Then when you're done you can click outside the graphic area and that'll go ahead and set this line. And to make sure you don't accidentally create any more shapes, go ahead and click and hold on your tools here to grab the transform tool. Okay, now this looks kind of wacky. We need to make sure we go to the Inspector and disable the fill. So now we're only dealing with the outline. Which, this looks pretty good, I know it's off the edge here but that's fine, like I said we'll fix that in a minute. Now I want to have an arrow animate along and actually draw the appearance of this line. To do that I need to add an arrow to the project so let's go to the library section, and go to the shapes area and click on the arrow and apply that into our scene. Now the arrows kind of large but that's fine, I'll leave it large for now. In order to have this arrow travel along the path I need to add a behavior. So with the arrow selected, go open your Behaviors, go to Basic Motion, and choose Motion Path. Now notice it automatically creates this red path, well if we leave that behavior selected and go to the Inspector, under the Behavior section the very first option under Path Shape, if you click on that where it says Open Spline and go down to Geometry this'll give us a drop well. And this drop well allows me to take this Bezier path that I've already created, click on it, and drag and then drop it right into that little well. So now if I scrub in the timeline you can see my arrow is moving along. Now it's not aligned properly and it is moving along over the entire length of our project. So let's address the fact that it's taking too long, alright? Let's say I want this to animate over, I don't know, three seconds. I'll move my current time indicator to three seconds and I'll press 'o' on my keyboard to trim the outpoint of the motion path. So now if I scrub you can see it's only taking three seconds to move across. Well I want the arrow to rotate along the path. So I need to apply another behavior. Let's go back to a library and go to the Behaviors section. And under Basic Motion there is one called Snap Alignment to Motion. So let's drag on that and drop it right on top of our arrow. Now it still hasn't quite fixed things, so let's go back to the Inspector and in here we need to change the axis from horizontal to vertical. So now you can see if I scrub, the arrow is actually moving along the path. Now the arrows huge so let's see if we can line up the size of the path with the size of the arrow. I'll select my Bézier path and let's look at the width here under the shape options. I want to increase the width up to something like 20, so the lines a lot larger. Then I'll select my arrow and go to the properties for that arrow and we can change the scale down to a setting of 20, and if I click off notice the arrows kind of disappeared. Well that's because if you notice, the snap alignment to motion behavior is all the way over the entire duration of the project. Well, let's go ahead and hold down shift as we drag to snap our playhead to the end of the motion path and here I can change snap alignment to motion to end right here at the same time just by clicking and dragging and holding down shift. And then now I needed to actually reveal the line as it moves along. So to do that what I'll do is move my current time indicator to three seconds at the end of my motion path and I'll select my Bezier spline right here. And I can go to the shape section in my Inspector and notice I have an option for Last Point Offset. So here I'll add a key frame. I'll just click on that. Then I'll move back to the beginning of the timeline and I'll add another key frame right here next to Last Point Offset, and then I will change the slider down to zero. So now if I just click anywhere outside of the graph and I press play, you'll see the arrow is drawing the line on which is exactly what we want. Now of course the arrow freaked out here and we see the edges of our line. So the absolute last thing we need to to is add a mask on top of this graphics group. And since I've already created the grid, I'm already halfway there. I can just select the Graphics group and go up under Object and choose Add Image Mask and it's looking for an image so I can drag the grid image and drop it right into that drop well. Now that'll cause the grid to disappear but I can just turn the visibility right back on again and now you'll notice that the arrow comes in and draws our path along and then just pops right off the other side. So when it comes to animating line graphs, you can animate things onto your graph, you just need to make sure that you actually utilize some Bezier paths. Then it's just a matter of adjusting some behaviors to make sure that the object you're animating along the path behaves in the proper fashion so that it actually reveals the line.

Contents