Half-Life SMD Importer v1.0

October 2002

About| Installation| Usage| Frequently Asked Questions| Credits| Links

Important Note

This is an unofficial utility and is not supported in any way by Valve Software. Please do not contact them with any questions about this script.

About This Script

This is a gmax/3DS Max 4.2 or later MAXScript utility for importing Half-Life SMD files, featuring full support for meshes, skeletons and animations.

All Half-Life models start life as a bunch of SMD files which are compiled into game compatible MDL files using the studiomdl tool, included in the Valve Half-Life editing SDK. SMD files can be extracted from a previously compiled MDL file (such as those included with the game) using an MDL decompiler. Two recommended ones are mentioned later on in the usage section.

Installation

To install, just drop SMDImporter.mzp into your gmax/max scripts\startup folder (eg. c:\gmax\scripts\startup), run gmax/max (if it's not running already), go to the "MAXScript" menu, select "Run Script...", choose the SMD Importer script found in your gmax/max scripts\startup folder, and click OK. Select the utility command panel (the one with the hammer icon), click on the "MAXScript" button and the MAXScript utility rollout will appear. In it you'll see a little drop down list box entitled "Utilities". Open it up, and you should find "Half-Life SMD Import" listed there. Click on "Half-Life MDS Import" and the interface should appear somewhere below or above the MAXScript rollout. Note that you might have to scroll the utility panel down to find the interface. You're ready to go!

As you placed the script in your gmax/max scripts\startup folder, it will automatically be installed each time you run gmax/max. If you don't like this, just put it into your scripts folder instead and run it manually as described above each time you need it.

To uninstall, just delete SMDImporter.mzp from wherever you put it.

Using the Importer

The first step in using the importer is to extract a set of SMD files from the MDL model you would like to import. You can do this either using Milkshape 3D or Kratisto's SMD decompiler.

For example, to decompile the SAS player model from Counter-Strike using Kratisto's SMD decompiler, go into the command/DOS prompt, move to the directory where the SMD decompiler is located and enter something like this:

mdldec C:\Half-Life\cstrike\models\player\sas\sas.mdl C:\SMDModels\sas

This will decompile sas.mdl into the C:\SMDModels\sas directory, filling it with lots of .smd files containing animation and mesh data. There is usually one reference pose SMD file (in this case, sas.smd) and many animation SMD's, for example walk.smd for the walking animation, right.smd for the "dying falling to the right" animation and so on.

Using the importer is nice and simple. Hit the "Import SMD..." button, pick an SMD file and hit OK. If you chose a reference SMD (one that contains a mesh) both the skeleton and mesh will be imported. If you chose an animation SMD (no mesh) the skeleton will be loaded with all its animation keyframes.

If you already have a skeleton in the scene, the importer will apply any subsequently imported animations with matching skeletons to it. For best results, import the reference SMD first to obtain the mesh and then import animation SMDs. You only need import the mesh once: following animations will be automatically applied to the mesh's skeleton.

Frequently Asked Questions (FAQ)

Credits

All code by Chris Cookson

People I'd like to thank:

Links

Copyright (C) 2002 Chris Cookson