A tutorial on how to import Source models such as Half-Life 2, Counter-Strike: Source, and Team Fortress 2 into Blender.
Posted by Hyper3D on Jan 24th, 2011
First, get the SMD importer for Blender here...
If you are using version 2.49 and below, download Jon Moen Drange's importer, and then download Dvondrake's exporter. If you are using 2.56, download the "Blender SMD Tools"
Then do the following:
1. Put the files somewhere you won't forget. For example: "X:\Program Files\Blender Foundation\Blender"
2. In Blender, open File > User Preferences, move to the Add-Ons tab and click Install Add-On in the bottom of the window
3. Check the SMD Tools' box to enable them
4. Click Save as Default to enable the tools in all Blend files
1. Put the script files (import_static_smd.py, etc) in the scripts directory where Blender is installed.
Next, download Cannonfodder's MDLDecompiler...
Place the .exe file in the .../SteamApps/*Steam name*/sourcesdk/bin directory. If you have problems with it crashing, place it in .../SteamApps/*Steam name*/sourcesdk/bin/ep1/bin
(Place a shortcut on your desktop so you don't lose track of where it is)
Now download Crafty...
After you install Crafty, open the "File System Browser" and click File> Open> Package, then locate your Steam apps folder (X:\Program Files\Steam\steamapps). Look for "counter-strike source shared.gcf" and open it. Proceed to cstrike> models> weapons (or the "player" folder if you wish).
Now, if you wish to animate a weapon, you must extract the 5 files that are needed for that weapon. For example, the Deagle:
Create a folder on your desktop, and name it "CSS Blender', or whatever you want to name it. Take the five weapon files and extract them to the folder you created.
You need the texture files, too. So open the .mdl file (Such as v_pist_deagle.mdl), and click File> Export, name it to what you want, and then save it where you put the other files. You will get an .OBJ file, along with a .TGA file. The .TGA file is the texture.
You also need the textures for the hands. So download and install VTFEdit...
And then back in Crafty, navagate to cstrike/materials/model/weaponsv_models/hands. Extract "v_hands.vtf" to the CSS Blender folder, and then open it. Now click File> Export, and save it where the CSS Blender folder is also. And you should end up with a .TGA file.
Open up the MDLDecompiler and make sure that "Steam File Access" is unchecked. Next, choose the model file you want to open, and choose your output directory as the CSS Blender folder. Click extract, and if everything goes well, you should have a bunch of .SMD files.
Now start up Blender, click File> Import> Studiomdl Data. Locate the CSS Blender folder, or what you named it, and look for a file that might say "hands_reference.SMD", and open the file. Now this time, you need to import the gun reference model. So go to File> Import> Studiomdl Data, and look for something like "gun_reference", and open it.
Done! You should now have loaded the files so you can animate them. Now to get the textures on the models...
Right click on the hand and go into edit mode, select all the vertices, and then open the UV Image editor. Click Image> Open, and search for the hand texture which should be named "v_hands.TGA" and select it. Now you just need to line the UV map with the texture. Do the same also with the gun.