What is LW2SMD?

LW2SMD converts a Lightwave object into a series of .SMD, .QC and .VMT files.
It also creates batch-files that call vtex and studiomdl to convert textures SMD files into ingame assets.

060604: I won't be updating LW2SMD. There are a couple of bugs that I have no time/interest to hunt down and there are far better alternatives.
Instead I recommend you use Warmi's plugins to export content.


Installation

Download -> LW2SMD v0.3 beta r4 (Released 05-08-21). This download also contains a sample model & textures to get you started.

The paths here have my own mods' name in them; testmod. Yours is most probably something else.
Unzip LW2SMD into your mods' modelsrc directory. (Steam\SteamApps\SourceMods\testmod\modelsrc\)
In Lightwave Modeler, you have to set the content-directory to Steam\SteamApps\SourceMods\testmod\materialsrc\
When you do this, Lightwave will store the paths to textures relative to the contentdirectory. LW2SMD relies on this being done,
so make sure you set the content-path as specified. Save all your textures under the materialsrc folder.
When LW2SMD resides in your modelsrc directory, you should make a desktop shortcut to it. Simply browse to the modelsrc directory with explorer, right-click LW2SMD and select Send To -> Desktop (create shortcut).
You can now drag and drop LWO files onto the shortcut.


Usage

While I recommend using the drag and drop technique to convert objects, you can also supply the filename to the object in a dosprompt (LW2SMD.exe objectname.lwo). This is tedious though, so I really recommend drag and drop.

There is a special case surface-name that you can and should use in Lightwave that LW2SMD recognizes; phys.
For example, you create a box around your object in Lightwave. Select the polygons of the box and press 'q'. Type phys into the
name field to create a new surface. Now, LW2SMD will use that box and its polygons as a collisionmodel for your object.
I recommend setting the transparency of the phys-surface to allow seeing through it easily without hiding the polygons each time.

Here's what LW2SMD currently create when you feed it objectname.lwo:

  • objectname.qc
  • objectname.smd
  • objectname_phys.smd
  • objectname_compile.bat
  • objectname_convert_textures.bat  
  • This file contains the name of the model, the surfaceproperties, weight and other stuff.
    The main .SMD file with the actual geometry.
    If any phys polygons are found, this is the collisionmodel they define.
    This batchfile converts your SMDs into a usable ingame object.
    This batchfile converts any textures used by your object.

    After converting an object, run both batchfiles.

    Here's an image showing how you would make LW2SMD output normalmapped polygons.
    Since you will probably want to use the fact that Half Life 2 has support for normalmaps, I've made it easier to get them ingame. You can have a number of textures defined in each LW surface. You have to use atleast 1 texture for LW2SMD to export any polygons at all.

    If you have a surface as shown to the left, LW2SMD will generate a VMT file for you that defines a bumpmapped texture and place it in the appropriate directory, ready to be used.
    This was a bit of a pain to have to create manually, so now you won't have to.



    Latest changes 05-08-21

    If you find any bugs or have any requests, you can mail me at tunah at this domain.

  • Will now generate .VMT files to specify bumpmapped models.