KatsBits Community

[MD5] EXPORT script for Blender 2.6x (OPEN)

keless · 228 · 347703

0 Members and 2 Guests are viewing this topic.

Offline majki

  • Defunct
  • Newbie
    • Posts: 3
Okay, I hope there are still here ppl reading this.


I installed script in Blender 2.69. Created simple plane, UV mapped it and assigned 1 texture to it. What I want it to export it as MD5 and load into idtech4 with DarkRadiant as level editor to be level geometry.

During export, I checked only "mesh" box and I got this error:



What Am I doing wrong?

My aim is - build level for idtech4 made not with brushes, but with models created in Blender.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 3139
    • KatsBits
You need to have a basic rig and associated animation available for the script to produce a proper (usable) MD5, even on simple meshes. Regards building the level from models, you may need to make extensive use of portals and may need to caulk hull the level to prevent leaks. Aside from that it should be OK.


Offline majki

  • Defunct
  • Newbie
    • Posts: 3
So I can't just export ie building? I have to add rigs? I'm not into animation in Blender - are there simple few steps I should follow? Just for idtech4 needs?


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 3139
    • KatsBits
It's not really a question of not being into animation, rather making content that caters to a specific purpose or function. You can facilitate certain types of 'events' using static meshes, say a light fixture that changes colour, those are typically ASE, OBJ or LWO meshes and just a simple show/hide script triggered event.

On the other hand if you wanted a structure to perform more complex operations you might then need to use MD5 or 'dynamic' content - with or without an animation; this might mean the skeleton acting as a basis upon which 'ragdoll' responses to player intiated events ir based - lamps  hanging from the ceiling which move when shot are MD5, the skeleton allows for that type of movement where only a single frame 'idle' animation might be needed.

For a building then, a static or 'world' object, that does nothing, it's best to use the aforementioned ASE, LWO or OBJ.


Offline majki

  • Defunct
  • Newbie
    • Posts: 3
Hm... So for pure level editing - md5 is not needed? That makes things easier.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 3139
    • KatsBits
Much of a level can be built using static mesh objects yes, MD5 are usually used for event triggered actions - a chandelier reacting to the player firing an arrow at it for example.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 3139
    • KatsBits
MD5 script has been tested with 2.70 and appears to work.

As always make sure to test per requirements before making any changes to your respective development environments. See first post for download.


Offline Blayne Bradley

  • Newbie
    • Posts: 13
I tried using the script for both blender 2.69 and 2.71 and get the same error:



None of the assimp opengl tutorials I know of use anything other than md5 for some weird reason..


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 3139
    • KatsBits
The text is too small in the image to read.. Can you type what it's telling you?


Offline Blayne Bradley

  • Newbie
    • Posts: 13
The text is too small in the image to read.. Can you type what it's telling you?

If you copy the url and load it the text is clearer:

File ".....\io_export_md5-263.py" line 904, in execute save_md5(settings)
File ".....\io_export_md5-263.py" line 826, in save_md5 buffer = skeleton.to_md5mesh(len(meshes[0].submeshes))

IndexsError: List index out of range
Location: <unknown location>:-1

I have a mesh, I have a bunch of bones, an animation, IK bones, and some bones for determining the angle of the arms/legs (where they point).

Although the skeleton follows This rigging tutorial so there might not be a super clear parent-child relationship from a root bone to all the other bones, is that an issue?

Here's my blend file


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 3139
    • KatsBits
Looks like it could be the mesh objects (Shapes) you're using as part of the rigging - MD5 rigs generally can't contain non-bone objects, which includes meshes and empties. Disable/remove those then try again. Basically you should only be exporting the character mesh and the Armature composed of bones. So long as you have the Armature modifier and other bits set up you should then be able to export without issue.

To answer you other point about assimp using MD5, it's because its a purely text based format, making it super useful for teaching game development - everything is easily readable/accessible.


Offline Blayne Bradley

  • Newbie
    • Posts: 13
Looks like it could be the mesh objects (Shapes) you're using as part of the rigging - MD5 rigs generally can't contain non-bone objects, which includes meshes and empties. Disable/remove those then try again. Basically you should only be exporting the character mesh and the Armature composed of bones. So long as you have the Armature modifier and other bits set up you should then be able to export without issue.

To answer you other point about assimp using MD5, it's because its a purely text based format, making it super useful for teaching game development - everything is easily readable/accessible.

What do you mean by Armature modifier, can you explain what settings I should have?

The only options I see are: MD5 Name, Exports: Mesh & Animation/Mesh/Animation and Scale.

Also if I have different things selected, I get different errors, what am I supposed to have selected?

Removing the custom shapes for the bones presents me the following:

The same error as before with the bones selected in rest position and in pose position.

With just the mesh selected:

line 647, in save_md5 material = Material(obj.data.materials[0].name ) # call the shader name by the material's name

IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

location: <unknown location>:-1

Do you have a tutorial as to how my settings should look like? Beyond making a mesh and a simple animation I have no idea what I'm doing.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 3139
    • KatsBits
Based on what you've said there it pretty much looks like you're not properly prepping for export. Read through this, How to export MD5 (it's linked in the first post of this topic incidentally), it's a more detailed, but generic overview, of what you should be doing - single mesh, single armature with bones only, an animation action selected, etc.


Offline Blayne Bradley

  • Newbie
    • Posts: 13
Based on what you've said there it pretty much looks like you're not properly prepping for export. Read through this, How to export MD5 (it's linked in the first post of this topic incidentally), it's a more detailed, but generic overview, of what you should be doing - single mesh, single armature with bones only, an animation action selected, etc.

The very first step is causing me issues, I try to unparent the mesh and it detatches the bones from my mesh, so the animation breaks, the mesh is parented to the bones so I'm not sure how to proceed..


Offline Blayne Bradley

  • Newbie
    • Posts: 13
New error trying some of the steps in the provided link:

line 760, in save_md5 arm_axction = thearmature.animation_data.action
AttributeError: 'int' object has no attribute 'animation_data'

location: <unknown location>:-1

Can you help me by looking at my .blend file for what I need to do? Many of the provided instructions are along the lines of "Make sure x,y,z is correct." and I have no idea as to whether they are or aren't. All I know is, my animation works as is.

I did the steps under "Exporting Animations" and that was where the above error came from.

Additionally, I don't think this version of my scene has any materials or textures, I'll assume its required to have one and see if I can add a simple texture.