Quake (MD2, MD3 and MD5) to Ogre Mesh Converter (v2.1)

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
Devil N
Greenskin
Posts: 123
Joined: Sun Jun 26, 2005 4:32 pm
Location: Groningen, The Netherlands

Quake (MD2, MD3 and MD5) to Ogre Mesh Converter (v2.1)

Post by Devil N »

Updated to version 2.1!

This is something that has been asked for in the past, but has never actually been made as far as I know. I decided not to ask, but to simply make it myself. So, I present to you the Quake to Ogre Mesh Converter. It can take a 3D model in MD2, MD3 or MD5 format and convert it to an equivalent Ogre mesh, including (a selection of) the original model's animations.

You can download the latest release package (source and Windows binary) from here:

https://bitbucket-archive.softwareherit ... 20v2.1.zip

Source code is available through Mercurial on Bitbucket:

https://bitbucket-archive.softwareherit ... oogre.html

The code has been developed on Windows XP/7 and Ubuntu, but it should compile on pretty much any platform that has a C++ compiler.

Some images to show what it can do:

Quake 2's Male model doing a Run animation and casting a nice stencil shadow:
Image

The legs of Quake 3's Visor receiving some shadow from the stock Ogre head:
Image

Quake 3's CTF flag:
Image

Various MD5 models:

Theoretically, the program could be expanded to allow conversions of complete Quake 3 player models (legs, torso and head) to a single mesh with the tag structure converted to a skeleton. It's a pretty complicated conversion though and not very useful in general, so it is unlikely that such a feature will ever be added.

The source code is available on Bitbucket and licensed under the MIT license, so feel free to copy, use, fork, branch and modify it anyway you want. Patch submissions are always appreciated and will be considered for inclusion.

Changelog

Changes for v2.1:

  • Moved the QuakeToOgre project to Bitbucket.

  • Inclusion of normals in morph animation keyframes is now an optional feature, controllable through the <includenormals> XML tag.

  • Small modifications to the layout of the mesh output files to ensure full compliance with Ogre's XML mesh document type definition (DTD).

  • A DTD declaration header is now automatically added at the start of each mesh and skeleton XML file.

  • Reorganized some files and made new DTD validation scripts for both Linux and Windows.

  • Updated the Visual Studio project files to VS .NET 2008.

Changes for v2.0.1:

  • Added a missing header include that broke compilation with gcc.

Changes for v2.0:

  • Support for MD5 models (id Tech 4 games), including conversion of skeletal animations.

  • MD5 models can be manipulated in a number of ways before conversion:

    • Submeshes can be given a name, making it easier to refer to them in Ogre.

    • Animations can be resampled to a different framerate. ('changefps' option)

    • The maximum number of bone weights per vertex can be adjusted. ('maxweights' option)

    • Root bone can be locked in place, which prevents an animated model from moving outside its bounding box. ('lockroot' option)

    • Mesh and base skeleton can be transformed so that a specific bone falls on the mesh's local origin, making it easier in Ogre to link bones of two separate models together. ('moveorigin' option)

  • Configuration XML specification has been overhauled, allowing for shorter and simpler configuration files.

  • Better documentation of both the configuration XML spec and the example configuration files.

  • Added MIT license headers to all original source files, in addition to the LICENSE file.

  • Lots of cleaning up and refactorings throughout the code.

Changes for v1.1:

  • Conversion will now output normals for each morph animation keyframe. OgreXMLConverter will ignore this by default, but if somebody decides to modify Ogre to support interpolation of normals for morph animation, then the normals will already be available to use.

  • Working directory is now changed to the config file's local directory before processing. Dragging and dropping config files onto the EXE should now work.

  • Updated Visual Studio project file to VS .NET 2005 SP1. Included Windows binary is also compiled with this version.

  • Added an example configuration file for MD2 models (q2exampleconfig.xml).

  • Fixed a minor bug where a garbage material name would be produced if none were given for an MD2 model.

  • Added an MIT license for all original source code.

  • Minor additions and revisions to the documentation.

TODO list/wish list:

  • Add a decent logging system.

  • Try and make the application more batch-processing friendly.

  • Output simple Ogre material files for each given material name.

  • Replace all the C-isms with proper C++ code.

  • Move this list to Bitbucket as well. :P

Old versions

Last edited by Devil N on Tue Nov 23, 2010 9:07 pm, edited 21 times in total.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

This is useful! Thanks! :)

I know the Q3 model format is out-dated, but there's a wealth of models available, and this tool makes it easier to get some models into Ogre.
As a lousy artist, I need this kind of stuff.. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Image

EXCELLENT
User avatar
irrdev
Orc
Posts: 420
Joined: Sun Oct 15, 2006 7:30 pm

Post by irrdev »

Nice new addition to the Ogre Mesh converter addons. :wink:
FeedLaunch .NET RSS and ATOM feed editor- open-source and released under the GPL. Visit Feed Launch .NET Project Website hosted at sourceforge.net
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

First of all this is really excellent, I was antipiating such project after the NeverwinterNights converter. There are thousands of cool quake models that can creatively used. I hope there will be converters for halflife and unreal models too.



Arent md2 animations and most md3 are mesh snapshots? How you deal them in ogre's format :?:

btw besides www.polycount.com (which is down for some months) any other huge repository :?:
User avatar
Devil N
Greenskin
Posts: 123
Joined: Sun Jun 26, 2005 4:32 pm
Location: Groningen, The Netherlands

Post by Devil N »

ahmedali wrote:Arent md2 animations and most md3 are mesh snapshots? How you deal them in ogre's format :?:
That's true, but Ogre supports morph animation and Quake's vertex animations map quite nicely onto that. It's the most inefficient and least flexible animation method available though, so it's not really recommended to use this in any serious projects.
ahmedali wrote:btw besides www.polycount.com (which is down for some months) any other huge repository :?:
Good question. Polycount used to be my default repository for Quake models, but it's been gone for quite a while now. I wonder what's taking them so long.
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

