HL2 MDL (or SMD) import/export scripts?

Hello,

I was trying to use a NWN MDL import script, but this won’t work for HL1/HL2 models. Could someone write a script based on the NWN MDL import script that will import HL1/HL2 models + animations? It would be appreciated.

~R2

umm, so decided I wanted to [I don’t], where may I find docs on these formats?

and, where can I find the NWN import script?

From Valve:
http://www.valve-erc.com/srcsdk/models/modeling_overview.htm

They used Softimage XSI for HL2 modelling, and Avid has released Softimage XSI|EXP for Half-Life 2, so if you want to model for HL2, that would be the software you should use.

The SMD format used for HL2 is Valve’s proprietary 3D model format for the Source engine, and I doubt Valve would want people dissecting it, especially when there appears to be some kind of commercial partnership between Avid and Valve.

My first thought goes to HL2 SDK, available free…

for the hl2 formats info…

Gonna make a quick search now, got curious about it…

I searched for a NWN plugin for blender long ago, and what i didn’t like was not animation support by then,…don’t know if now there is :

http://www.beastwithin.org/users/wwwwolf/games/nwn/gametools/neverblender/

seems not yet…

Anyway the author is learning about blender actions to make that part available…

NWN mdl import does not work.

The whole reason I want to be able to import these models into BLender is because I want to do it FREE.

Looks like someone wil have to write a script, or find something else useful.

the xsi solutions seems rather free (beerly)

The whole reason I want to be able to import these models into BLender is because I want to do it FREE.
All versions of XSI|ESP is free (including XSI|ESP for Half Life 2).

I have worked a bit with the SMD format, if I can find the time I would be willing to look into it.

SMD is actually a text format so it is rather easy to disect :wink: For a static model it is basically a list of triangles with vertex coords, normals and uv.

It’s been quite a while since I last played with Blender … 2.05 or so, I kind of missed the undo feature that has now been added … actually quite a while since I last played with 3D modelling, but I’ve taken it up again lately in order to do some mapping/modelling for HL2. So far I’ve tried Milkshape3d (cheap but the integrated tools are for HL1, though the SMD export can be used for HL2) and Softimage XSI EXP, which is free, but not open (as in OpenSource). Also XSI EXP has some limitations (watermarks, very limited rendering, limit on polycount), so I think it would be great if you could model game content in blender and easily export it to SMD.

Yes, but we are limited to 2000 trianlges. Not what I call good for making some cool models.

I have a very basic exporter working now. It only exports reference models, i.e. no animations (yet). There is probably also a lot of other stuff not working, smoothing among others. I’m also not exactly sure how object hierarchies work in Blender, but it’s enough to successfully export a textured cube :wink:

For now you can download it here: http://asrc.pjohnsen.com/downloads/smd_export.py. Save the file in: Blender/.blender/scripts. You can now access it from the standard export menu: Scripts Window, Scripts menu, Export, HalfLife2 (.smd). It will export the selected mesh to a file you specify.

Comments and suggestions appreciated.

-Pelle

I have updated the script so that it also supports smoothing on/off (but not autosmoothing).

I also fixed an issue with the matrix transforms, so it now successfully exports a cube and 2 cylinders.

nice work pJohnson.
I didn’t try it yet but I sure will.
I am also in the process of trying to make models for the hl2 engine in a totally free way.
I tried the xsi package, but that program really bugs me, it doesn’t let you import anything except hl2 models.
And personally I prefer the blender interface over the xsi interface.
Furthermore I think it is important for blender when it is used for more demanding games then the currently supported internal game engine.

I would love to see some directx support for example, like in 3dmax, they let you chose the game specific shaders and you can tweak and preview them from within 3dmax.

i can’t wait to see final version of script including valid animation export, gl pjohnsen :wink:

Is anyone still working on this script? Or have they got a mirror? I lost my copy and the link is down :frowning: .

If you can’t wait for the in-blender IO script, you should check out Milkshape 3D which can import this format and export to any number of blender-supported formats. Of course, this means you need windows and you have to download another program. This should hold you over until the blender script comes out :slight_smile:

https://blenderartists.org/forum/viewtopic.php?t=38317&highlight=smd

Sorry for the problem with the link. There was a power outage while I was skiing in Italy … just got back.

The server is now back up :wink:

Sorry for replying late, but I get this error when I try to export the monkey mesh:

http://img204.exs.cx/img204/7706/fgsdfgsdfgf3ab.jpg

Hmmm, have you textured the mesh properly? You need to assign an image as explained in the blender guide under UV mapping http://www.blender.org/modules/documentation/htmlI/x5138.html.

Hope this helps :wink:

Lol, how dumb of me.

Thanks!

One more thing: How do I compile a model? I am completely new in this area… :expressionless: