id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Models and Animations => Topic started by: kordex on December 27, 2015, 07:15:02 AM

Title: Blender io_export_md5 (new)
Post by: kordex on December 27, 2015, 07:15:02 AM
There is now new MD5 exporter for Blender. I created it for OpenTechEngine project, but it can be useful for any MD5 Version 10 models .

Please try it out, it should work more nicely than the old io_export_md5.

In case of problems please use the github issues (https://github.com/OpenTechEngine/ModelingTools/issues)

Usage is pretty much the same as with all exporters, except this one does not care about selections or any of that kind things. It will export everything exportable to chosen directory. Name generation is besed on armature naming, this is due to topology of blender objects.

Please find io_export_md5 on:
GitHub (https://github.com/OpenTechEngine/ModelingTools/tree/master/MD5/Blender/io_export_md5)

OpenTechEngine has it's own Discussions repository (https://github.com/OpenTechEngine/Discussions/issues) which can be used for requesting guidance

Comments and appreciations welcome! It's first release and I want to find out the bugs I baked there.
-kordex
Title: Re: Blender io_export_md5_obj (new)
Post by: The Happy Friar on December 27, 2015, 07:22:40 AM
Cool.  What version of Blender?
Title: Re: Blender io_export_md5_obj (new)
Post by: trebor on December 27, 2015, 08:20:24 AM
Nice
Title: Re: Blender io_export_md5_obj (new)
Post by: kordex on December 27, 2015, 08:26:33 AM
Quote from: The Happy Friar on December 27, 2015, 07:22:40 AM
Cool.  What version of Blender?

I think it should work for 2.6.3 like the original one. I have tested it on Blender 2.75 (sub 0)
Title: Re: Blender io_export_md5 (new)
Post by: TeaMonster on February 17, 2016, 06:41:02 PM
Hey, are there any particular things that are needed to use the exporter? The Arx team made one and it was very picky about what bones and what type of rig you could use.
Title: Re: Blender io_export_md5 (new)
Post by: The Happy Friar on February 17, 2016, 09:05:45 PM
md5 needs an "origin" bone & everything must be under that somehow.  Does the arx team exporter need something different?  (the derton & xreal engine exporters never gave me an issue).
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on February 17, 2016, 09:42:50 PM
Quote from: The Happy Friar on February 17, 2016, 09:05:45 PM
md5 needs an "origin" bone & everything must be under that somehow.  Does the arx team exporter need something different?  (the derton & xreal engine exporters never gave me an issue).

That is the only way Doom 3 / BFG will ever load models. If there are several roots, or root bone isn't call "origin", it won't load.
Title: Re: Blender io_export_md5 (new)
Post by: kordex on February 18, 2016, 12:01:22 PM
Quote from: TeaMonster on February 17, 2016, 06:41:02 PM
Hey, are there any particular things that are needed to use the exporter? The Arx team made one and it was very picky about what bones and what type of rig you could use.

The exporter should be very informative if you have something that doesn't comply. Feel free to create an issue if something doesn't work.

About the root-bone, the exporter doesn't really care about the name, as long as there is a bone without a parent it will be used as a root. However if you would be to create a loop with the bone parenting .. I don't really know, if blender even allows one but that should leave the object without armature at all and you'd have an error about armature.

I will try that out some time.
Title: Re: Blender io_export_md5 (new)
Post by: TeaMonster on February 23, 2016, 02:47:41 AM
Dosen't work on 2.76b. Even tried manually loading the plugin and it won't see it.

Secondly, it keeps telling me that there are over 1000 vertices with zero weights on them. I'm thinking that if that was the case, then I'd notice.
Title: Re: Blender io_export_md5 (new)
Post by: kordex on March 02, 2016, 08:12:30 AM
Quote from: TeaMonster on February 23, 2016, 02:47:41 AM
Dosen't work on 2.76b. Even tried manually loading the plugin and it won't see it.

Secondly, it keeps telling me that there are over 1000 vertices with zero weights on them. I'm thinking that if that was the case, then I'd notice.

Hello TeaMonster,

https://github.com/OpenTechEngine/ModelingTools/issues/5

Weight problems indicate that you have not parented the vertices to bones.
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on March 03, 2016, 09:38:30 AM
Quote from: TeaMonster on February 23, 2016, 02:47:41 AM
Dosen't work on 2.76b. Even tried manually loading the plugin and it won't see it.

Secondly, it keeps telling me that there are over 1000 vertices with zero weights on them. I'm thinking that if that was the case, then I'd notice.

Try mine: https://github.com/motorsep/blender-idtech4-md5

I still need to add a tutorial, since it requires a few setup steps to export properly.

The gist of it is that you have to have 1 root and call it "origin", each animation has to be in a separate Action, use local markers on each Action to define length of animation, when you are done with your rig, select all bones in Pose mode and initialize the add-on by clicking Init button in the Properties tab (you can select any bone after that and use checkbox to mark it as exportable or not exportable bone; there is also an option for re-parenting bones on export, like original Doom 3 Maya plugin did).

Being in the Pose mode, select all meshes attached to the armature, and then select any bone in the armature (meshes have to be selected first, bone - last). Go to Export menu and choose MD5 format. UI is pretty self explanatory.

I really should make a video as when you see it, it won't look as complicated as it might sound :)

Note that your deforming rig and your meshes you are going to export have to be on the same layer in Blender. Bones can be scattered on any layer in bone layers.
Title: Re: Blender io_export_md5 (new)
Post by: kordex on March 03, 2016, 02:21:40 PM
Quote from: motorsep on March 03, 2016, 09:38:30 AM
Quote from: TeaMonster on February 23, 2016, 02:47:41 AM
Dosen't work on 2.76b. Even tried manually loading the plugin and it won't see it.

Secondly, it keeps telling me that there are over 1000 vertices with zero weights on them. I'm thinking that if that was the case, then I'd notice.

Try mine: https://github.com/motorsep/blender-idtech4-md5

I still need to add a tutorial, since it requires a few setup steps to export properly.

The gist of it is that you have to have 1 root and call it "origin", each animation has to be in a separate Action, use local markers on each Action to define length of animation, when you are done with your rig, select all bones in Pose mode and initialize the add-on by clicking Init button in the Properties tab (you can select any bone after that and use checkbox to mark it as exportable or not exportable bone; there is also an option for re-parenting bones on export, like original Doom 3 Maya plugin did).

Being in the Pose mode, select all meshes attached to the armature, and then select any bone in the armature (meshes have to be selected first, bone - last). Go to Export menu and choose MD5 format. UI is pretty self explanatory.

I really should make a video as when you see it, it won't look as complicated as it might sound :)

Note that your deforming rig and your meshes you are going to export have to be on the same layer in Blender. Bones can be scattered on any layer in bone layers.

Well to be straight, OpenTechEngine version should be the one to use in means of compliance to blender standards and I intend to fix any issues users might have so please don't promote that hacked version. It's a hack and if you don't admit that better to forget it all. False information is killing the community even further.

I can tell that there is https://sourceforge.net/p/blenderbitsbobs/wiki/MD5%20exporter/  from Arx: End of Sun which is more feature rich, in means of importing, than my version but still lacks straight design. So one might want to try that out too, if it works any better please tell and let's see what there is to improve in OpenTechEngine version.

It's just matter of fact that exporting should not be anything fancy or creditable and the version I wrote is modular and extendable for all of the use cases there might be in blender.



Title: Re: Blender io_export_md5 (new)
Post by: motorsep on March 03, 2016, 03:58:34 PM
I don't care for your OpenTech whatever. Your stuff doesn't work, mine works flawlessly, and feature rich. Also doesn't impose any restrictions that other versions do. So, let end-user decide what they want to use.

I used Arx's exporter. The workflow _sucks_ ^10. That's why this exporter was resurrected and improved.

I've worked on my exporter hands on a bit and with devs who helped me shape it. So yeah, it's creditable to me and people who helped making it happen.
Title: Re: Blender io_export_md5 (new)
Post by: bitterman on March 04, 2016, 12:09:23 AM
motorsep How about bounding box (blue lines) around exported model?

Some time ago I had some issue with it.

http://www.katsbits.com/smforum/index.php?topic=167.msg4091#msg4091
Title: Re: Blender io_export_md5 (new)
Post by: kordex on March 04, 2016, 02:10:37 AM
Quote from: bitterman on March 04, 2016, 12:09:23 AM
motorsep How about bounding box (blue lines) around exported model?

Some time ago I had some issue with it.

http://www.katsbits.com/smforum/index.php?topic=167.msg4091#msg4091

Those have been fixed in the OpenTech version too so that's why I think it's important to get it working for everyone.
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on March 04, 2016, 07:39:36 AM
Quote from: bitterman on March 04, 2016, 12:09:23 AM
motorsep How about bounding box (blue lines) around exported model?

Some time ago I had some issue with it.

http://www.katsbits.com/smforum/index.php?topic=167.msg4091#msg4091

Why don't you try it and see if it works for you? I never had any issues with md5s exported with my addon.
Title: Re: Blender io_export_md5 (new)
Post by: bitterman on May 08, 2016, 10:35:01 AM
motorsep

How to use md5, camera and ASE exporters from your github repository?

I downloaded these scripts and Blender 2.76.
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on May 08, 2016, 09:33:46 PM
MD5Cam is a bit complex, I need to make a sample .blend file

ASE is easy - add Triangulate modifier to the model(s), make sure model(s) has UV map and default material with material's name exactly how it will be in the .mtr file (e.g. my/awesome/material in .mtr and exactly like that in the material's name in Blender). Vertex color is optional. Select objects to be exported, Export > idTech 4 ASE (I forgot the exact name), tweak settings and export. ASE output is usable right out of the box - no need to manually edit model file.

MD5Model/Anim is a bit more complex. Make sure you have a mesh (or several meshes) weighted to an Armature. Mesh needs to have UV map and material (same as ASE). At least one Action should be created, with local markers marking beginning and end of the Action. Select Armature in Object mode and click Init button in the Properties panel to initialize exporter. All bones with weight/vertex groups will be automatically included to the "list". If you need to export non-deformation bones, or any bones that don't have vertex groups (bones for attachments or effects, etc.) you need to select those manually in Pose mode and tick box Export.

Once that is done, go into Object mode, then select all meshes that belong to the Armature, then select Armature (must be selected last!), Export > idtech 4 MD5 something > Type in model name, select Actions to be exported, check some extra options if necessary, export. It will save md5model and md5anim, which can be used out of the box (that's if you rigged and weighted your model correctly).

Nothing should be in any specific layers, however, layers with exported items should be visible at the time of export (e.g. if you have mesh1 in layer1, mesh2 in layer2 and Armature in layer3, all 3 layers must be visible).

Note that for proper rigging and animation character needs to face -Y or +Y in Blender, but it has to face +X when exporting to Doom 3. It's a royal pita, but you can add an Empty, and use one of the constraints (forgot which one I used :? ) to "parent" armature to the Empty. This way you can animate in Blender with character facing -Y or +Y, and when you are ready, you can rotate Empty around Z axis to make character face +X, export it, test it in Doom 3, come back to Blender and turn character (again using Empty) to face -Y/+Y, rinse/repeat.
Title: Re: Blender io_export_md5 (new)
Post by: bitterman on May 09, 2016, 12:50:57 AM
Thanx. About empty - it's great.

Some add:


1. Extract .zip to folder.
2. Run Blender, choose File->User preference->Import-Export->Install from File.
3. Choose and check export script, Save User Settings.
4. Restart Blender.

Appropriate script must be available in File->Export.

Upd:
Quotelocal markers marking beginning and end of the Action

What do you mean? Some special sintax?
Title: Re: Blender io_export_md5 (new)
Post by: Arl on May 09, 2016, 02:14:26 AM
Quote from: bitterman on May 09, 2016, 12:50:57 AM
Quotelocal markers marking beginning and end of the Action

What do you mean? Some special sintax?

I think he means markers in the timeline, as such:

(http://i.imgur.com/jcsChgM.png)

Example: "walk_start" at the beginning of the animation, and "walk_end" at the end of the animation.
Title: Re: Blender io_export_md5 (new)
Post by: kordex on May 09, 2016, 05:51:02 AM
Quote from: motorsep on May 08, 2016, 09:33:46 PM
Note that for proper rigging and animation character needs to face -Y or +Y in Blender, but it has to face +X when exporting to Doom 3. It's a royal pita, but you can add an Empty, and use one of the constraints (forgot which one I used :? ) to "parent" armature to the Empty. This way you can animate in Blender with character facing -Y or +Y, and when you are ready, you can rotate Empty around Z axis to make character face +X, export it, test it in Doom 3, come back to Blender and turn character (again using Empty) to face -Y/+Y, rinse/repeat.

If this is valid for the exporter in the repo, I would like to fix it as it's nothing fancy to do
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on May 09, 2016, 08:17:45 AM
Quote from: kordex on May 09, 2016, 05:51:02 AM
If this is valid for the exporter in the repo, I would like to fix it as it's nothing fancy to do

If you are talking about your OpenTech exporter, I don't really know what state it's in.

As for mine, it doesn't need to be an option for exporter as it's move flexible to use scene setup instead of an option in the exporter's UI.
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on May 09, 2016, 08:20:33 AM
@Arl @bitterman: Markers on the local time line  (for each Action), not the global one. Naming doesn't matter.
Title: Re: Blender io_export_md5 (new)
Post by: bitterman on May 09, 2016, 09:39:40 AM
Thanks.

May l clear: if I anim in Blender along X - is there no need to manipulate with empty, rotation and others?

Arl btw nice legs ))
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on May 09, 2016, 10:11:18 AM
Quote from: bitterman on May 09, 2016, 09:39:40 AM
May l clear: if I anim in Blender along X - is there no need to manipulate with empty, rotation and others?

It's not about animating along X or any other axis (if your character is looking +X, but doing side step - you are animating along Y). It's about +X being "forward" for Doom 3 (and any engine pretty much) and Blender's "forward" is -Y. Animation tools (symmetry pose, etc.) in Blender only work when your character has -Y as "forward" (looking down that direction).

I animated characters looking down +X (to avoid messing with rotating it) and it was a horrible mess. Poses can not be copied and mirrored, which creates more work for walk/run/etc. cycles where poses need to be mirrored. It can be done, but it's not worth the effort.
Title: Re: Blender io_export_md5 (new)
Post by: bitterman on May 09, 2016, 10:17:12 PM
May I clarify again:

In engine space: if bone moves along +X - it's means bone moves forward.

In Blender space: if bone moves along +X - it's means bone moves sideways.

Otherwords, in engine eyes look forward along X, in Blender - along Y, right?

I remember something to do with OpenGL orientation, but don't remember what exactly :(

Btw what anim tools do you mean? SHIFT+CTRL+V?
Or some add-ons?
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on May 10, 2016, 09:09:22 AM
I doesn't matter how individual bones move. It's the whole object facing certain axis on export. I think you are getting caught up in minor details on everything related to this engine :/

By anim tools I mean animation tools Blender provides (Blender's animation capacity).
Title: Re: Blender io_export_md5 (new)
Post by: The Happy Friar on May 10, 2016, 10:50:33 AM
I always just imported a model & made sure mine was facing the same way.  :)

It is very annoying though. 
Title: Re: Blender io_export_md5 (new)
Post by: bitterman on May 10, 2016, 11:39:06 AM
Ok, thanks.
Title: Re: Blender io_export_md5 (new)
Post by: kat on September 15, 2016, 11:16:18 AM
What's the status on this exporter? Just trying to get something to export in 2.77a and whilst mesh and anim export, the objects UV's are all over the place and nothing I've tried has fixed it (deleted, rebuilt, flipped, split etc.). There is still interest in a simpler export script like this BTW even though there are a number of other more complex ones available (the only thing it could do with is selectable export rather than exporting the contents of the Scene, other than that, there is demand/interest in it).
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on September 15, 2016, 12:24:27 PM
@kat

long time no see! :)

