Team Fortress 2

Team Fortress 2

Not enough ratings
TF2 Mapper's Resource: Decompiling, Reskinning, and Recompiling a model
By alexrox360
Found a good model but it doesn't have the right texture for your map? Looking to broaden out with skins that fit your map? This guide will help you learn decompiling, reskinning, and recompiling your model for TF2.
   
Award
Favorite
Favorited
Unfavorite
Introduction
So if you're here, you're probably wondering how to reskin some cool prop you found on Gmod. Well, you're in luck because I've tried and done it before with my first jailbreak map, jb_carnival. This guide will teach you all you need to know about reskinning and editing them so they can be recompiled into a skin of your choice!
Programs Needed
Before we start, you’ll need these tools installed to start reskinning models.

Decompiling and Recompiling models:
Crowbar
This is a compiler that can edit and compile models, which we’ll use to decompile and recompile our models to TF2.
https://steamcommunity.com/groups/CrowbarTool

Image editing:
Paint.net or Gimp
You can use one or the other to make your own custom images to use in your model
https://www.gimp.org/
https://www.getpaint.net

VTFedit
This can be used after making your custom image to turn into useable VMT and VTF files for the model to locate and use.
gamebanana.com/tools/95
Getting a .mdl file
You can use any .mdl file with Crowbar to decompile and get it’s QC file for editing. For my example I will use a Gmod model from Sm Sith Lord’s Simpson’s Arcade Cabinet.
(I am not taking ownership of any of the models I’m editing, they belong to their creators)
https://steamcommunity.com/sharedfiles/filedetails/?id=189926770
Extracting from Gmod (.gma)
If you’re not pulling models from Gmod skip this step to Decompiling with Crowbar.
To get a Gmod Workshop model out of it’s gmod format, we’ll need to find it in
steamapps/common/Garrysmod/garrysmod/addons. Search here for your addon you wish to pull.

Next, look inside the first bin folder in /Garrysmod and find an .exe that says GMAD on it. This tool decompiles the model to it’s.mdl form to use in Crowbar.

To use, just drag your .GMA file with your model, and drop onto the GMAD exe, and it will create a folder with your model inside it.

I would recommend grouping all your Gmod decompiled folders into one area to better find them.
Decompiling with Crowbar v0.71
Once you have your .mdl file, open up Crowbar. On the first time your screen should look something like this.



Go to your Decompile tab, and browse for your Input and Output folder paths. For the input, go to your new .mdl file you just created, and for the output, find the folder where you’ll want to put the QC file in.



Sometimes it won’t recognise a folder as an output, so whichever output folder you put it in, put a dupe .zip file inside it. It won’t be used for compiling, just there so Crowbar will recognise the folder.
Hit decompile, and a QC file with some other files will appear in your output folder.
Making your Reskins
Inside your Mdl folder, you’ll notice it also decompiled the extra VTFs and VMTs it used for the model. Look at the size of each texture in VTFEdit and look at the layout of the VMT in Notepad. Keep this in mind when you replicate it for your replacement textures.

In Paint or Gimp, resize your chosen images to what the VTF’s size specifies. For my example, the VTF’s original size was 512x512, so I resized all of my alternate files to that size to match.



In TF2’s files, go to the materials/models folder. This is where the Gmod Mdl texture files will go. Copy all the folders inside the materials/ folder inside the Mdl folder to your tf folder. This is necessary when we start making alternates, and so the resulting model file will be able to find the needed materials in it’s model.



Now go to VTFEdit with your alternate textures, go to Format and hit Auto Create VMT. This will speed up the process of creating your VMT. Name your VTF alternates something along the same lines as the skin being replaced, but with it’s own custom name. For my example, I’ve named one of my alternates “digdugmarquee” and “digdugscreenglow” to match “simpsonsmarquee” and “simpsonscreenglow”
Save your reskin images to the right folder where the VTF and VMT’s you need to replace are. For my example, my reskins will go into the smarcade folder.



If there are any other VMT’s that the model uses that you didn’t make with VTFedit, copy them and rename them to use in your reskins.
Now, for the reskin VMTs, copy everything used in the OG VMT’s files over to your VMT, while keeping your texture name the same. This also goes for any additional VMT’s in the model
Copy over the materials you aren’t going to change from the Model’s folder to the tf/materials/models folder.
Editing your .QC model file
https://developer.valvesoftware.com/wiki/$texturegroup
Open your QC file with Notepad. To include new skins, add $texturegroup skinfamilies underneath CDmaterials like shown in my example.



Each line is one skin, and each new name in the skin line is a texture being changed. Separate each line into a bracket holding all of the skin names inside, and separate each skin name with “X” . For this example, since my original skin uses 2 textures it switches between



Note that something like $staticprop is also there. This defines whether an object can be dynamic, physics, or static. For instance, I’d you wanted to turn a dynamic prop in game into a static prop, put $staticprop into it’s qc file.

If you plan to put it back into a custom folder you have, go to your named custom folder and put it in it’s Models folder. If you don’t have a named custom folder, or don’t know what it is, see this guide that Wormatty made about organizing custom content:
https://steamcommunity.com/sharedfiles/filedetails/?id=2216526350

Change the model’s $modelname pathway from whatever it is previously to (username)/(insert model subfolder)/model files

For example: example:
$modelname "props_japan_ow/boss_key.mdl"
To
alexrox360/props_japan/boss_key.mdl


Compiling to a Model
Now go back to Crowbar and select your game for the Output file. If you don’t have your game filepath set up, see First time game setup. If you have it set up already, continue to Recompiling

Hit the Compile button, and the final product should show up in tf/models. If you’re using your custom folder path, drag and drop your files into the (username)/models folder.

Go to Hammer and put down your model somewhere. If you followed directions you should have a new model with multiple reskins!

First Time Game Setup for Crowbar
When we recompile the model, you will need to select the TF2 game from the Game Selector drop down to find it’s output /model folder. It will automatically look inside your :/C drive for the steam library and the game. If you have your steam library in another drive, you will need to manually specify to Crowbar where your materials are.
(png)
Go to you Game Selector and click Add to add another game. Label it something like TF2 (My Folder) so it won’t overwrite the current Team Fortress 2 selection.
(png)
From here, find each file it requires to run the program by browsing your TF2 folder for each file.
Afterwards, everything should be set up for recompiling.
(png)
Extra Help
If you still need help with things, these video guides covered things well.