Blender2md5 Exporter
December 24, 2007 at 12:44 am | In Coding, Game Projects |Tags: Blender MD5 Exporter Python
Update: I’ve (sadly) worked on it some more today and there’s a new version online. You can find it on icculus again:
http://svn.icculus.org/darkwar/trunk/base/scripts/
For the past 4 days I’ve been working on and off on some changes to der_ton’s blender2md5 exporter - big thanks to him for developing the exporter in the first place - and in doing so I’ve finally learnt Python, which is an awesome scripting language to say at least.
I haven’t really changed much of the exporter’s internal workings (only a few clean-ups here and there which hopefully didn’t break it) because I mainly concentrated on GUI changes. fleeky, a nice circus fellow who is DarkWar’s only active modeller at the moment, pestered me long enough to add support for exporting multiple animations from Blender to md5, that I finally gave in and started working.
Thank God, Python’s tutorial page is excellent, too - especially ‘Learn Python in 10 Minutes’, which really does a very good job at showing you many language features very fast - which arguably isn’t useful for total newbies but it gives a nice overview and invites you to play around.. and is really helpful when you start to code because you already know about some “advanced” language features early-on and can look them up when you think that they might help you solve a problem more elegantly (in contrast to not knowing about the features at all).
Another tip for Python beginners: get ActivePython and Komodo Edit (or even the IDE if you have the money and/or are a student and willing to go through their registration process, which I might if I’ll happen to work more with Python). Both are free and will get you started with Python coding quickly. They really helped me a lot while learning and coding the new features.
Anyway, so what did I code? First let’s take a look at the original exporter interface:
My first changes were about adding a simple batch system that allows you to set the properties for one animation and mesh to export and then specify a batch file and append them to it. Then you can export all “jobs” from the specified batch file or directly specify it and export from it:

This was ok but it didn’t feel that nice - since you’d have to manually edit the batch file if you wanted to change export properties, etc.
Today then I’ve decided to spend one last day on the project and rewrite most of the GUI:
it now displays all default buttons at the bottom and allows one to insert as many animations to export as one wishes. It displays the animations each with their own target filename, start and end frame and action dropdown menu in a table and now also exports all other settings to settings files (batch files don’t really describe it correctly).
Even better I’ve added support for automatically saving the settings to Blender’s .blend files which should really help automate exporting a lot.
Just open the scene file, open the plugin, hit export and you’re done!
Right now I have disabled (commented out) exporting camera animations because they don’t really fit anymore, but if there’s a need for them, I’ll put them back in).
And finally, here’s the new interface:
Give a try. You can find the python script in Darkwar’s repository: http://svn.icculus.org/darkwar/trunk/base/scripts/
Mirror for now: http://home.in.tum.de/~kirschan/blender2md5.py (out-dated but I’m leaving it in case icculus.org is down again and someone badly needs a mostly working exporter)
Either copy it into your Blender plugin directory or manually open it in Blender’s text editor and run it with Alt/Meta-P.
Enjoy and Merry Christmas!
6 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

hi Black,
Another thing besides what I mentioned in #dp is that it either doesn’t save settings or doesn’t want to load them :/
Comment by motorsep — June 1, 2008 #
hey um it says md5meshfile: then browse. does that mean you look for a blende file.
please help me out
Comment by kyle — June 11, 2008 #
The md5mesh editbox lets you specify the name of the md5mesh file that should be written and the “Browse..” button provides you with a dialog box similar to the “Save As..” dialog box you should be used to from normal Windows apps.
Hope that helps >_>
Cheers
Comment by BlackHC — June 12, 2008 #
hey blackhc. i hope you get this. um. is there a way you could send me an image or a video. lol. sry i dont understand. what do i type exactly in the box. and what do i exactly browse for.
please please please help me out.
Comment by kyle — June 12, 2008 #
hey blackhc. r u there?
Comment by kyle — June 14, 2008 #
I don’t have that much time now during the uni term and I don’t really think that a video is necessary.
You should maybe get comfortable with Blender and exporters in general first because imho the use is very straight-forward and already this picture from the article above http://blackhc.files.wordpress.com/2007/12/blender2md5_new.jpg
should answer your question.
If not, you can still try everything on your own because there is only a finite number of combinations for the lower part and the remaining infinite number of combinations all lie in a few equivalence classes - this is math talk for: it’s not *that* difficult!
Cheers
Comment by BlackHC — June 14, 2008 #