Decompiling Source Models

Decompiling Source MDL files to SMD format allows them to be imported into a program such as 3DS Max.

  1. Find the model you want to decompile. You can use the SDK Model Viewer for this, but I recommend using the model browser inside of Hammer (this has a search ability).
  2. Extract all the related files for the model (*.mdl, *.vtx, etc) from the game package (example: team fortress 2 content.gcf) to a new directory using GCFScape.
    – Make sure you are using “substring search“.
  3. Copy the toolbox folder to the new directory.
  4. Run decompile_source_models.bat.
    – During the conversion MDLDecompiler will open. Select the file listed in the command window and decompile. Close MDLDecompiler when done to continue the conversion.
  5. During the conversion VTFEdit will open so you can batch convert any VTF textures. This step is optional. Simply close VTFEdit if you wish to skip it.
  6. You now have an SMD file that can be imported into 3D Studio Max.
    – Note: Any textures will need to be manually reapplied.

Decompiling Animations
Animations can be decompiled in the same manner as models.

  1. Extract the animation .mdl and the .ani that goes with it (if there is one) (ex: Alyx_animations.mdl and Alyx_animations.ani).
  2. Use MDLDecompiler to decompile.
  3. Import the animation .smd file into 3D Studio Max (you will need to have the reference .smd model already open).
    – The animations for games made after Episode 1 don’t decompile very well. Some TF2 animations will work. Left 4 Dead animations won’t decompile at all.

Old Manual Method

  1. Find the model you want to decompile. You can use the SDK Model Viewer for this, but I recommend using the model browser inside of Hammer (this has a search ability). [Pic]
  2. Extract all the related files for the model (*.mdl, *.vtx, etc) from the game package (example: team fortress 2 content.gcf) using GCFScape. [Pic]
  3. Open the .mdl file with a Hex Editor and change the first 5 characters so it reads “IDST,”. [Pic]
  4. Use MDLDecompiler to decompile the model. [Pic]
    – If using Left 4 Dead models, you will need to copy the .vtx file twice and rename the extensions to .dx80.vtx and .dx90.vtx before decompiling.
  5. You now have an SMD file that can be imported into 3D Studio Max. [Pic]

Textures
Extract the textures using GCFScape.

  1. The textures will be in VTF format and should be converted to TGA, this can be done from within VTFEdit.
  2. The material names can be found by opening the .mdl file with MDLTextureInfo.exe.
  3. The materials may be in a separate package (ex: team fortress 2 materials.gcf)
  4. VTFEdit has the ability to batch convert texture directories. Go to Tools -> Convert Folder.

Related Tools

  1. 3D Studio Max VTF Texture Plug-in – Allows you to use VTF textures in 3DS Max.
  2. MDL Texture Info – A small console app that will tell you the textures used by a MDL file. [Download]
  3. GCFScape – A tool for browsing and extracting from Valve package files (GCF, VPK, etc) [Download]
  4. Hex Editor – A basic hex editor for modifying MDL files so they can be decompiled without errors. [Download]
  5. MDLDecompiler – A tool to decompile MDL files to SMD format. [Download]
  6. Fix L4D Files – A small batch script to fix L4D/L4D2 files so they can be decompiled.

Problems and fixes

  1. The textures on decompiled characters look warped.
    1. Fixing facial textures on decompiled human models.
  2. I tried decompiling weapons, but they don’t look right.
    1. Many Source games have several models for a single weapon. These may include w_models (worldmodels), v_models (viewmodels), and c_models (a combination of w_models and v_models.). Generally you want to decompile the w_model, as this is the third person model and won’t have missing sides.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.