KatsBits Community

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

keless · 228 · 262620

0 Members and 2 Guests are viewing this topic.

Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
OK, a fix came in via NB - cheers matey.
Download the fixed MD5 export script from the downloads page. Or open the script in a text editor and find line 848 or the below text;
Code: [Select]
WindowManager.add_fileselect(self)
Replace with;
Code: [Select]
WindowManager.fileselect_add(self)


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
OK, a fix came in via NB - cheers matey.
Download the fixed MD5 export script from the downloads page. Or open the script in a text editor and find line 848 or the below text;
Code: [Select]
WindowManager.add_fileselect(self)
Replace with;
Code: [Select]
WindowManager.fileselect_add(self)


Offline mikshaw

  • Newbie
    • Posts: 14
Blender 2.57 will be using Python 3.2, and will require another set of changes.

What I've gathered so far:
bl_addon_info is now bl_info
to_quat is now to_quaternion
3rd-party scripts are added to scripts/addons/ instead of scripts/io/
there is some difference in the register and unregister of addons

I've gotten Blender 2.57 to load the add-on into the menu, but there's no way I have the knowledge to make it work.




Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Oh not again! I knew they were going to do something like this when I saw that effing folder! I'm guessing this is going to be across the board right? ASE, MD3, MD5 (here) et-al? To be honest I think we're going to have to throw the scripts open to the community to fix up from here on in as the various authors have all gone MIA and I certainly don't know enough programming or scripting to know my donkey from my elbow. I really do wish Blender would find a formula and stick to it, changing things around each iteration doesn't help build a solid user-base. Sorry had to rant that one out there ;D

Oh, and... welcome by the way and thanks for posting the info lol!


Offline mikshaw

  • Newbie
    • Posts: 14
I've started reading up on Python, but I'm sure it will be a while before I'm able to do anything useful with it.
Lua I can do, to a point, and Python doesn't look to be terribly different, so hoping it will be relatively easy to pick up.

I should mention that when I started using the exporter for Blender 2.5, the resulting md5mesh was missing a line (// meshes: meshname) that is necessary for proper placement of textures in Sauerbraten.  So I changed line 130 to look like this:
buf=buf + "mesh {\n\t// meshes: " + submesh.name + "\n"


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
That change sounds like it's resulted from SB's content being exported originally using the older versions of the MD5 export scripts? I'd be reluctant to drop that into the general MD5 script and push those out if it is, it makes adoption by other parties problematic because of engine tech and code differences; over the years modders have taken the baseline files (from KatsBits), modified them, then served them up locally, which works well as a delivery system. Hmm that was a bit off topic!

GL learning Python


Offline mikshaw

  • Newbie
    • Posts: 14
I would say you're probably right about that. I don't know much about the guts of file formats or anything like that...I just poke at things if something doesn't look right to me, and hope to find or create solutions, even though they usually tend to be kludges.

 I'd already posted my change on the sauerbraten forum for anyone who might find it useful, so if it helps someone there, good.  If it doesn't mean anything to anyone but me, that's fine too.  It at least helped me not have to manually edit the file after every export.

Thanks for the GL =o)


Offline mikshaw

  • Newbie
    • Posts: 14
I think I might have actually fixed it...and I don't even Python! =o)
http://www.pasteall.org/20522/python

All the changed lines have been tagged with 'mikshaw'
and I commented out my Sauerbraten fix on 130.

This hasn't been thoroughly tested, particularly considering the conditionals that don't apply to my file might not work at all.  I just exported one animation and it works the same as the one from 2.56


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
I'll test this on a couple of characters I've got and see what results I get - will use der_tons MD5 viewer for playback as I don't have anything with MD5 capability loaded atm.

Do we know *for definite* if the internal changes made to 2.57 that's forcing these updates is going to remain in place upon public release? They've done this several time before where something has had to be adjusted only to find it doesn't work because they changed something back or around on final version release.


Offline mikshaw

  • Newbie
    • Posts: 14
Apparently I didn't need to break up that line at 737ish.  I got this at blenderartists:
Quote from: zeffii
the invert() function was modified, I'm a little dim on the precise reasons, but I think the early .invert() returned an inverted matrix, while the new .invert() modifies the parentposemat in place. now if you want to simply return an inverted matrix you do a .inverted()

So rather than separating the invert() function onto its own line, the original line can just be changed from invert() to inverted():
Code: [Select]
posebonemat = parentposemat.inverted() * posebonematThe result is, as far as I can tell, identical.


Offline mikshaw

  • Newbie
    • Posts: 14
Don't know *for definite*, but i just tested it in the RC2 that was released today, and it still works.

One of these days I plan to test Lee Salzman's IQM exporter too (works in 2.56, probably broken in 2.57), but since I'm sticking with MD5 for my current project I'm not sure when that will be.


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75

Offline mikshaw

  • Newbie
    • Posts: 14
Yes, that's what this last page of posts has been about.  The pasteall link above points to an edited version of the 2.56 script which seems to work, although it's still not thoroughly tested (and the "posebonemat" optimization mentioned a couple posts back hasn't been changed in the pasteall link).  I've been puttering around with other projects lately and haven't gotten back to Blender.


Offline Optimonkey

  • Newbie
    • Posts: 1
mikshaw - Thanks for fixing that!

I am new to blender and trying out 2.57 and couldn't get the script to run.

I took your script and installed it from the ..user preferences...add_ons and ... it Worked!!!!

I am primarily learning Blender to create some MD5s for my game - (coming from Modo and Zbrush neither of which have any Character animation.)

So this was a critical component I wanted to have working before investing significant time.

Thanks again for your work...

Now I am off to write some md5 loading code in my ios app  :-)



Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Thanks for double checking mikshaws edits work in 2.57b. I just double checked as well and it works fine. I'll add the updated version to the tools page and amend the first post. Cheers guys.

[EDIT]File is now available on the tools page and the Installation and Usage instructions have been updated.