Blender md2 issues

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Post Reply
Gaku
Posts: 8
Joined: Fri Sep 14, 2012 9:15 am

Blender md2 issues

Post by Gaku »

I'm new to Blender and modeling - learning as I work my way through tutorials and by trial and error.
a few of questions and issues regarding Blender/md2

1) Since the default player models are all called "tris.md2", am I safe in assuming that md2 only supports triangles and no other polygons?

2) When I create a simple shape in Blender (for example, a cube with 2 triangles per face), export it to md2 using io_export_md2.py, and then open it in QME (v 3.1 preview 2), I immediately get spammed with endless "Access violation at address XXXXXXXXX in module 'qmelite.exe'. Read of address 00000000." Am I doing something wrong?

3) In previous tests with an older version of QME (I think the first one I came across was 0.9), I could open md2 files, but the paint feature always gave similar errors. Else it would just paint the entire model a single color when I clicked it; very confusing.

4) How can I check whether a volume conforms to whatever standards are required by md2?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Blender md2 issues

Post by Spike »

1: every single common model format is triangles only. its only really posh ones that do weird stuff, and only modern hardware can even accept anything more than just triangles. That said, the triangles in an md2 file are specified as fans or strips, for performance with older hardware. At the end of the day, ALL polygons boil down to triangles. Even bezier patches.

2: sounds like a buggy exporter. You can try exporting a q1 mdl instead, and convert in QME.
taniwha or leileilol might be able to help more there.

3: different versions, different places the data is used.

4: md2 has no size limits, but does only have 8-bit precision with arbitary scale. This means that you can have a model 100 miles wide, but you'll only have 256 different points that you can put a vertex.
the scale is per-frame, which results in vertex swiming. You can get away with that for organic models, but for non-organic models you get some really ugly swimming.


If your target engine supports IQM, get the blender iqm exporter and use that format instead, without using QME. You should get better results.
I know not exactly which Q2 engines support IQM.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Blender md2 issues

Post by leileilol »

It IS a buggy exporter. It's the result of developing an exporter not for Quake2, but for a Nehe tutorial instead
Image




I'd suggest exporting into another format that doesn't have a sad , blindly-written exporter (like IQM or MD3) then converting the resulting model to MD2 with a tool like qwalk or Noesis.


*cough*a good md2 exporter is something taniwha could also look into*cough*
i should not be here
taniwha
Posts: 401
Joined: Thu Jan 14, 2010 7:11 am
Contact:

Re: Blender md2 issues

Post by taniwha »

Better yet, if the engine supports it, why not just use IQM or MD3 and be done with it?
Leave others their otherness.
http://quakeforge.net/
Gaku
Posts: 8
Joined: Fri Sep 14, 2012 9:15 am

Re: Blender md2 issues

Post by Gaku »

Thanks for the quick responses; a few more questions...
Spike wrote:2: sounds like a buggy exporter. You can try exporting a q1 mdl instead, and convert in QME.
taniwha or leileilol might be able to help more there.

4: md2 has no size limits, but does only have 8-bit precision with arbitary scale. This means that you can have a model 100 miles wide, but you'll only have 256 different points that you can put a vertex.
the scale is per-frame, which results in vertex swiming. You can get away with that for organic models, but for non-organic models you get some really ugly swimming.
2) I've tried using ajmdl_mdl_export_055.py from the "Making a Quake MDL in Blender: for dummies, NOT TOTAL MORONS" topic, but it won't install correctly for some reason? Of the python scripts I've imported into Blender, it's the only one that doesn't appear in the list when imported. I can't check it to activate it for some reason. Searching for "aj", "mdl", and "55" all yield 0 results.

4) 256 vertices max? ouch! but ok, a good number to remember.
Spike wrote:If your target engine supports IQM, get the blender iqm exporter and use that format instead, without using QME. You should get better results. I know not exactly which Q2 engines support IQM.
taniwha wrote:Better yet, if the engine supports it, why not just use IQM or MD3 and be done with it?
I need a model that can be used in Quake 2, though.
leileilol wrote:I'd suggest exporting into another format that doesn't have a sad , blindly-written exporter (like IQM or MD3) then converting the resulting model to MD2 with a tool like qwalk or Noesis.
I wasn't able to find qwalk, unfortunately. Noesis looks VERY useful; I'll give that a shot in a moment with a test md3 file.
andrewj
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Re: Blender md2 issues

