News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Blender io_export_md5 (new)

Started by kordex, December 27, 2015, 07:15:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

motorsep

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.

bitterman

motorsep

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

I downloaded these scripts and Blender 2.76.

motorsep

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.

bitterman

#18
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?

Arl

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:



Example: "walk_start" at the beginning of the animation, and "walk_end" at the end of the animation.

kordex

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

motorsep

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.

motorsep

@Arl @bitterman: Markers on the local time line  (for each Action), not the global one. Naming doesn't matter.

bitterman

#23
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 ))

motorsep

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.

bitterman

#25
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?

motorsep

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).

The Happy Friar

I always just imported a model & made sure mine was facing the same way.  :)

It is very annoying though. 

bitterman


kat

#29
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).