Ok, so Im gonna post a WIP tutorial on how to export MD5 models and animations from blender to TDM. Its pretty rough, I will be polishing it as I go along:
A couple of guidelines:
- The mesh needs to be valid and clean with triangulated polygons;
- It must be UV unwrapped and have a material applied (with one texture image);
- Apply all transformations and modifiers before binding it to the rig;
- No more than four joints may influence any one vertex, as far as vertex weights go;
- Mesh must be parented to the rig;
- Rig must have a root bone called origin. The origin’s translation on Z should normally be zero;
- You can use the material file’s actual name as the blender material name, which will save you the need to edit the md5mesh and change the shader name manually afterwards;
Quick step by step:
After you model your mesh, uvunwrap it and apply a material to it (name it after your material in TDM); apply all transformations or modifiers.
Build the rig, by creating a root bone, and from that, extrude all other bones (in edit mode). Rename the root bone (as “origin”). If the model was imported, make sure you delete all existing vertex groups. Parent the mesh to the rig (ctrl+p) with automatic weights, this will create vertex groups for each bone (make sure you dont rename them afterwards, the vertex groups should be named the same as the bones).
To animate it, create a new action (rename it as “idle” or something), turn on automatic keyframe, activate keying set as “whole character” (optional?). Once you have your animation ready – make sure the action is selected in the dropdown list (doesnt hurt to select all the keyframes in the action editor window as well). On 3D view, in object mode, select the armature and then the mesh. Export (with the rig, the mesh and the animation selected).
Place the md5mesh and md5anim files together inside the folder structure you need for your FM (example: models\md5\nature or props, etc);
The md5mesh needs a material file (like any ase or lwo model) and a def file. The material can either be created specifically for the md5mesh and be set inside blender (as the material name) or you can edit the mesh shader manually (by opening the file in a text editor) and refer it to an existing material – find this line in the file and place the material name inside the quotes (you will need to do that for each mesh in your model):
The MD5 model will also need a def file, to be placed in a folder called def. The def file works like this:
// your model name, description and author (optional)
anim idle models/md5/yourfolder/yourmodelname.md5anim
entityDef atdm:yourmodelname //will define your entity name
"editor_displayFolder" "Animated Props" //or any folder you want to create in DR
"start_anim" "idle" //will start your anim "idle" automatically
This setup works for a "static" animated model, something like a bush moving with the wind, in a looped animation. The animated model, once placed inside your mission folder structure, will be available inside DR (remember to have your mission and TDM referenced in DR’s properties). To place it inside the map, you need to create it as an entity. This can be confusing, because the model (as a static model) is still available in the lists, but placing that in the map instead will result in an error and it wont show up at map start. I dont know exactly why that is.
Im not 100% sure about some of the steps, any improvements or mistakes in the guide, let me know.
Edited by RPGista, 29 June 2018 - 04:04 PM.