A Motion Tutorial that shows how you can seamlessly loop ‘root motion’ from an animation. This has several uses, the most common of which is getting continual ‘forwards’ motion from a walk animation, with the ability to stop, start and mix it with other animations without changing the model’s position in space.
If you have a model with an animation which moves that model through 3D space by an arbitrary amount, the processes set out in this video will help you; it’s an insight of how I’ve made the Blender animations on this channel.
You have a character model or maybe a car, or whatever else you want to use. It has an animation where it moves around, maybe it walks or runs or drives, and you need to take that motion from the animation and allow it to move around your environment in Blender.
But how can this be done? Well the more traditional method is to add a root bone to your rig to your armature, and animate that root bone to move around to move everything with it.
The issue of having this bound to a root bone means that it’s all captured within the animation track: be it a walk track or a run track. Which makes it kind of difficult to mix that information with other animation tracks, as it can cause the location of your model to snap around, particularly snap back to its default location, as a new animation with its own motion track for the root bone tries to replace the motion given to it by the other ones.
So instead of having a root bone within the armature itself, what I have found to be the more effective way of doing it is to have a separate object used to define the object’s motion. First of all you take the object, you parent that to the armature and rig it.
But then you parent the armature to the vertex triangle of a another object. See here this triangle thing basically just consists of one little triangle of vertices, which the object is parented to a vertex triangle parent.
And now just another one at the end here just to show me which way forward is. Now this object itself is then attached to a curve modifier, bezier curve seen here. The exact setting of the deform axis is going to depend on you.
But pretty much it just attaches itself to the curve of a bezier object, meaning that the curve of the bezier object itself is able to define how this triangle object moves, and now since the armature of the character model is parented to the vertex triangle of the triangle object, it means it’s going to take it with it.
And even if you just move the vertex objects along one axis, it’s still going to follow the curve of the bezier no matter how it moves, whether it moves on the x-axis, the y-axis or even the z-axis.
You can do anything you need to with to the bezier curve, make it as complex as you want, and it’s always just going to follow it perfectly. Now the advantage of this means that if you take your animation, in this example a walk animation, and then you want to extrapolate the motion from that.
Because it is a separate animation now, it means you can do more with it. You see the motion here is literally just two vertices which define the speed that the triangle object moves along the curve. A steeper slope means that it’s going to go faster.
A less steep slope means it’s going slower. This needs to work at the correct speed to suit your walking animation. Do note that. It mixes with a Cycles modifier just to keep the motion linear and continually extrapolated.
If you need to make the track longer you shouldn’t do that with the repeat function, because then you’re going to get it snapping to the start when it repeats, which is the issue we’re trying to avoid.
Instead you’re going to want to extend the ends. All the frames start to change its starting and ending locations. Now one of the advantages of doing it like this means that it’s no longer bound to the animation itself, so I can take it, I can cut it up and put a gap between, and the character has like a little rest or something.
And then by making a cut within the motion of the triangle object, you can give it that same rest, and then when it starts again you just continue it to be lined up, making sure that the Frame Start is in the correct place, so that it doesn’t try to move.
You see here it ends on frame 77, starts frame 77. This allows the character to stop, pause a moment and go on again. Now this is possible by having the root bone as a part of the armature itself, but let’s say you have a secondary animation.
If this animation had its own animation for the root bone, and the root bone was inside of the armature that’s either going to distort the already present motion, or the walk cycle, or it’s going to reset the object’s location back to its default position.
But like this you’re essentially allowed to have a non-destructive process. You can put whatever animations you want over the top of each other. And if for example you have this animation for climbing up of a staircase…
See here it’s still the walking animation. You can easily mix this after you’ve climbed up the staircase or whatever you need to happen with the animation for walking, the root motion for walking.
And once he gets to the top of the stairs and using the Add Blending, it means that once he climbs to the top of the staircase he starts moving forwards. You see how it’s non-destructive that always makes it way better.
With a system such as I mentioned before it’s going to try and snap it back to the root’s location, the original location, since it doesn’t understand how to blend the animations properly. This thing here is just what the triangle thing and the bezier curve are both parented to. This allows this root object to move everything around without disturbing anything else in the scene.