[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Blender MDL export

Blender MDL export

Discuss the creation of various model formats for Quake engines, and related matters to modeling.

Moderator: InsideQC Admins

Blender MDL export

Postby Preach » Sat Apr 14, 2007 4:01 pm

Cheapy's been demanding this for a long time, so yesterday I sat down and wrote it. It's basically an adaptation of the MD2 code for blender, since the file formats are somewhat similar. It took me almost as long to create some test models that would export to md2(and so be a good test for the mdl code) in blender as it did for me to write the modifications to the code! So I'm still not gonna be getting rid gmax any time soon, but it's useful to have a utility like this for greater control of the export process when needed. Anyway, here's the first beta, exporting animated frames is broken at the moment, but everything else seems to be in order.



Drop it into your Blender/.blender/scripts folder. Tested with 2.4.3, let me know if you find anything bugs besides the animation one : - ).
Preach
 
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Postby Dr. Shadowborg » Sat Apr 14, 2007 5:58 pm

404'ed. :(
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Postby leileilol » Sat Apr 14, 2007 6:58 pm

Why not base off the md3 exporter instead? The md2 exporter is still horribly buggy in itself having to whine about object origins needing to be 0,0,0, vertex screwups and among other things like somehwat bad normals
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Preach » Sat Apr 14, 2007 10:14 pm

I swear I tested it and it saved, but I didn't check the file I got was the real thing, turns out it was just an error page.

It's based off the md2 exporter because that's the one that comes with blender, and also because mdl is much more similar to md2 than md3 - both formats compress vertex coordinates to a single byte, for instance, although most of that code got rewrtten anyway.

I'm pretty sure the vertex normals code should work, to the extent that quake allows. There's a list of 162 allowed normal vectors, and the code chooses the one that minimizes the dot product of the vertex, then records that that index as the 4th byte of the vertex coordinate. The md2 code added 2 to each index, which I don't think should be done, maybe that was causing the problem. Anyway, that's gone from this version.
(aside:this part of the code is pretty inefficient, making it take a noticably long time taken to export the model. If anyone knows a good optimisation for calculating with anorms.h, like what order the normals are in, let me know...)

I've not noticed dodgy vertices in this version, although admittedly only a day's testing so far. I did test it with a model that broke previously in the md2 exporter, and it seemed to work. The vertices do have to be handled quite differently for mdl format, since you need to add multiple vertices where triangles are seperated on the skin, even if they are joined on the model itself. One warning that should come with the file is that the program uses the first frame to determine if vertices are joined. If they occupy the same position in the first frame and on the skin, they are in effect welded. So you may need to add a "seperated" first frame to the model if this causes problems. For most models it shouldn't be an issue.

The origin thing is still there, I'll look into why it does it and if it can be fixed in a later version. Also, the models are rendering all black in glquake but fine in winquake/darkplaces. Changing the skin seems to fix it, and so I'm not that concerned, but I can't see what's up with it so any suggestions are welcomed.
Preach
 
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Re: Blender MDL export

Postby Baker » Mon Apr 30, 2007 6:49 am

User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Blender MDL export

Postby Preach » Mon Apr 30, 2007 9:54 am

Glad you found it useful. It's something that really frustrated me as well, I saw that with was possible for the first time with some models in Q1A, and so tried to replicate it. At first it seemed to always fail, then I got it to work once or twice, but couldn't see why quark would load some models but not others. So once I had a way that worked, I thought it was the kind of thing that really should be shared. I kinda want to go back and tidy it up still though, I'd do some things differently, there are typos and badly phrased bits I'd change. Once I get a proper website sorted...
Preach
 
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Re: Blender MDL export

Postby Preach » Wed May 02, 2007 9:20 pm

New version up!



Features include:
*Assigning the proper size of texture to the model(The last version would give the model the right dimension in the header but export the amount of texture data for 256X256, which would usually create invalid models)

*Reads the actual colours from the texture! The texture now must be entirely in the quake palette, there's no conversion to the palette for other images. I did have the export abort if any such pixels were found, now it's just a warning and those pixels are made black.

*Removed the restriction on translating and scaling the object in object mode, the transformations are now applied to the model. The same is not true for rotation, since correcting this would involve applying the transformation to each frame. Scaling and translating can be done through the model header.

*Fixed the frame list loader, thanks to dayfive

Not included yet are settings for modelflags and all the nice GUI improvements. And I still don't think animation is working, although all the mechanism is there to export multiple frames. The problem seems to be blender isn't updating the mesh correctly when the frames change. The problem with black models seemed to just be a problem with writing a totally blank skin, now that non-placeholder skins are written the models work fine. Guess it must just be some weird engine thing...
Preach
 
Posts: 122
Joined: Thu Nov 25, 2004 7:20 pm

Postby leileilol » Thu Feb 07, 2008 11:33 am

leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Preach » Thu Feb 07, 2008 12:28 pm

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

Postby leileilol » Thu Feb 07, 2008 2:25 pm

leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Preach » Thu Feb 07, 2008 10:57 pm

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

Postby motorsep » Thu Feb 07, 2008 11:57 pm

motorsep
 
Posts: 231
Joined: Wed Aug 02, 2006 11:46 pm
Location: Texas, USA

Postby Preach » Fri Feb 08, 2008 1:48 am

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

Postby leileilol » Fri Feb 08, 2008 5:41 am

leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Preach » Fri Feb 08, 2008 8:21 am

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

Next

Return to Modeling

Who is online

Users browsing this forum: No registered users and 1 guest