Which exporter did you use, mine or some other one ?
Title: Re: Blender io_export_md5 (new)
Post by: kordex on September 15, 2016, 12:42:46 PM
Quote from: kat on September 15, 2016, 11:16:18 AM
What's the status on this exporter? Just trying to get something to export in 2.77a and whilst mesh and anim export, the objects UV's are all over the place and nothing I've tried has fixed it (deleted, rebuilt, flipped, split etc.). There is still interest in a simpler export script like this BTW even though there are a number of other more complex ones available (the only thing it could do with is selectable export rather than exporting the contents of the Scene, other than that, there is demand/interest in it).

I think the rotation of the UV is off, could you screenshot it with better resolution and let's say black and white vertical stripes in white 50px black 50px pattern? That would help me to solve it.

This is because the exporter has re-designed mesh weight calculation that gives better results, but seems that I need to see into the alignment of the faces when doing it.
Title: Re: Blender io_export_md5 (new)
Post by: kat on September 15, 2016, 12:54:14 PM
@kordex: See attached (the UV are shifted to one side to reveal the underlying texture in the B/W shot).

@motosep: just using the script kordex posted in OP (suits what I'm doing).
Title: Re: Blender io_export_md5 (new)
Post by: motorsep on September 15, 2016, 12:59:33 PM
Quote from: kat on September 15, 2016, 12:54:14 PM
@motosep: just using the script kordex posted in OP (suits what I'm doing).

You could use mine - it's better :)
Title: Re: Blender io_export_md5 (new)
Post by: kat on September 15, 2016, 01:06:13 PM
Yes I saw that... lol  ;D
Title: Re: Blender io_export_md5 (new)
Post by: kat on September 15, 2016, 02:22:22 PM
@kordex: if it helps I can send the mesh/blend file. Just ping me on info[at]katsbits[dot]com