Page 1 of 5

Model Converter [alpha released]

Posted: Mon Jan 18, 2010 2:03 pm
by Sajt
I've decided to release the model converter I've been working on off and on for the past month. It imports MDL, MD2, and MD3, and exports to MDL. Every little part of the MDL format specs is properly implemented... or at least I hope so. It has no problem converting any UV map, or loading MD3s with multiple objects. HOWEVER: it doesn't support MD3s with multiple textures (yet).

The converter is a COMMAND-LINE TOOL. That means it's really inconvenient to use, and lacks some features such as moving frames around. You'll have to bear with me. I would like to make a GUI version later, but I thought I would release the command-line version so anybody who just needs to convert models can do so immediately.

I've tested it on 32-bit Windows and Linux, but not thoroughly. It was developed on Windows. The source is licensed under the GPL and publicly available.

Website: http://www.icculus.org/qshed/qwalk/
Download: http://www.icculus.org/qshed/qwalk/download/
Guide: http://www.icculus.org/qshed/qwalk/guide/

You NEED to read the guide AND the main qwalk page, because there's currently no other way to know how to use the converter.

And this is NOT a stable release. It's not even a beta. It's an alpha. I made the decision to make a release only two hours ago, and cobbled it together since then. It's possible I left an obvious bug in or forgot something stupid. I have tested it, but not painstakingly. If you are reading this and want to make a news post about it, please include this disclaimer!

If you have questions, found a bug, or would like to request a feature, let me know. Post on this thread, or email me at sajt at icculus dot org.

Posted: Mon Jan 18, 2010 2:08 pm
by frag.machine
Yay! Excellent, Sajt. I'll check it out. I've been working in a .mdl editor on and off for a long time ago, and maybe I can help you in someway.

Posted: Mon Jan 18, 2010 2:13 pm
by Urre
I've been holding my breath for this :)

Did scar3crow ever tell you I requested support for a widely supported common format for input? Examples being .3ds, obj, .lwo and more. Cause that'd rock, would make modeling .mdl's a great deal easier for a bunch of people. Only one of those "common" formats would be needed I believe, as all modeling software can export to them without trouble. I'd vote .obj.

In any case, this is more than awesome already, I'll be testing it out later! Way to go Sajt!

Posted: Mon Jan 18, 2010 2:30 pm
by Sajt
Yes, I would be willing to add OBJ support. I would just need a few example OBJ models for testing. I have some experience with writing OBJ loaders, but I never got into the smoothing groups or materials or things like that.

Posted: Mon Jan 18, 2010 2:32 pm
by c0burn
What happens if the source model exceeds the MDL specs?

Posted: Mon Jan 18, 2010 2:37 pm
by Sajt
When you export a model, it will print a warning in these cases:
- The model's skin's height is greater than 200px (won't run in DOSQuake)
- The model's skin is not power of two (will be resampled in GLQuake). Almost all models have non-power-of-two textures though, so I should probably hush this warning.
- More than 1024 vertices (won't run in standard engines)
- More than 2048 triangles (won't run in standard engines)
- More than 256 frames (won't fit in standard Quake network protocol)

If the skin's width is not a multiple of 4 (which is a requirement of the format), it will be automatically padded (without borking the texcoords).

I might have missed some other limitations.

I think you can fit any number of vertices and triangles and any size skin in a MDL file, it's just the old engines that have some static limits.

Posted: Mon Jan 18, 2010 2:41 pm
by c0burn
That's utterly fantastic. God, I wish we had the Quake models with bones intact.

Posted: Mon Jan 18, 2010 3:11 pm
by Teiman
Grrrreat ! :-)

Posted: Mon Jan 18, 2010 4:27 pm
by frag.machine
Sajt wrote:If the skin's width is not a multiple of 4 (which is a requirement of the format), it will be automatically padded (without borking the texcoords).
Hmm. QuArK requires that skin dimensions be a multiple of 8, and I never understood why original player.mdl skin does not follow this rule. Multiple of 4 makes more sense.

Posted: Mon Jan 18, 2010 4:31 pm
by c0burn
Quark is such a vile program.

Posted: Mon Jan 18, 2010 5:42 pm
by mh
c0burn wrote:Quark is such a vile program.
The "Lotus Notes" of Quake utils. :evil:

This tool however seems to be a clear case of bringing on the awesome. Well done that man. :D

Posted: Tue Jan 19, 2010 12:30 am
by Baker
I'm eager to try this. Maybe some models I've made can finally make the trip from .md3 to .mdl (Quick3D didn't always succeed; the Quark route sometimes didn't work).

Thank you.

"Some more far-fetched major features for later versions: ...Convert MAP files (e.g. the health/ammo pickups) to models."
Twice as nice.

Posted: Tue Jan 19, 2010 12:40 am
by mh
Baker wrote:
"Some more far-fetched major features for later versions: ...Convert MAP files (e.g. the health/ammo pickups) to models."
Twice as nice.
Only twice? That's something that's been sorely needed for a long long time.

Posted: Tue Jan 19, 2010 4:58 am
by c0burn
mh wrote:
Baker wrote:
"Some more far-fetched major features for later versions: ...Convert MAP files (e.g. the health/ammo pickups) to models."
Twice as nice.
Only twice? That's something that's been sorely needed for a long long time.
http://qexpo.quakedev.com/uploaded/7/pak2.zip

Posted: Tue Jan 19, 2010 9:42 am
by Urre
mh wrote:Only twice? That's something that's been sorely needed for a long long time.
It's been done many times by many people, I believe Tomaz did it first. I'm also assuming c0b's link above leads to a pak containing those as .mdl's, haven't checked :)