KatsBits Community

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

keless · 228 · 262543

0 Members and 3 Guests are viewing this topic.

Offline dersaidin

  • Newbie
    • Posts: 10
Hello.

I made a few improvements to mikshaw's version to make the script easier to use when exporting static models.

If there is no armature, it will make a fake bone and automatically change from "mesh & anim" to "mesh only" mode. Also fixed the scale global, and the script smarter with adding the file extension.

I took the liberty of restoring the GPL license present in der_ton's original, as this is clearly based on it. Would be best to have other authors affirm this.

This version has bumped the "blender" to (2, 5, 7) and "api" to 35622. This works (for me at least) on 2.57b. If you want earlier versions (ie 2.57) you may need to reduce those numbers back to what mikshaw had.

http://www.dersaidin.net/other/io_export_md5_2011-05-08.zip


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
I can kind of understand the changes but why not just make a mesh with a single root bone from the get-go and export that using the 'standard' script? I'm assuming the 'fake' bone is written into the file, so you're still actually exporting a rigged mesh (albeit very simple rig)?. Is there a particular reason for the changes (other than using a single format for both static and animated models)? Will take a look nontheless  ;)


Offline dersaidin

  • Newbie
    • Posts: 10
I can kind of understand the changes but why not just make a mesh with a single root bone from the get-go and export that using the 'standard' script? I'm assuming the 'fake' bone is written into the file, so you're still actually exporting a rigged mesh (albeit very simple rig)?. Is there a particular reason for the changes (other than using a single format for both static and animated models)? Will take a look nontheless  ;)

If your making a static model, you NEED to have a bone. Thats part of the md5mesh format. Your already using a single format for static and animated meshes.

For users who don't care about bones and animation, its extra effort to work out how to add the bone, and bind the mesh to it - especially when unfamiliar with blender. The thing that makes it really annoying, is that this bone isn't special - it needs no extra information to add (you don't need to know what coordinates to put it at, {0,0,0} is fine). Theres no reason to make the user do this manually when the script can take care of it.

This makes it easier to use for users that don't know blender. Usability is very important.

When I say 'fake' bone ('dummy' if you prefer), this bone is never at any point part of the blender model. The mesh your exporting always has no armature. Its not needed, the script will deal with it. This is why it is simpler for users to do the export.

Model with no armature goes into the md5 export script.
Script then checks theres no armature, adds a 'fake' or 'dummy' bone to the data to be exported and points vertices to that bone.
The md5 export script does an export at usual, which will include the 'fake' bone, and exporting the mesh.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Oh I understand all that yes.. my question was why use an *animated* format to export *static* models when other formats are more suited - ASE, OBJ etc?


Offline dersaidin

  • Newbie
    • Posts: 10
Sorry, I was meaning a different level of static.

For static (compiled into bsp), yes theres ase, we use that. Obj isn't supported by the engine (XreaL).

For dynamically added models, which aren't animated - i.e. static mesh - such as shell casings, or items lying around. XreaL prefers md5mesh.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Ah right, I understand what you're doing. I'll take a look at the script as soon as pos...


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
Blender 2.59 is out. Has anyone tested ASE exporter with it and can confirm the script is working with 2.59 ? Thanks.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Not yet. I loaded up 2.59 the other day but have only had time to check the .map exporter so far.

[EDIT]MD5 exporter needs a minor edit so I'll upload an update later. It seems to be exporting OK (I only tested it quickly exporting a single mesh and animation for my bunneh character).


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
Finally got to the point where I need to export to MD5 from Blender 2.59. And the export doesn't work :(

Here is what I am getting: http://www.kot-in-action.com/files/blend2MD5_error.png

Any chance to fix that error rather sooner? Thank you.


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75

Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Sorry about that. The main link on the Tools page was still pointing at the 'old' version of the script. Fixed it now. The zip should be called "io_export_md5-259.zip". With so much going on when Blender updates it too easy to loose track of what I'm doing and/or have done when uploading updates :-\


Offline ge5

  • Newbie
    • Posts: 3
here is the error message i am getting after installing the 2.59 md5 exporter:
"location<unknown location>:-1
AttributeERROR:  'int' object has no attribute 'animation _data'
   arm action=thearmature.animation_data.action
File"/Users/ge5/Library/Application Support/Blender/2.59/scripts/addons/io_export_md5.py", line 713, in save_md5 save_md5(settings)
File"/Users/ge5/Library/Application Support/Blender/2.59/scripts/addons/io_export_md5.py", line849, in executeTraceback(most recent last call);"

I followed all the decribed steps/and this is starnge because my animation is threre on stage and in the action editor--any help?pointers? i am new to this, though have been exporting blender models as .dae (2.49 and before!) and .js files...thanks.
//////////
to kat + motorsep: Thanks for your tips/got this to work. now the action script stuff!...


Offline motorsep

  • Jr. Member
  • *
    • Posts: 75
Did you make an Action set for your Armature with animations keys set to LocRot?


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
In addition to moterseps comment, check the location of the script, in 2.59 they changed where the AddOns folder is, it's not a "User" file but dropped directly into the installation folder, e.g. (will be slightly different for you obviously)
Code: [Select]
D:\[path]\Blender Foundation\Blender 2.59\2.59\scripts\addons
@ge5: I moved your question by the way, it keeps all the troubleshooting stuff in one place, makes it easier to track.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
AddOn seems to work OK in Blender 2.60, I've only done a quick export test though but the mesh and animation exported without any issues (so far as I can tell using the MD5 model viewer).

NOTE: the script was loaded via User Preferences which created a scripts/addon folder in the main Windows "User" profile, it seems custom scripts are placed there (need to be?) rather than in with the defaults located in the installation directory.