Join George Maestri for an in-depth discussion in this video Animating objects along spline paths, part of Up and Running with Maya LT.
- View Offline
- One more way to animate objects is to use what's called a path. Now, a path is just basically a simple curve. Here, we have a scene with a conveyor belt and I wanna move this gear along that conveyor belt. I'm gonna go ahead and just turn off the visibility of this layer for this BG and STRUCTURE so that way we could see this a little bit more clearly. Now, what I've done here is I've drawn what's called a curve along this path.
We can create curves here under the Curves menu or here under Curve Tools, so we have a number of different curves. Let's go ahead and use his particular curve to animate this gear along the conveyor belt. All I have to do to animate this is to select the gear and then shift select the curve. We can connect this using what's called a Constrain. So I wanna make sure I'm in Animation, and under Constrain we have Motion Paths, Attach to Motion Path.
We have a number of options here as to how we want to control that. I'm just gonna leave this at default and it's just gonna use a range of the time slider and the length of the path. It's going to make it move along the path over the length of the animation. When I press Play, it will now move that along the path. Now, if we wanna control the speed of this, we can go into the Graph Editor.
If I select my gear and go Windows, Animation Editor, Graph Editor, you'll see that I have a curve here. I'm gonna hit "f" to frame all, and notice how this is just basically an animation curve. Now, what this is doing is it's telling you how far along the path it is. As it goes further along the path it speeds up and it slows down. Now, if I want, I can select the entire animation there and again make it linear tangents.
Now, you'll see how it's moving along in that path. Now, what's actually animating here is in my inputs here. Under motionPath, notice how I have what's called a U Value. This is what's highlighted in pink so that's what's animating. Now, all of these other values here are highlighted in yellow and that means that they're connected to something else, they're being controlled by something else.
In this case, it's the motionPath. When I select this U Value, you can see that I have my keys here on the timeline. If I were to select something else, just the object, you'll see that, well, I don't get that on the timeline, I have to scroll down and open up that motionPath. Now, once I have this open that means I can actually start to change the timing. So, if I want, I can highlight this key and move it so that it ends later or starts earlier.
Now, I can animate that all the way along there much more quickly. Or if I want, I can animate it more slowly. One of the things I can do is I can actually make multiple gears on this timeline. Let's go ahead and just take this particular gear and I'm gonna go ahead and highlight this last keyframe here and move it back to 90, so we're kind of back to what we had before. I'm gonna go ahead and select this and duplicate it.
We can duplicate things by doing Edit, Duplicate. When I do, it creates another object. So I have another gear here and I can attach this to the path as well. So if I select this, shift select that path, I can do Constrain, Motion Paths, Attach to Motion Path. Now, when I do that, it basically just moves that along the path around that same value. But, again, it goes to those default curve values, so if I select both of these here, I'm gonna go into my Outliner here, and I'm gonna select GEAR_1 and GEAR_2 which are both of these.
Then let's look at those in the Graph Editor. You can see that the curve for GEAR_2 here has a slow in and a slow out. But again if I want, I can highlight that, make it linear. And when I do, it basically puts it in the same state as the other objects, so as the other gear. One of the things I can do is could select that GEAR_2, let's go back into our Outliner here, select GEAR_2 here and you'll see that, well, in my motionPath I have this key.
This key is basically just telling it how far along that path it is. If I wanted to, I could type say -20 into my timeline and I can move that key back to say -20. Now, when it animates, it's going to start animating a lot more slowly. And I can take this second key and move it say to 70. Now, these are gonna be 20 frames apart.
If I go to my regular animation, you're gonna see that this one is a little bit further out, and now we've got animation that looks a little bit like that. As you could see, animating along motionPath is a fairly easy task, all you have to do is select the object and the path. We can control where they are on the path through the Graph Editor and the timeline.
- Configuring viewports
- Selecting objects
- Rotating, scaling, and pivoting
- Working with the Attribute Editor
- Organizing scenes with layers
- Creating polygonal models
- Modeling polygonal meshes
- Creating materials
- Applying textures
- Animating objects
- Exporting assets to Maya or Unity