Getting Characters and their Anims into Doom

From The DarkMod Wiki
Revision as of 10:16, 12 September 2006 by Greebo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Originally written by oDDity on http://forums.thedarkmod.com/topic/1485

I was writing this for TYROT, o I thoiugh I may as well post it up here as well while I'm at it. I'll add the rest when I can be bothered.

So you want to know how to get md5meshs and anims into Doom?

This one I just had to work out for myself after many long hours of trial and error and pulling my hair out I got there. However, I'm only as far as getting the character ito doom, importing the animations, and cycling throiugh them in doom. You need to write AI scripts to actually get your character to behave like you want it to and play it's animaitons at the right time of course. I know nothing about that.

Anyway, to get it into doom, you save you character in Maya as a .mb file. It has been boned and weighted obviously, and the rig has to have a bone called origin at the 0,0,0 world origin, and the skeleton has this as the parent bone.

Then you have to write the definition file

First you need the defintion file to use doomEdit to change the .mb files to an md5mesh and an md5anim for each different animation you make.

The first section of the definition file deals with this exporting, here is a sample one:

export hammer {
options   -sourcedir models/mymodels/hammer
          -destdir models/md5/mycharacter/hammer

This first part is the source directory where you saved your .mb files, and the destination dir you want doomedit to write the md5 files to.

mesh hammer.mb
anim idle.mb -dest stand
anim stepback.mb -dest sight1
anim walkF.mb -dest walk1
anim attack1.mb -dest swing1
anim attack2.mb -dest swing2
anim attack1.mb  -dest swing3
anim attack2.mb  -dest swing4
anim attack1.mb -dest swing5
anim stepback.mb  -dest head_pain1
anim stepback.mb  -dest head_pain2
anim stepback.mb  -dest head_pain3
anim stepback.mb -dest chest_pain1
anim stepback.mb  -dest chest_pain2
anim stepback.mb  -dest leftarm_pain1
anim stepback.mb  -dest leftarm_pain2
anim stepback.mb  -dest rightarm_pain1
anim stepback.mb  -dest rightarm_pain2
anim attack1.mb   -dest spit_attack1
anim RunF.mb -dest fastwalk
}

This second part is what you want the md5 files to be called. The first line is your base mesh in the stance pose, and all the diffent animations you did are in the following lines. the '-dest' after them is used to change the name, so on the bottom line the .mb file 'runf' animation is saved as 'fastwalk.md5anim'

That's all you need in the definintion file to get it in the game. I'd call this definiton file 'hammer.def'

Then, in DoomEdit, go to the console and type

exportmodels hammer

and this should convert all the maya files to md5 files.

First of all though you need the correct environment variable set, pointing to the maya directory. Remember you had the same problem with getting Deep Exploration to read maya files?

Right click on 'my computer' icon on your desktop, or in start menu, right click 'poperties' whuch take you to the system tab, then go to advanced tab, environment variables, and open it up.

Add a varible called MAYA_LOCATION with the variable pointing to where you have maya installed (this depends on which maya version you have) for maya 6 you don't inlude 'bin' at the end and for maya 5.x you do, I have one of each just incase, maya should have written it;'s own variable where you installed it, but sometimes that one doesn't work.

Then you need to get the MayaImportx86.dll which is included in the SDK download and place it in the doom base directory and in you maya bin directory.

Until you follow those steps the exportmodels command will not work.

That's all we artists need to know really, the rest should be left to the AI programmers, but you can look in the model's definition files and check out what's in there.