Importing Team Fortress 2 Item Models into Blender

So maybe you, like me, are interested in making an item for Team Fortress 2. And maybe you’re new to modelling so you want to look at TF2 models in, say, Blender (though this will get you far enough if you’re using something else). With the new SteamPipe content distribution system, though, shit’s all hidden and confusing now ’cause they converted all the .gcf files into .vpk’s. Even if you’ve extracted stuff from TF2 before, maybe you’re having a hard time now. All the tutorials for how to do this are outdated and I can’t be the only dumbass who couldn’t figure this out in two minutes, so I am gonna put this here for anyone who needs it.

Step 1: If you haven’t done so already, install the Source SDK. Part of SteamPipe’s intention was to obsolesce the SDK launcher and instead, your TF2 development tools are going to be beta versions found in C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\bin, but you still need the SDK installed to decompile later. Hover over the Library tab, select Tools from the drop down menu, and install the Source SDK. Once it’s installed, run it once. It will take a while to copy some files. If it doesn’t, tell it to Refresh SDK Content. Once it’s done, close it.

Step 2: Go to Nem’s Tools and download GCFScrape. Even if you already have GCFScrape, go there and get the newest version. I had 1.8.2 and it wasn’t current enough even when the one out at the time of this writing was only 1.8.4. That .2 makes a difference. Once it’s downloaded, install it.

Step 3: Run it, and click the open folder. Navigate to C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf and open:

tf2_misc_dir.vpk if you’re looking for models
tf2_sound_misc_dir.vpk if you want sound effects
tf2_sound_vo_english_dir for voice clips
tf2_textures_dir for textures, I guess? It would seem the textures are separate of the models.

You always want to pick the files with the _dir in them. I let you figure out how to manage that other crap ’cause we’re talking about models here.

Step 4: Find the stuff you want, which I think you can manage on your own. When you find a thing you want, right-click all the files with the same filename (you can select multiple objects by holding down the Ctrl key as you click them) and select “Extract”. It’ll ask you where you want it and I strongly advise you to make a folder for it to keep all the files together.

Step 5: Next go to this Valve Developer Community page and download Hooch’s fixed version of the file at the bottom. Unzip it. Put the .exe in C:\Program Files (x86)\Steam\SteamApps\common\SourceSDK\bin\ep1\bin. Run it. If it gives you an error about MFC71.DLL, unzip the mfc71.rar file that was in the same folder as the .exe and drop the file enclosed in C:Program Files (x86)SteamSteamAppscommonSourceSDKbinep1bin too. Go ahead and make a shortcut to the .exe on your desktop too, that’ll save you a lot of hassle.

Step 6: Run MDLDecompiler and navigate to the folder you extracted your files from GCFScrape to. Pick a model and open its folder. Select the .mdl file. Then make a folder for your decompiled model and select it as your output location.

Step 7: I’m going to assume you have Blender installed already and it’s updated and not that antiquated shit they’re talking about on this VDC page. Download the .zip file but don’t extract it. If you have the ye olde Blender, follow their installation directions. If not, proceed here.

Step 8: Open Blender and go to File > User Preferences > Addons. At the bottom, click “Install From File”. Navigate to and select the .zip file you downloaded with the Blender Source Tools in it and click “Install from File”. It will install the entire .zip file. Then, in the Categories menu to the left in that window, select “User”. Find the Import-Export SMD/DMX Tools addon and check the box next to the picture of the stick figure flailing around. Now, go to the bottom of that window and click the Save User Settings button. That’ll make it so you don’t have to check that box every time you open Blender and want to saucemodel.

Step 9: Now when you go to File and look at the Import and Export menus, you’ll have options for a number of Source Engine file formats. Like .smd! Which is exactly what you want to import now. Go to File > Import > Source Engine and it’ll open a file browser. Navigate to the output file you selected when you were decompiling and there should be an .smd file in there. Select it.

Your TF2 model should now be there, textureless, ready to be edited.

The world is now your oyster!

I hope this tutorial helps you out, but if it doesn’t, please feel free to ask questions in the comments. I am not an expert in Blender or Source, so I can’t always help you with that, but a lot of times issues with following these directions have to do with updates to any and all of these tools. It helps immensely to have problems like that brought to my attention so I can keep this tutorial current with the tools used in it.

However! demonfox38 is working on an MVM map over at dfbuilds and they have already and will continue to post a lot of information about both Hammer and Blender that may be of interest and use to you if you have questions about what to do with this stuff once you’ve got it.

Comment

On the step 8 I am not finding the Import-Export SMD/DMX Tools addon, I do as you say “Navigate to the folder with the script you downloaded in the last step and select the datamodel.py file. Repeat for the io_smd_tools.py file.” I selected both datamodel.py and io_smd_tools.py and clicked the install from file.

I will try to figure out what the problem is, but I found that I am missing my username folder and so cannot try to replicate your problem presently. I’m not sure if it’s a result of one of the newest client updates or if, because I had to reinstall Steam completely recently after the July 6th update broke all my Source games, I didn’t have the SDK reinstalled. With all the updates to the Steam client recently, especially those involving the Steam Pipe, it’s possible my tutorial may already be out of date. I am installing the SDK now, though, so I will comment again when I have further information for you.

