.MDL Creation solution for Linux?

Discuss programming in the QuakeC language.
dayfive
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

.MDL Creation solution for Linux?

Post by dayfive »

Hi guys,

At present is there any good software that works in Linux that can be used for explicitly creating Quake 1 .mdl files?

I notice Blender3d can save as .md2, and I've used qME on Windows, but I'm wondering if there's something specific for Quake 1, like qME for Linux.

Alternatively, is there any user who has like a Python script for converting a Blender model to .mdl format with all of the special flags (rotation etc)? How good is converting to .mdl from .md2 created in Blender?
HeadThump
Posts: 74
Joined: Sun May 14, 2006 3:21 pm
Location: Zin

Post by HeadThump »

What is happening to the word 'solution' over the past few years? I barely recognize it any longer.

Anyway, this topic should help:

http://forums.inside3d.com/viewtopic.php?t=654

Preach has made a exporter for the mdl format for Blender.
dayfive
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Post by dayfive »

HeadThump wrote:What is happening to the word 'solution' over the past few years? I barely recognize it any longer.
well i was using it in this context to mean a possible result that could be accomplished in any number of ways; or a "solution" to this non-trivial endeavor of exporting to .MDL format.
HeadThump wrote: Anyway, this topic should help:

http://forums.inside3d.com/viewtopic.php?t=654

Preach has made a exporter for the mdl format for Blender.
You are awesome! This is exactly the kind of thing I was looking for !!

I guess I should lurk more.
HeadThump
Posts: 74
Joined: Sun May 14, 2006 3:21 pm
Location: Zin

Post by HeadThump »

he he
well i was using it in this context to mean a possible result that could be accomplished in any number of ways; or a "solution" to this non-trivial endeavor of exporting to .MDL format.
Don't mean to pick on you, well a little bit maybe, and it wasn't really a bad example of usuage. When I see a bad example, I imagine myself back in a meeting room, listening to a vice president of yadda yadda wearing cheap dress pants,out of style blouses with pointed collars, a gawdawefull perm, slowly and excruciatingly raping my soul with the abstracted barely cognitive silver dollar words she bought with her MBA.
dayfive
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Post by dayfive »

Ok, so I got the python script and am testing it here and I so far found one anomaly,

I had to change

Code: Select all

			#check header (first line)
			if lines[0].stip()<>"# MDL Frame Name List":
to

Code: Select all

			#check header (first line)
			if lines[0].strip()<>"# MDL Frame Name List":

Also, what is the expected input format of the "frame list file" ?

I am using this and it says not a valid file

Code: Select all

$modelname invulner
$flags 8		// client side rotate
$base base
$skin skin
$frame frame1
Is there documentation anywhere? I would assume that the format would be the standard QC stuff as seen in the iD software ../progs106/models.qc file.

Nonetheless, this seems like it could be great!
dayfive
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Post by dayfive »

Also is there something similar for IMPORT .mdl file?
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Why again do you need to generate a modelgen file?
dayfive
Posts: 77
Joined: Fri Nov 10, 2006 9:48 pm

Post by dayfive »

FrikaC wrote:Why again do you need to generate a modelgen file?
for fun, just like any other quake mod file ;)

I would just make all of them as .bsp files but then you lose the flags = 8 rotation.

I was successful using

Code: Select all

# MDL Frame Name List
frame 1
as the framelist file.

It appears that it was successful in blender too, but it still doesn't look right in game.

Here's the output from the export script

Code: Select all

***********************************
MDL Export
***********************************

Header Information
ident:  1330660425
version:  6
scale x:  0.0078431372549
scale y:  0.0074592777327
scale z:  0.0078431372549
offset x:  -1.0
offset y:  -0.951057910919
offset z:  -1.0
boundingradius:  2.95105791092
eyeposition x:  0
eyeposition y:  0
eyeposition z:  -1.0
number of skins:  1
skin width:  256
skin height:  256
number of vertices:  49
number of faces:  80
number of frames:  1
synctype:  1
flags:  0
size:  10.0

Closed the file

Preach
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Post by Preach »

It's a work in progress, and there is something going wrong with the script I've not figured out yet. At the moment it exports something that other q1 model tools can open and then save as a proper mdl, but that's not much good if you're on linux. Can you supply a copy of the output model and explain what's gone wrong with it? Usually the problem I have is that the model shows up as black all over in some engines(but not darkplaces/winquake), so if you're finding the same thing then at least it's the same bug.

Thanks for the catch on the frame list thing. The code came straight from the md2 exporter that comes with blender, so I assumed it would work. Apparently not, but never mind. You've managed to figure out the format, although at some point I might actually take it back to the old modelgen format so you can control flags/sequence names etc from the script too.

I've not got around to writing the import script, for the same reason that it's fairly easy on windows to convert the mdl to a format that can be imported into blender. The exporting to mdl direction is where there's a shortage of options. If you remind me once my exams are over I'll look at adapting the md2 import code...
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

Are you padding the skin width to a multiple of 4?
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Preach
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Post by Preach »

Sajt wrote:Are you padding the skin width to a multiple of 4?
It's always set to be 256 by 256, I would have thought the model wouldn't even load in winquake if that wasn't the case...
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Preach wrote:
Sajt wrote:Are you padding the skin width to a multiple of 4?
It's always set to be 256 by 256, I would have thought the model wouldn't even load in winquake if that wasn't the case...
IIRC the skin height shouldn't be over 200 for DOS/WinQuake compatability. The width has a very high upper bounds, but for 3dfx users the texture will be automatically scaled to 256x256. Actually it may just scale in GLQuake regardless of card (dunno, engine coders definitely know more).
Preach
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Post by Preach »

FrikaC wrote: IIRC the skin height shouldn't be over 200 for DOS/WinQuake compatability. The width has a very high upper bounds, but for 3dfx users the texture will be automatically scaled to 256x256. Actually it may just scale in GLQuake regardless of card (dunno, engine coders definitely know more).
I think the 200 width restriction is only for dosquake, I can load these models fine in winquake(in fact they work better than in glquake as the skin displays correctly). I also thought that skins were rounded to the nearest power of 2 for all gl engines(and then possibly scaled down again by some variable like r_picmip). In any case, I'll add an option to set custom skin size in a future version.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

Or maybe read the assigned texture's resolution instead?
i should not be here
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Preach wrote:I think the 200 width restriction.
Height.
Post Reply