Post by andrewj »

Spike wrote:4: md2 has no size limits, but does only have 8-bit precision with arbitary scale. This means that you can have a model 100 miles wide, but you'll only have 256 different points that you can put a vertex. the scale is per-frame, which results in vertex swiming.
Well surely a good exporter would have an option to use a single scale for every frame...
Gaku
Posts: 8
Joined: Fri Sep 14, 2012 9:15 am

Re: Blender md2 issues

Post by Gaku »

Ok, so I've managed to generate a fully textured model using Blender with 254 vertices.

If I output an .md2 directly from Blender and load it into Quake 2, I get an error that the skin is over 480 units tall.

If I output the model as a .3ds and then open it in QMELite v 3.1p2, I can save is as a .md2 and open it in Quake 2. HOWEVER, when I import the skin, it doesn't match properly. Also, the resulting .md2 is only 19kB, whereas the one generated from Blender is closer to 300kB.

If I open the .3ds in Noesis and export it as an .md2, it creates a .md2 that is 27kB in size. This file opens in Quake 2 but fails to have any skin applied to it at all (just black). It's odd that Noesis has an option to export the skin information as a .pcx but lacks any obvious way to import a skin.

Any ideas on what I should try? I'm just trying to get this thing loaded into q2.
andrewj
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Re: Blender md2 issues

Post by andrewj »

Gaku wrote:4) 256 vertices max? ouch!
You misunderstood what Spike was saying.

In MD2 format, vertex precision is low. It is like there is a 3D grid, and the grid only has 256 points on each axis (256x256x256 points in total), and vertexes can only exist at these grid points.

You can definitely use more than 256 vertices in a model.
Gaku
Posts: 8
Joined: Fri Sep 14, 2012 9:15 am

Re: Blender md2 issues

Post by Gaku »

andrewj wrote:
Gaku wrote:4) 256 vertices max? ouch!
You misunderstood what Spike was saying.

In MD2 format, vertex precision is low. It is like there is a 3D grid, and the grid only has 256 points on each axis (256x256x256 points in total), and vertexes can only exist at these grid points.

You can definitely use more than 256 vertices in a model.
Oh I see; thanks for clearing that up. I will definitely keep that in mind for my next model.

Since my last post, I've also downloaded 3dsmax, MilkShape, NST, and QTiP; I've read dozens of posts related to this issue; and I'm still no closer to getting this model into Quake 2.
I've discovered that .pcx dimensions are limited to 512x256 (though sources claim 640x480 should work, anything over 512x256 crashes my q2).
No problem... I created a new UV skin texture in Blender with dimensions 512x256 and pasted it into a .pcx. looks great. Supposedly if I export the model as a Wavefront .obj, I should then be able to open it in MilkShape, export it as an md2 (after flipping the vertex order twice), and all the UV-mapping info should be retained. Only it isn't.
Looking in the .obj file, it only has vertex and face information - no UV information.

Any ideas would be appreciated.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Blender md2 issues

Post by leileilol »

If you downgrade to Blender 2.49 (install that separately), you can use the MD3 or MDL scripts found here and go through a conversion to MD2 through QWalk or Noesis.
i should not be here
Gaku
Posts: 8
Joined: Fri Sep 14, 2012 9:15 am

Re: Blender md2 issues

Post by Gaku »

leileilol wrote:If you downgrade to Blender 2.49 (install that separately), you can use the MD3 or MDL scripts found here and go through a conversion to MD2 through QWalk or Noesis.
Ah, I see. 2.49 works fine; unfortunately it doesn't like my 2.63 blend files. The mesh loads fine, but all UV coordinate info is lost. It looks like my best bet is still to use .obj as an intermediate, but 2.63 also fails to export UV coords to .obj. This keeps getting better and better. :lol: If I can find a fix for the .obj/UV export issue, that might solve this problem nicely. I've asked on the blender forums to see if they have any insights, since my google searching indicates a lot of people have had this same issue and never had it resolved.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Blender md2 issues

Post by leileilol »

Well that's due to 2.63 using the new Bmesh system.
i should not be here
Post Reply