this document is online at
 Tank tracks Expert  Having fun with LEGO!
2001 03 30 
  Sverre Nyheim  id166 
I've noticed that there seems to be one thing that many newbies (myself included) tends to bump into. And that is animating tracks for a tank or the like. I did a quick search a while back and I couldn't find a tutorial that covered this, so I thought I'd try my hand at writing one.

The finished product!
The finished product!
What I want to do and where I learned it
In this tutorial I intend to demonstrate how to make a track with synchronized gears. I use a variation of a method demonstrated by tHe-IcemAn (Geno Ruffalo) in his by now well known TankTrack example: It uses a single follow-curve with a time-offset for each tread. This has a limitation in that if the curve moves, the treads will lag behind the curves movement because of the time-offset. I use a separate follow-curve for each tread. This overcomes the "slurph" problem of tHe-IcemAn's method

This tutorial assumes that you are fairly comfortable with the basic Blender concepts like IPOs, the object model and familiar with the Blender GUI, but I'll try to explain all the operations as I go along. It will not go into how to actually model the tank. I used some stuff I already had. Anyway, the finished result should look like this picture and the .blend-file can of course be downloaded at the end of this tutorial. I've also put together a small animation, also available at the end of this tutorial. One point to note: I've parented practically everything to an empty which I will refer to in this tutorial as the "MasterEmpty".

Keeping track of things
To keep things a bit tidy I like to have the path, the gears, the treads and the other bits on separate layers. In this case I even put the bits that make up the left and right tracks on separate layers so that I could work on one whithout being distracted by the other one. This is also probably a good point to start cleaning up in the OOPS-window if you haven't allready done so. I've tried do clean up mine, but it's still a mess. We'll be using the OOPS-window later on. Also, I'm going to use the IPO-window, the OOPS-window and the 3D-window quite a bit, so I like to have all three types of windows available in the same screen.

I like to have the treads move "forward" before I start messing with TimeIPO's and stuff. I feel that it is more intuitive that the track move forward when time moves forward. If you dont understand a word of this I hope it will become clearer as the tute move on. I mention this because sometimes the track moves in the wrong direction when I first set it up. My quick fix for that is just to rotate the curve 180 degrees (around the Z-axis, in top view, in this case) and realign the vertices.

Getting ready
After building your tank you need to add a curve object. This will be the path that the treads will follow. I prefer to use Bezier-curves for these things. Edit it by adding and moving verticies as needed until you have a curve that looks good. Mine looks like this picture. Make the MasterEmpty the parent of it.

The curve for the threads
The curve for the threads

Turn the curve into a path by going to the AnimButtons () and pressing "CurvePath" and "Curve Follow". The "CurvePath" button turns the curve into a path and the "CurveFollow" button causes objects parented to it to rotate to follow the shape of the curve.

Getting the track right
When building a tank it would be nice for the track to go all the way round without gaps, right? This can be a bit tricky getting right. You need to know the distance between the joints of the treads. To find this I simply select the tread, make a copy of it and move the copy untill the joints line up. The distance is shown in the header of the 3D-window.

For me the distance, 'd', is 0.6036 units. The curve should have a length that is n*d, where 'n' is an integer. Here the "PrintLen" button comes in handy. It prints the actual length of the curve. After pressing it I got the number '37.5423'. This divided by 0.6036 gives 62.19731610338 (aproximately). Looks like I'll be having 62 treads for each track. Running the equation backwards (62*0.6036) tells me that my curve should have a length of 37.4232. So I tweak and modify the curve untill it is aproximately that length (37.4233, actually). Also, set the length of the curve to 62 using the "PathLen" button.

Basic track-following
Make the curve the parent of the tread. To make the tread sit on the curve press . Adjust the rotation of the tread as nescessary. If you now press you'll see the tread move along the path nicely. But it only does one loop and stops at frame 62. This is what we'll fix next. If your tread moves "backwards" you can here chose to go back a few steps, turn the curve around and get the length right again if you have to move vertices around.

Got to the IPO-window. Select the curve and press the "CurveIPO" button (). twice anywhere whitin the window to create a curve with two verticies. Enter editmode, select the left vertex, press the and enter these values: [LocX: 1, LocY: 0] Select the right vertex and enter these values: [LocX: 62, LocY: 1] Set extendmode to cyclic by pressing this button in the header: . It should now look like in this picture. When setting up the curve it's practically impossible to get the length of the curve correct. With the length of the curve equal to the number of treads you're going to put on you distribute the gap/overlap evenly along the track. Anyway. If you now press in the 3D-window the tread will go round and round ad nauseam.

Get them wheels moving!
The next few steps describes how to get the gears to move in synch with the track and are pretty meticuously described, IMHO. Place the 3D-cursor at the center of one gear by selecting it, pressing , and selecting "Curs -> Sel" from the popup-menu.

Add a CurveCircle (I prefer Bezier Circle) and scale it until it has roughly the same diameter as the gear. Turn the curve into a path, as described above. Actually you only need to press the "CurvePath"-button. Make the MasterEmpty the parent of the curve.