In the meantime, you might try googling that error with “Mdldecompiler” to see if anyone else has encountered it yet.

Okay, I figured it out. When you extract the model’s files in GCFScrape, you have to extract all of the related files, not just .mdl. Apparently, when it decompiles the model, though it only references the .mdl file as the directory, it pulls information from the other files in the process. So if you’re missing, say, the dx80.vtx, it can’t complete the decompile.

So, for exmaple, when you’re in GCFScrape and you want to decompile the model for Spy’s Sapper, you would need not only v_sapper_spy.mdl, but also v_sapper_spy.dx80.vtx, v_sapper_spy.dx90.vtx, v_sapper_spy.sw.vtx, and v_sapper_spy.vvd. Basically, any file that has the same file name as the model you’re trying to pull. Extract those all to the same folder and then the MDL Decompiler should be able to decompile from the .mdl.

I realize I was a bit vague about this, beyond saying that the model would have more than one file, so I will edit the tutorial to be more specific about that.

Please let me know if this does not work for you and I will try to figure it out.

This Google Code snippet seems to suggest that the version of Blender can potentially be incompatible with the addon. Make sure you have the most up to date version of Blender and see if it works then.

Hello, I just wanted to give a thank you for such wonderful instructions. I’ve been playing with Blender for quite some time and I’ve decided to finally take things seriously with it. Been studying like crazy for the last month or so and have improved a decent amount. However, I was told that I should make TF2 items that are usable in game as a good exercise to improve myself and make something noteworthy. I have literally spent the last 3 days constantly searching for hours on end on how to get files in to Blender so that I can start editing them and get them in the game. Finally, I have found that guide to help me get started. Thank you very much! Now I just have to start making stuff and figure out how to get it in the game… Back to work for me then.

On step 8 when you say to “Repeat for the io_smd_tools.py file,” where is the io_smd_tools.py (what is it? where do I/or havi I gotten it from?)Also, where is the “Categories menu to the left?” To the left of what? Is it a tab? Responses are appreciated.

Hmm! When I wrote this tutorial originally, one need to extract the zip file with the Blender Source Tools in it and import both the files individually. Now it seems Blender will just let you install the whole .zip file itself. I will rewrite the tutorial to reflect this, but basically all you have to do is import that .zip file and then check the box with the stick figure next to it.

The Categories menu is on the lefthand side of the Blender User Preferences menu. Here’s a picture with the User cat highlighted. Clicking “User” there just narrows all the addons down to just the ones you installed yourself so you don’t have to scroll through the whole list.

When you are supposed to place the MDL compiler in C:Program Files (x86)Steamsteamapps***user_name*** My source sdk file is not their I Have installed it from library/tools/Source Sdk but it is still not their, wrong download? Pls Help, If so Where is the correct download?

PS: Im Am Very new To 3d modeling/Community Item making and I have a feeling the Anwser is very obvious. 😛

I haven’t done any work with reskinned models so it might be a better idea to ask the developer of the model, but I downloaded ChemicalAlia’s Female Medic model just to see and it does include an .mdl. If hers are the ones you’re using, the .mdl is located under the modelsplayer subdirectory of the folder.

I am extremely busy this weekend, but I will try to look into this on Monday evening. I wish I could be more prompt, but please feel free to ask other sources in the meantime. Facepunch might be able to help, but make sure to read their forum rules before asking for help.

I’m stuck in step 5. When I’m supposed to unzip the .exe file to C:Program Files (x86)SteamSteamAppscommonSourceSDKbinep1bin I can’t find find SourceSDK folder, only Team Fortress 2, SteamVr and the rest of my games, but no SourceSKD. How can I find it?

Thanks for this. im trying to import scout’s scatter to make a 3d version to 3d printers, and this tutorial helped me a lot! but im so dumb, waited for 8 hours to download the wrong file, i downloaded source filmmaker instead of source sdk, source filmmaker have 8gb, and source sdk 500mb. now i figured out why i wasnt going through step 5 xD

Hey there! Thank you so much for the tutorial, very helpful! Question, though: This may be out of your expertise, but do you know if it’s at all possible to pose a model (eg with item, in stance) in say SFM or something, export that file in a a way that this process will also work?

Sorry, I don’t know for sure. My gut instinct is to say that it’s not because as far as I recall from my brief playing with it, SFM is not meant to export model poses.

I’m not sure about importing models (I only ever tried to do it with items because I had meant to try making an item once upon a time), but if, when you import the model, it also contains its skeletal mesh, you should be able to pose it in Blender. However, because the item is its own separate model, you would have to import it separately and add it to the scene.

I’m not sure why it would do that, but please bear in mind that this tutorial is several years old and may be out of date. It’s been a long time since I’ve tried to go through this process, so the steps may have changed in the meantime.

That said, one thing you could do is right-click Source SDK in your Steam Library, click Properties, and go to the Local Files tab. There, click the button that says Verify Integrity of Tool Files. This will check for errors or missing files in your SDK install and correct them if that’s the problem.