April 14th, 2011
Whether you want to create your own models to use in-game or wish to make animations using the in-game models, it will become essential to import the models from the game into 3DS Max. To accomplish this, you'll need a number of programs and plugins:
- GCFScape - To open and extract files from the game content files (*.gcf files)
- XVI32 or Notepad++ (or any other hex editor)
- MDLDecompiler - A program for decompiling models from Half-Life 2 based games
- SMD import plug-in for 3DS Max - Support for importing *.smd models into 3DS Max.
- VTF Texture Plug-in for 3DS Max - Support for VTF textures in 3DS Max.
Once you have the required programs, start by opening the game content file using GCFScape. I want to extract Team Fortress 2 models, so the file I need to open is team fortress 2 content.gcf.
After locating the files you wish to import, extract them to an empty folder. The textures for the model can be found in the team fortress 2 materials.gcf file.
If you are importing episode 2 based content (for example Team Fortress 2 or Left 4 Dead), open up the hex editor you downloaded, and open the model (*.mdl) file. At the very beginning, the text should be IDST0, replace the 0 into a , (comma) so the resulting text will be IDST,
Next, you need to launch the MDLDecompiler program. Make sure that you have it placed in your steamapps*acctname*sourcesdkbinep1bin folder. Fire it up and select the *.mdl you edited in the previous step as the Model File. Select the destination folder for output and uncheck the Use Steam File Access option.
Run the extraction, and unless you encounter any problems you should have a list of files similar to the ones listed in the image below. Please note that the number of files and names vary depending on model.
Next, launch 3DS Max. Go to File->Import and look for the *.smd file you wish to import. Often there are more than one *.smd file extracted by the MDLDecompiler. Usually the one you are after is named something amount the lines of lod1_NAME_*******.dmx.smd. The lower the lod#, the higher the quality on the model.
During import make sure to check Convert from left handed coordinate space if you wish to have your model standing vertically. Your model should be imported into 3DS Max now, but it still lacks the right textures. Open up your Materials Editor (hotkey M) and select an empty slot. Select a material from the scene and choose SMDImport.
Open up the sub-materials and look for any bitmaps used in it. They usually are *.bmp files, but we do not need to convert them to *.bmp in-case you installed the VTF plug-in for 3DS Max. Search for the correct *.vtf file for each *.bmp material file and your model should start looking the way it is supposed to.
Now it's up to you what you wish your imported game models to do.