Create a cyclic animation-IPO like the one for the track-curve. The length of the IPO-curve isn't important right now. We'll adjust it later when we synchronize the gears with the track. Add an empty, make the curve the parent of it and clear the empty's origin by pressing . The setup should now look like this. You might want to pull the old "turn-the-curve-around"-trick again.

Add a one-limbed IKA. Make the empty the effector of the IKA by first selecting the IKA, then selecting the empty an press . Choose "Effector as child?" from the PUP-menu. This will cause the IKA to point towards the empty. Make the MasterEmpty the parent of the IKA. Do not select "Effector as child?". Make the IKA the parent of the gear. Select "Use Limb" og "Limb 0" when parenting the IKA to the gear.

The gear should now turn round and round. Repeat the process for each gear. I expect a lot of the more experienced Blender-users will object to my use of IKAs here. I will explain the reasons why I choose to use IKAs at the end of this tutorial

Synchronizing the gear with the track
The "lenght" along the X-axis of the Speed-IPO determines the rotational speed. Adjust the "length" of the curve-IPOs of the "gear-curves" to synchronize the gears with the tread. You can spend endless amounts of time trying to get it as perfect as possible, but most times a rough fit will do just fine. I have no clever tricks to offer in this department. Just try it out and fool around until you're happy. Or fed up. Whichever comes first. But you have to repeat the process for each gear. Of course, if you have several gears of the same size you can just copy the curve-empty-IKA-setup from one gear to the other.

It is of cource wise to keep cleaning up the OOPS-window as you progress. It becomes very cluttered very quickly.

Get things to change speed...
This is where the hassle of the previous steps begin to pay off. Because now we can controll the motion of the track and gears with a single IPO.

Select the tread and create an ObIPO for it with nothing in it and give it a cryptic name like "TimeIPO". Have the tread and the empties controlling the rotation of the wheels use this IPO. By adding a time-curve in this IPO-block you can make all the track and the wheels move in unison. Try it!

Adding more treads
The next steps can be a major hassle. This is where I use the 3D-window, the IPO-window and the OOPS-window together. My screen looks something like this: We're going to use a separate path for each tread. Fourtenately curves don't take up much filesize. Since we're going to have a bunch of identical curves at the same place telling them apart can be a bit tricky. This is where the OOPS-window comes in handy. But first, delete the Time-curve in the TimeIPO.

Select the follow-curve and make a copy of it (). Press to exit grab-mode. Do not make a linked copy because we're going to manipulate the speed-IPO for each curve to get the effect we want and that is linked to the curve-data, not the ObData. In the OOPS-window place it next to the original curve. This to keep things tidy.

Select the tread and make a linked copy of it with ALT+DKEY. In the OOPS-window place it somewhere sensible, like below the curve object as I have done. ActiveSelect the new curve while having the tread selected by pressing CTRL+SHIFT+RightClick in the OOPS-window. Go to the 3D-window and make the new curve the parent of the tread by pressing CTRL+PKEY. You may need to clear the origin (ALT+OKEY) and adjust the rotation of the tread after it has been parented to the new curve. That's why I find it helpfull to do this on a fairly straight piece of curve.

Go to the IPO-window and move the Speed-IPO one unit to the right. Hold CTRL down while dragging to get exactly one unit.

The second tread should now follow the first one nicely. Repeat this step for all treads. This is where the benefit of having the length of the Speed-IPO equal to the number of treads comes back to you, because now you can easily move the Speed-IPO exactly the required distance. I spent a lot of time manually entering values for the vertices of the Speed-IPO before that little trick dawned on me. And, yes, I felt pretty daft when it did.

Bringing it together
Get the whole thing moving. Now it's just a matter of moving the master-empty as you please and just synchronizing the TimeIPO as needed.

Oh, by the way. You will of course repeat the whole process for the other track. ;) Have fun!

Why I use IKA's and stuff
I use IKAs to controll the gears because I find it gives the result I want and is fairly easy to set up. The main point is to be able to controll the movements of all the treads and gears with a single IPO. I didn't use tracking, because it can be a bit tricky getting right. Especially in this case, where the gears spin in the vertical plane. Since tracking-objects like to know which way is up the qears would flip every 180 degrees. The tank wouldn't look very sturdy like that. The "I-want-to-know-which-way-is-up" behaviour can be switched off, but when I tried to do that the gears just spun around like they were drunk or something. Just using RotIPO's for the gears would defeate the purpose of controlling everything with a single IPO-block.

Another way I could have done it would be to make the gear-curve the parent of the gear an let the gear use the TimeIPO. However, Blenders curves aren't perfectly circular so the gear would appear to woble. This could be reduced by scaling the gear-curve down, but I still feel it looks a bit wobly. But mostly I used IKA's because I was to lazy to figure out a better way. They're so nice and predictable, those IKA's.

Some closing thoughts
Setting up a system like this is a lot of work but the results can be quite nice. As I'm writing this (February-2001) I'm aware of at least a couple of people out there working on Python-scripts to achieve this, but as far as I know they're not quite done yet. And of course. When you do it this way you won't have to redo the whole thing when the Python API changes. ;) To sum up: There are probably better ways to do some of the things that I've done in this tutorial. But nevertheless I hope you have at least solved a problem and possibly gotten a better grasp of some of the inner murkings of Blender. Have fun, keep Blending!