I have around 800 Quake models (Quake 2 and 3 only). I could probably host them if you want them.

1.4GB total rar size.
Cutter
Gnoblar
Posts: 22
Joined: Mon Sep 13, 2004 5:54 pm
Location: Germany, Unna

Post by Cutter »

spoot, that would really be great!
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

@spoot & others

I found this site from polycount's forums.

http://ioquake3.org/?page=models
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

Ok, remind me to host via torrent tomorrow. 8) And just a download link......



http://www.spootsworld.com/Game%20Models.rar.torrent
db123
Halfling
Posts: 78
Joined: Wed May 21, 2008 5:55 am

Post by db123 »

I wan't to download,but your link is invalidly!
Could you gei me a another one?
db123321db123@126.com
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

db123 wrote:I wan't to download,but your link is invalidly!
Could you gei me a another one?
db123321db123@126.com
Um, that was a year ago......I'll have to see if I even have the models anymore.
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

http://www.spootsworld.com/Quake23Models.tar.bz2

Around 750 models between both games. 1.4G in size.
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36

Post by Nauk »

Since the original is gone, does anyone still have the source of that converter? If you do, I really would appreciate if you could put it up for download somewhere :)
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99

Post by Wolfmanfx »

@spoot
Are the models already converted to Ogre mesh?
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

They are in their original quake 2/3 format. Basically it will save you from doing 750 downloads from Polycount. 8)

Not sure if I still have the conversion code sitting around. I'll have to try to look for it this weekend. I know I had broken up the pk3's at one point to load the sounds and textures......
Aiursrage2k
Greenskin
Posts: 120
Joined: Wed May 18, 2005 6:40 pm

Post by Aiursrage2k »

I uploaded to my website
http://inanegames.com/QuakeToOgre.rar
User avatar
Devil N
Greenskin
Posts: 123
Joined: Sun Jun 26, 2005 4:32 pm
Location: Groningen, The Netherlands

Post by Devil N »

Heh, sorry for responding so late. I guess my XS4ALL web space was automatically deleted a while ago, since I moved on to another ISP more than a year ago. Aiursrage2k's download link should work for now, unless he prefers that I take over the hosting again. Anyway, I should keep track of this topic more often. :)

On a more serious note, some time ago I discovered that the vertex normals generated by this tool aren't correct. I haven't investigated yet why it goes wrong or how to fix it, but if your lighting is messed up on converted models, then don't try to search for errors in your lighting code. ;)
User avatar
almondega
Halfling
Posts: 67
Joined: Mon Jun 23, 2008 7:34 pm
Location: Brazil

Post by almondega »

link broken
Aiursrage2k's link works

can u upload it to google pages?
i guess it is free..
User avatar
almondega
Halfling
Posts: 67
Joined: Mon Jun 23, 2008 7:34 pm
Location: Brazil

Post by almondega »

some questions
i downloaded the Aiursrage2k pack, witch come with some models and a file configuration

then, i ran the QuakeToOgre.exe
and the mesh model convert correctly
but, there's no skeleton (because its vertex animation, i guess) and no material file

how did u get that textures in your screen shot?
maybe i have to configure something in the configuration file, but i dont know what (does your download file have some example of configuration ?)

the last 3 lines of the OgreXMLConverter.log

Code: Select all

19:33:53: Unregistering ResourceManager for type Skeleton
19:33:53: Unregistering ResourceManager for type Material
19:33:53: Unregistering ResourceManager for type Mesh
EDIT: nvm.. working fine now =]
just had to add the material name in the xml file
and create a material with the apropiate texture

tks for this converter :P

Bug Found: i had download 2 md3 files, one is the Lara Croft character, and the other is a demon
the demon works fine, all animations
but the lara croft has all movements with bug
i uploaded the file if u want to check out what is going on
(this model isnt mine, i just downloded it)
the converter tried to start the animation in the frame -3 or another negative number....
then i removed the animation witch was doing this problem, and all the other animations did wrong movements

file: http://almondega007.googlepages.com/LaraCroftMD3.7z

Problem: seems that the head does not have a defined animation in the animation.cfg config file, how do u make the head fallow the torso animation since there's no bone to attach it ?

after a test
seems that the torso also isn't animated (together) with the bottom
Image

i'll try to find how to get some triangules and put this objects in correct position on the fly
Priato
Gnoblar
Posts: 3
Joined: Sun Jan 20, 2008 12:50 pm

Post by Priato »

Please, someone have a valid URL for dowload the soft?
the both URL are incorrect.
Thanks.
User avatar
Devil N
Greenskin
Posts: 123
Joined: Sun Jun 26, 2005 4:32 pm
Location: Groningen, The Netherlands

Post by Devil N »

I uploaded the file to RapidShare. That should take care of the availability problems once and for all.
User avatar
NoodlesOnMyBack
Goblin
Posts: 200
Joined: Tue Feb 05, 2008 4:14 am
Location: Buenos Aires, Argentina

Post by NoodlesOnMyBack »

Thanks a lot
Image
User avatar
AndiNo
Halfling
Posts: 46
Joined: Wed May 30, 2007 7:57 pm
x 2

Re: Quake to Ogre Mesh Converter

Post by AndiNo »

I know this topic is somewhat old, but maybe someone has tried to convert a MD2 mesh? I successfully converted some MD3 meshes, but now with MD2 I don't know how to specify which animations to convert. I don't even know which anims are in the mesh (it's a standard Quake2 player mesh). I didn't find a useful MD2 viewer on the net either. Can somebody help me?
btw: This tool is really cool :)