A tutorial explaining the process of getting animated characters out of Blender and into the DAGE.
This tutorial assumes that you are familiar with Blender's interface. If you're not familiar with Blender or modeling and rigging characters, then these tutorials would be a better place to start:
If you're just starting out with Blender, be aware that the next version will have a totally redesigned interface. So you might want to start out with the 2.50 alpha release.
You can download all the files used in this tutorial if you want to follow along or experiment:
Download this version of the .smd export script, modified to work with the DAGE:
Copy the file smd_export.py into the Blender scripts folder.
Windows XP: C:\Program Files\Blender Foundation\Blender\.blender\scripts
Windows Vista: C:\Users\<user name>\AppData\Roaming\Blender Foundation\Blender\.blender\scripts
Load Blender and the Half Life 2 (.smd) or (.vta) option should be available from File > Export.
The .smd export requires one mesh and one armature. The mesh must have an armature modifier, or be parented to an armature, using vertex groups rather than envelopes for weighting:
Each vertex must be assigned to at least one bone.
Try to keep the rig simple, and remember that bone constraints may not be maintained in the .smd export.
For more information see the animation tutorial above.
The material your mesh uses must have the same name as the texture map that the DAGE is going to use including the file extension (.jpg, .png etc.):
None of the other material settings will affect the exported .smd.
If your character is made up of several objects in blender (body, eyeballs, hat…) they must be combined.
Select the meshes with Shift - Right Click.
Combine the meshes with Ctrl - J.
With all the meshes combined, enter Edit Mode by pressing Tab.
Select all vertices with A.
From Mesh Tools click Rem Doubles to remove any duplicate vertices.
With the mouse pointer over the mesh, press Ctrl-N to recalculate normals outside.
The exporter requires one mesh and one armature to be selected, in that order.
Select the mesh followed by the armature using Shift - Right Click:
Click File > Export > Half Life 2 (.smd) or (.vta)
Choose Static Mesh.
Type a name for your base mesh (like “Alice.smd”) and click Export SMD.
Use the action editor to select the animation you want to export:
Select the mesh then the armature and export as before.
This time choose Animated Mesh.
Type a name based upon the animation (like “Alice_walking.smd”) and click Export SMD.
You should now have a base mesh, and as many animations as you need. Load them in the DAGE and start working on your game!
If you want to put Alice into the bunker, try these settings:
Alice = TActor.Create();
Alice.LoadBaseMesh('Alice/Alice.smd');
Alice.SetPosition(-50,25,-20);
Alice.SetActor_Dummy_Position(0,0,0);
Alice.SetMeshScale(1,1,1);
Alice.AddAnimation('Alice/Alice_standing.smd');
Alice.AddAnimation('Alice/Alice_talking.smd');
Alice.AddAnimation('Alice/Alice_walking.smd');
Alice.WalkingAnimation = 'Alice_walking';
Alice.TalkingAnimation = 'Alice_talking';
Alice.StandingAnimation = 'Alice_standing';
Alice.CurrentAnimation = 'Alice_standing';
Alice.Interval = 100;
Alice.SetCollisionScale(8,22,8);
Alice.MouseControl = 1;
Alice.WalkingSpeed = 500;
Alice.WalkingInterval = 50;
The DAGE does not like .smd files exported from Blender which have only two bones. You can create an extra bone in Blender to get around this problem.
The static and animated .smd files exported by Blender seem to have a different orientation to one another, so you may need to use TActor.SetMeshRollAngle to account for this.
The mesh casts weird shadows in the DAGE:
You may have duplicate vertices. Remove the doubles by following Step 3.
Part of the mesh are invisible:
The normals may be flipped the wrong way. Sort this out by following Step 3.
The mesh is distorted when I load it in the DAGE:
Make sure that you are using the export script above, and that each vertex is assigned to at least one bone.