Like a lot of people, I have plenty of 3D ideas in the head, and most of the time I begin by directly drawing something in Blender. And like a lot of people, I know this is not a really good method, but I do all the same because I am too lazy to follow a better way.
Two weeks ago, I was on a wellness week-end with my girl friend. Three days without any computer, hell or paradise? Well, without computer, but not really without Blender, because I could not get some of the ideas out of my mind. So I just had to relax my body and let my brain choose between “no-thinking” and “B…2.48a”. Guess what, I tooque a pen and a paper, and began to draw some sketches.The best part in that story is that I had a lot of time to grind the project, before I could finally start to build some objects in Blender. The ideas where numerous and growing every minute; I had already a list of problems and some solutions and many derivations and alternatives.
Once bak at home, I tried to do some critical points in Blender, and I submitted the unsolvable knots to the legendary famous BlenderClan (http://blenderclan.tuxfamily.org
Note for the beginners (like me, sometimes) : try to reduce your problem to its simplest state to find solutions. Open a new Blender file, with just the things you need to tackle the problem, and experiment with it. If you are unable to find a solution, you can asque about it at blenderartists forum, explain the case and maybe give them the file. If you are a bit lucky, you will receive a lot of suggestions. Be careful not to asque too many things at one time, the answers will probably be lesser.
Here you can see some fundamental definitions for understanding what we can do with this tool to improve the time of checks and verifications.
Well, enough said, let’s get on with the project. The main criteria are:
- Doing animations with only one IPO (The "One Ipo Research Attitude" : OIRA) … lol, this name just make me laugh myself
- When not possible, than "As Few As Possible Ipo Research Attitude" : AFAPIRA)
- In the “OIRA or AFAPIRA” serial, we are starting with :Doing the wheels of a vehicle staying on the floor (Mesh) with constraints Doing a Caterpillar software Track, with dynamic inertia No addition of Python scripting, I am not yet a experienced in it (PyDrivers are allowed)
Use Modifiers and Constraints from Blender 2.48a
1.Layer 1 : the floor
Open a new Blender File, delete all objects, select only Layer 1 (1), switch to Top View (Numpad 7), add a Mesh Plane (Space, Mesh, Plane), in Edit Mode (Tab) select (RMB, Shift+RMB) and delete (X, 1) the 2 upper vértices, select the remaining Edge (A) scale it 20x (S, 20, Enter), subdivide it 21x (W, 2, Number of cuts :21).
Select the vértices on the positive part of the X axis (B, LMB+MouseMove), and hide them (H).
Switch to Front View (Numpad 1) select the two middle vértices, switch to the Proportional Edit Tool (O), select Random Falloff, move the vértices 1BU along the Z axis, having all the vértices in the select circle (G, Z, Mousewheel)
Switch to Top view (Numpad 7), reveal the invisible vértices (Alt+H), select all the vértices (A, A), extrude 2BU along the Y axis (E, 1, Y, 2, Enter)
Select all the vértices (A, A), recalculate normals outside (Ctrl+N), swtich to Object Mode (Tab), add a Modifier Subsurf (Ctrl+2)
Rename the Plane in Floor and make it smooth
2.Layer 2 : The projections
Select only Layer 2 (2), switch to Top View, add a Mesh Plane and modify it to obtain 10 Edges from 1BU(Blender Unit) on a straight line, place it on X=5, Y=0, Z=10, give it the name ProjectionFloor and watch of the center on the object !
In Edit Mode, go to the panel “Link and Material” (F9), add a Vertex Group (New), name it Pr1, select only the first Vertex on the left, press Assign. Add a Vertex Group (New), name it Pr1b, assign to this Group only the second Vertex, then make the same for Pr2, Pr2b, Pr3, Pr3b, … Pr6.
3.Layer 3 : the Hooks
Keeping Layer 2 active, select Layer 3 (Shift+3), switch to Front View, add an Empty (Space, Empty), name it Pr1, place it exactly on the same place as the first Vertex from ProjectionFloor, using the Ctrl Key to snap to the grid (G, Ctrl+MouseMove). If the Empty doesn’t have his Z axis pointing up, chek in the User Preferences that the button “Aligned to View” is not enabled.
Add an Empty, snap it to the grid on the same position as the second Vertex, name it Pr1b. Go on with Pr2, Pr2b, … Pr6. Verify in Top View that the position of the Empties is correct on the Y axis too. In the panel “Draw” (F7), show the name of the different objects on Layers 2 and 3.
Select the Mesh ProjectionFloor (RMB), switch to Edit Mode (Tab), select only the first Vertex on the left (RMB). Staying in Edit Mode, select the corresponding Empty Pr1 (Ctrl+RMB) and create a Hooque on the Vertex (Ctrl+H, 2).
Then select the second Vertex (RMB) and the second Empty (Ctrl+RMB), create the Hooque (Ctrl+H, 2), and so on to the last Empty. Now when you are finished, if you select one Vertex and move it (G+MouseMove), the corresponding Empty will follow.
Well, that was just to be sure that the setup is working, so don’t move any Vertex for the moment (Esc). Now the first trick. switch to Front View (Numpad1), show the first Layer (Shift+1) to see the Mesh Floor, select the Mesh ProjectionFloor, go to the panel “Modifiers”, add a Modifier Shrinkwrap, set the parameters and enjoy the result.
Guess what, you have to do the same for all the other Vertex Groups, … but don't panic, when you clik on the button “Copy” in the Modifier, you get to copy all the attributes automatically, the only change you have to make is to the VGroup:Pr1b, Pr2, Pr2b, …Pr6). Now if you move the Mesh, you can see the Empties following the Floor. Pretty cool, isn’t it?
4.Layer 4 : the Path
Show only the Layer 4 (4), Front View (Numpad1) add some Curves Bezier as landmarks to position the Curve NURBS Circle which will be the Path of the caterpillar track. Because we don't need 3D Curves, it is necessary to turn the Curves around the X axis. Show the panel “Transform Properties” set the rotation for RotX. And don’t forget to give names to all your objects.
Note for the lazy people (like me, sometimes) : try to snap most of the control points from the Path PathCaterpillar on the grid (zoom around a bit if necessary) because soon you will have to align Bones and Empties on every control point of the path. So it is easy to do it with an extreme precision where every object has his place on the grid.
Note for everyone (like me, sometimes) : ensure that you have a round length from your path when you’ve finished designing it. For example, 50, because the caterpillar trak will be easier to configure with (for example) 50 links, having every 1BU width.
Select all the vértices, go to the panel “Curve Tools” (F9 when the Curve is in Edit Mode), set the Order U to 3, and attribute to all the vértices a weight of 1.
Note for the pressed people (like me, sometimes) : it is important to draw the Curve PathCaterpillar like a slak rope, because when the caterpillar moves, the trak will tighten. But remember, it’s not elastic, so the length must be kept constant.
The path must look like a slak rope now because it will look like a tight rope soon.
5.Layer 5 : the Constraints
We are going to configure a lot of constrained Empties. This system will help us to position the steel frame of the vehicle, and to deform the future Armature which will itself control the Curve PathCaterpillar.
Show Layer 3, 4 and 5 (3, Shift+4; Shift+5), add an Empty, name it PositionFrame1, set its size as 0.5 in the panel “Links and Material”, give it the Empty Pr1 as Parent (RMB on PositionFrame1, Shift+RMB on Pr1, Ctrl+P, Enter), and move it 1BU above Pr1. Do the same with PositionFrame2 (Parent = Pr3b), and PositionFrame3 (Parent = Pr6).
Add a Mesh Plane, name it AverageFrame, modify it to obtain 3 vértices on a straight line, with every vertex on the position of PositionFrame1, PositionFrame2 and PositionFrame3. Hooque each Vertex to the corresponding Empty.
Switch to Object Mode, add an Empty, name it OrientateFrame, place it on PositionFrame2, select the Empty OrientateFrame (RMB) and the Mesh AverageFrame (Shift+RMB), switch to Edit Mode (Tab), select all the 3 Vertices (A), and define the vértices as Parent from the Empty (Ctrl+P, Enter).
Now if you show the Layer 2 (Shift+2), select the Mesh ProjectionFloor, and move it along the X axis, you can see that the Empty OrientateFrame follows the Mesh AverageFrame, but where the Mesh Floor in Layer 1 (hided) goes up, OrientateFrame goes up side down, having the Z axis pointing downwards. To correct this, simply add it as a Constraint Copy Rotation on PositionFrame1, Influence 0, and a TrackTo (Ctrl+T, 1) on PositionFrame3. So you have 2 choices to test later, just play with Influences.
Switch to Side View (Numpad 3), add a Mesh Plane, name it SoftFrame, go in Edit Mode (Tab), and rotate the Plane around the Y axis (R, Y, 90, Enter). Select only the 2 upper vértices, merge them (W, 5, 3, Enter), select all (A, A), subdivide (W, 1), and move all 1BU up (G, Z, 1, Enter). Set the parameters in the panel “Soft Body” (F7, F7)
This method is not mine, you can read about it here
And you will find the full description herer http://blenderartists.org
Thanque you yoyofargo!
Add an Empty at the origin from SoftFrame, name it SoftDynamicFrame, and give it the 3 central vértices from the Mesh as Parent.
So, when the SoftBody will move, the Empty SoftDynamicFrame will receive an angle of the movement. This angle will be copied to move parts from the future Armature.
Add an Empty AngleFrame 2BU above OrientateFrame, define OrientateFrame as the Parent of AngleFrame. Add a Constraint Copy Rotation from SoftDynamicFrame to AngleFrame, leave only Y and Infuence 0.1.
Select the Curve PathCaterpillar, and give it the AngleFrame as Parent. Now if you move the Mesh ProjectionFloor, PathCaterpillar will follow the slope of the Floor. If you rotate the Empty SoftDynamicFrame around Y axis, PathCaterpillar will follow the rotation.
Hey, grab a drink, it’s not finished yet. Add an Empty CenterMidWheel, child of AngleFrame, add an Empty IKTargetMidLeft and an Empty IKTargetMidRight both child of CenterMidWheel. IKTargetMidLeft and IKTargetMidRight must be placed on the corresponding vértices from PathCaterpillar.
Add an Empty CenterFrontWheel, child of AngleFrame. Rotate it -90° around Z axis (R, Z, -90, Enter). This special orientation will be useful for a future IK constraint.
This Empty will have to turn in the other way round of AngleFrame. To do the magical trick, we need another Empty PivotFrontWheel, child of AngleFrame, and a Constraint Transformation on PivotFrontWheel. The Target Object of the Constraint is SoftDynamicFrame.
CenterFrontWheel will receive a Copy Rotation Constraint from PivotFrontWheel.
Now if you rotate SoftDynamicFrame, you should be able to see something like this.
Wow, no sea-sicknessí Then do the same for the right side of the force.
6.Layer 5 : the Armature
Add an Armature on Layer 6. Remember that each Bone starts and ends on a Vertex from the Curve PathCaterpillar (you might see some exceptions on the picture below). Origin of the Armature is the position of OrientateFrame, and Parent of the Armature is OrientateFrame too.
When the Armature is designed, in Edit Mode select all the Bones (A) and Recalculate Bone Roll Angles (Ctrl+N, 1).
It’s time to add IK Constraints. Armature is in Object Mode. Select the Empty CenterFrontWheel (RMB), select the Armature (Shift+RMB), switch Armature to Pose Mode (Ctrl+Tab), select the Bone which already pointing on the Empty, add the Constraint to active object (Shift+I, 1)
Don’t forget to disable the Stretch button, we need a constant length. The option Rot lets the Bone follow the rotation of the target, and you, lucky people, have already set the orientation of the target CenterFrontWheel in part 5, didn’t you?
What else? The IK for the middle wheel.
And the last, but not least, the constraints for the floor.
Have you twigged? Ah, by the way, you must add in Layer 3 an Empty PrePr1, child of Pr1, and a PostPr6, child of Pr6.
Show the Layers 5 and 6, rotate the Empty SoftDynamicFrame (+ and -90°), what do you see? Armature is deformed but not stretched? Goal reached! Well, in fact not completely. The IK for the middle wheel is only effective when it stretches a little bit.
Note for the experts (like me, maybe one day) :
if you find a better way to use the IK Constraint, without any stretching, with a full constant length for the complete chain, please share some tips as how you achieved it!
7.Layer 7 : the Hooks
This one is only for pleasure. On each Vertex of the Curve PathCaterpillar place an Empty. Names are HookPath… HookPath.0XX. Well, on the picture bellow the names are still in French, but it’s too late to translate this in detail, and I’m not ready with the extra work, so please translate for me HookChenille = HookPath.
Select the Armature go in Pose Mode (Ctrl+Tab), select an Empty (Ctrl+RMB), select the corresponding Bone (Shift+RMB), make the Bone Parent from the Empty (Ctrl+P, 1)
Do I have to be precise, it’s necessary for each Empty?
When it’s done, show Layers 3 and 7, select the Curve PathCaterpillar, go in Edit Mode, select 1 Vertex (RMB), select the corresponding Empty (Ctrl+RMB), make the Hooque (Ctrl+H, 2).
And one more time, I’m afraid that’s necessary for each Empty. But if you’re a good pianist, it doesn’t take you a long time to perform.
Now we start a special step: making the trak links following the path. This will be always be only an appróximation. Why? Because I know of only two methods and both are not “real”.
First method: origin of the links are on the path, then the joints are too distant on the little curves.
Second Method: origins of the links are working with a TrackTo Constraint, but the joints are too close on the little curves.
Well, first method seams to be more imprecise, but faster to set up. We'll take this one for now, with narrow trak links. The illusion should be enough.
8.Layer 8 : the links
Model a simple link about 1BU (X axis), 2BU (Y axis) and 0.5BU (Z axis). You could do it with a deformed Cube, or like me, a bit more complex.
Select the link (RMB) select the Curve PathCaterpillar (Shift+RMB), make the link follow the Curve (Ctrl+P, 2). Clear the rotation (Alt+R, Enter) and the origin (Alt+O, Enter) of the link. If necessary, re-orientate the (R) Link to align it along the Curve. Make sure that the Curve is configured with “CurvePath”, “CurveFollow” and “PathDist Offs” in the panel “Curve and Surface”.
If the link is not on the straight portion of the Curve, select the Curve, go in Edit Mode, select all. The only non-yellow edge (not selected) is probably not in the middle of the straight portion.
Select one Edge in the middle bottom, erase it (X, 2), the problem should be solved. If the Curve is open, close it (C).
Quit the Edit Mode of the Curve. Select the link, make a duplicate (Alt+T), give it a TimeOffset to 1.00 in the panel “Anim settings” (F7)
With the duplicate method (Alt+A and not Shift+A) you can modify a link, selecting each duplicate and modifying at the same time. So you do your test with a simple deformed cube, and after the 50 links are ready, you can tweaque their appearance without doing the worque 50 times.
Note for the smart people (like me sometimes, but not enough for this case) : there is maybe a magic trik with an Array Modifier or something like this to add all the links with just as few clicks. If you find it, please let me know.
You remember the round length of the Curve PathCaterpillar? It was about 50, but the link is about 1BU width, so you have to do the same again 48 times, Alt+A, TimeOffset: 2.00, Alt+A, TimeOffset: 3.00, …
9.Layer 9 : the wheels
This part is left as an exercise for the reader. I will just show you my Layer as example. I began with the first wheel, upper left, and the others are modified and scaled copies.
Parent of the wheels are on the Layers 3 and 5. FrontWheel is a child of CenterFrontWheel, MiddleWheel is a child of CenterMidWheel, RearWheel is a child of CenterRearWheel, FloorWheel1 is a child of Pr1, FloorWheel2 is a child of Pr2, …, FloorWheel6 is a child of Pr6.
10.Layer 10 : the Master and the Guide
On Layer 10 add two Empties. The first one, Master, must be placed at 0 on the X axis, 0 on the Y axis, and 20 on the Z axis. The second, Guide, must be placed at 0 on the X axis, 0 on the Y axis, and 10 on the Z axis. Guide will then receive a Copy Location Constraint from Master, only for the X-axis.
Guide is the Parent of the Mesh ProjectionFloor on Layer 2, and Guide is the Parent of the Mesh SoftFrame on Layer 5.
Now if you move the Empty Master along the X axis and above the Mesh Floor, you should see the ensemble following the surface of the Floor.
Is sliding not enough? Don’t give up, you’ve already done the greatest part. Go to the “Animation” Screen Layout (Ctrl+) or from the menú.
Select the Curve PathCaterpillar (on Layer 4), in the window “Ipo Curve Editor” select the Ipo Type to Path.
If there is no Ipo Curve in the window, add a Vertex near from the origin of the axis, (Ctrl+LMB) and another a bit further (Ctrl+LMB). Specify the Interpolation Mode as Linear (T, 2), and the Extend Mode as Cyclic (E, 4).
Open the “Transform Properties” box, edit the Ipo Curve (Tab), select the first Vertex (RMB) give it the coordinates in the box.
The second vertex has X coordinate 50 because this is the length of the Curve PathCaterpillar. If you don’t choose Cyclic for the Ipo Curve, the links will do only one lap along the Path.
Now the mysterious miraculous PyDriver. Write “Blender.Object.Get('Master').LocX *(-1)”
If the links move in the wrong direction, you can inverst the Ipo Curve (like “\ \ \” and not “/ / /”), or add a *(-1) factor at the end of the PyDriver.
Showing only the Layers 8 and 10, select the Empty Master and move it along the X axis. Impressive? Wait to see the wheels! Select the FrontWheel, select the Ipo Type Object, Select RotY (LMB), clik on the “Add Driver” button in the “Transform Properties” box, clik on the snake and write, “Blender.Object.Get('Master').LocX *(3.05)”.
Note for the mathematician people (not like me, I’m afraid) : I have absolutely no idea why the factor is 3.05, but I find it good in testing. It depends naturally on the teeth on the wheel, but in my case 50 / 12 = 4.16. So, who knows why?
Apply the same tweaque for the other wheels. You can of course re-use the Ipo Curve from FrontWheel for the RearWheel, with only one Ipo Curve for the six FloorWheels, and one for the MiddleWheel if its size is not the same as FloorWheels.
Do you remember the “OIRA or AFAPIRA” acronymsí Well, the Ipo Speed for the Path is a straight line and doesn’t really count. So the only object to animate with an Ipo Curve is the Empty, Master. In Frame 1 (Shift+) select Master, Insert a Keyframe for Location (I, 1), go to Frame 51 (?), move Master along X axis, and Insert a Keyframe for Location (I, 1). In the Ipo window you can select and delete the Ipo LocY and LocZ, and/or you can edit and adjust jsut the Ipo LocX.
If the Mesh SoftFrame acts strangely, go in the Panel “Collision” and clik on “Free Cache”
Pay attention to the value for End in the same panel if you do an animation longer than 250 frames.
If the Mesh ProjectionFloor acts strangely, edit the Mesh Floor, select all, and extrude a tiny little bit (E, 1, Z, -0.01). If no there's result, try to delete the Subsurf Modifier, or try to apply it.
Note for the debug warriors (maybe like me, I don’t know) : If you find why the Shrinkwrap Modifier does this jump, please let me know how to correct it.
Remember you can set the fine tuning with the Influence of the Copy Rotation constraints from CenterFrontWheel, AngleFrame, CenterRearWheel, and you can choose between Copy Rotation and TrackTo for OrientateFrame.
11.Layer 11-13 : the shok absorber
Let us do a piston, a bellows and a spring.
On the Layer 11: an Armature.
On the Layer 12: some Empties, to use as the target for IK or TrackTo (The choice is yours).
On the Layer 13: the objects. At first the piston, Blok High has a TrackTo in the direction of Blok Low, and Blok Low has a TrackTo in the direction of Blok High.
(Editor's note: this introduces a cyclic dependency which Blender has trouble resolving. If possible, it is best to avoid such setups altogether to be safe. However, if such setups are used, be aware that some lag may occur in some parts of the rig, making it unsuitable for renderfarm use.)
Now the bellows. Blok Left and Blok Right are now tracking each other like a piston. The bellows will need a Stretch To Constraint.
The effect is simple but the illusion is perfect….
…as long you don’t switch to the Side View. If the bellows are deformed (don’t asque me why) just adjust the Z size (S, Z, MouseMove).
If the orientation of the bellows is wrong, show its axes in the panel “Draw” (in the "Object" buttons). Rotate all the vértices in Edit Mode, with the cursor at the origin of the object and Pivot Mode set to 'Around the Cursor'.
Finally the spring. This one will be vertical. The TrackTo Constraint needs to have an axis pointing upwards, so in this case there is a conflict between the target directions and the up pointer. We will use a Bone, with a IK Constraint to orientate the Up and Low Blocks, and each Blok will have a Copy Rotation of the Bone. Almost as easy as for the piston.
How to model a spring? Easy, but we want to animate it! Add a Plane, place the Cursor at its center, in Front View let only an Edge and a Vertex. Select all, and press Screw in the panel “Mesh Tools”.
Erase the cylinder and keep the spring.
Select all, go to the Menu Mesh > Scripts > Edges to Curve. The script did a copy from the Mesh, and we have now a new Curve. Edit this Curve, select all the Vertices, in the panel “Curve Tools” clik on Nurb, Endpoint U, Order U: 3, Weight 1, Set Weight. Go bak to Object Mode. Add a Curve NURBS Circle, name it SpringBev, reduce its size. Select the Curve Spring (not the Mesh, you can delete this one), give SpringBev as Bevel Object in the panel “Curve and Surface”. Nothing happens, so edit the Curve Spring, select all, set the radius to 1 (W, 4, Enter). Special thanks to Zeauro from the BlenderClan for this trick.
But the wire of a spring is not a hollow tube, so we need another NURBS Curve as Taper Object. Note that the size of SpringTaper is 0.1 in Object Mode.
Resize a bit the upper and the lower part of the spring, you know, to obtain something like… a spring.
Note for the tired people (like me, it’s late) : sorry just a bad joke.
Construction, from top to bottom.
SpringBlockH, Child of FixeAbsorber1 (the main Empty for the absorber)
receives a Copy Rotation Constraint targetting BoneAbsorber2 from ArmatureAbsorber. Remember, a TrackTo Constraint is not possible because Object has to trak vertical down.
Empty CenterSpringH, child of SpringBlockH.
CurveSpring, child of CenterSpringH.
Empty ScaleSpring, child of CenterSpringH.
CenterSpringL, child of SpringBlockL.
SpringBlockL, child of the Empty CenterWheel2.
BoneSpring from ArmatureSpring, child of CenterSpringH.
BoneSpring has an IK Constraint on CenterSpringL and Stretch enabled. The high (local Y axis) of BoneSpring is precisely equal to the deformable part of the spring. Add a Copy-Scale Constraint (on Y-axis only) to the Empty ScaleSpring. ScaleSpring is oriented like BoneSpring of course, and placed at the begining of the deformable part of the spring. Select all the Vertices from the deformable part of the spring, select ScaleSpring, make a Hook. Select the lower un-deformable part, select CenterSpringL, make a Hook.
So, like you see, rigging a dynamic spring is not too difficult. But once again this method is not mine, I derived it from http://blenderunderground.com/2008/0...ig-in-blender/
simplified it (I guess) and improved (I hope). So, “Dude, all you have to do is…already done!”
Well, that’s it. Add some mecanical elements to complete the absorber. Of course a tanque have no such absorbers visible and fragile, but 3D is not the real world, so... why not?
Now if you want to make a vehicle moving on a bumpy ground, you will face bigger problems. The second caterpillar trak can’t ride for itself. Both must have the same tilt and keep the distance between them constant, because this distance is the vehicle.
Well, who can do it better, is more simple and faster? It is possible, I’m sure. But I didn’t already found the solutions. And don’t forget the “OIRA or AFAPIRA” principle.
If you’re better than me (I'm sure it’s possible, because I succeed on doing this almost every day ;-) and find a better way, or if you have questions, remarks, ideas, suggestions,… feel free to contact me at firstname.lastname@example.org
My favorite language is French, but I can decode English (please simple words only ;) und auch ein bisschen Deutsch (da noch mal bitte nicht zu komplizierte Wörter verwenden).
In the example file “CaterpillarSoftTrack.blend” you will find the object described in chapter 1 to 11, a tanque downloaded from http://dmi.chez-alice.fr
and a lot of Cameras fixed to each important part of the caterpillar. Some objects have still a French name, sorry.
In the example file “TrackLinkAppróximation.blend” there are the 2 methods described just before chapter 8 to make links follow a Path. Other ideas to do this?
In the example file “LimitePathPyDriver.blend” there are a lot of test with Ipo Speed and PyDriver you can play with.
Special thanks to the BlenderClan, Meltingman (my spiritual Master), Traven (the man who knows everything I ignore) Zeauro (I have questions, he has answers), and to my honey Coralie who slept and watched the televisión alone for two weeks while I wrote this. And THANK YOU to every people who makes Blender growing.
By Alain Mathez