Adding Extra Skins to Existing Models
by Le Chief (view all articles)

1 rating / 4 stars
Describes how to add extra skins to existing compiled models in the Source engine
by Le Chief (view all articles)

1 rating / 4 stars

The source engine has a new feature that allows level designers to easily use different skins for the same model. You may have notice that if you opened the Hammer model browser, some models have multiple skins such as the oil drum.
This tutorial will explain how we add custom skins to existing models. This tutorial will also be useful if you're a modeler and you want to have multiple skins for your model. So lets begin.
For this tutorial, you will need two programs which can be downloaded from this website.
-Model Decompiler (takes apart the model so we can edit it)
-Studio Compiler (reassembles the model after we have edited it)
Step 1
You need to download a program called "MDLDcompiler" (model decompiler) from this website. Remember, you need to place the exe file in the Source SDK bin folder. So for example, if you're using this for a game using the Ep1 engine such as Half-Life 2 or Counter-Strike Source, you would place mdldecompiler.exe in steamappsusernamesourcesdkbinep1bin.
Step 2
Prepare your model to be compiled, stick all 6 files that are part of the model on a folder on your desktop or somewhere uncluttered and make sure you extract the model out of a gcf if you want to modify one of the original models. Now run mdldecompiler.exe and select the model's *.mdl file in the "choose model file" field and select an output directory for the model source files to be dumped and "extract". Please note you may have to manually enter the path names if you have "Use Steam Access" enabled.
If you're getting the "Extra App ID set to 211, but no SteamAppId" error, please go to the gameinfo.txt file of the game/mod that Source SDK is currently set to and put two forward slashes ( // ) in front of the line "ToolsAppId 211" or set your Source SDK to Half-Life 2 and go to steamappsusernamehalf-life 2hl2, open the gameinfo.txt file and put two forward slashes in front of "ToolsAppId 211" like this: "// ToolsAppId 211". Be sure to remove the slashes after you have finished with this tutorial.
Step 3
Once you have decompiled the model, go to the output directory and open the mdldecompiler.qc file with notepad
Step 4
Now go to your skins and rename them to fit the Half-Life 2 naming system. So for example, the vending machine skin is called ‘SodaMachine01a.vmt', so rename your skins to ‘SodaMachine01b.vmt, SodaMachine01c.vmt, SodaMachine01d.vmt' and so on. You also need to make sure that you stick the skins in the corresponding directory, so for the vending machine, the skins would be placed in steamappsSourceModsmodnamematerialsmodelsprops_interiors if it's a mod because the original vending machine skin is found in "source materials.gcf/hl2/materials/models/prop_interiors".
Step 5
Once you have renamed the skins and placed them in the correct folder, go back to the mdldecompiler.qc file in notepad and underneath the line $cdmaterials "modelsprops_interiors/" (vending machine example) add:
$texturegroup skinfamilies
{
{ "SodaMachine01a.vmt" }
{ "SodaMachine01b.vmt" }
{ "SodaMachine01c.vmt" }
{ "SodaMachine01d.vmt" }
}
Ofcourse, adjust what you have just pasted to suit the number of skins you want to add, in this example, we have the original skin plus 3 custom skins, you may want the original and 1 other skins or the original and 10 other skins.
Step 6
Your model is now ready to be recompiled. Download StudioCompiler from here and install it to the same directory as you installed MDLDcompiler. Once its installed, open StudioCompiler.exe.
Step 7
Ensure you are on the Model Compile tab and click "Compile w/Existing QC. Browse for the QC file in the appropriate field and click compile!
Special thanks to Riven for originally helping me figure out how this is done!
This tutorial will explain how we add custom skins to existing models. This tutorial will also be useful if you're a modeler and you want to have multiple skins for your model. So lets begin.
For this tutorial, you will need two programs which can be downloaded from this website.
-Model Decompiler (takes apart the model so we can edit it)
-Studio Compiler (reassembles the model after we have edited it)
Step 1
You need to download a program called "MDLDcompiler" (model decompiler) from this website. Remember, you need to place the exe file in the Source SDK bin folder. So for example, if you're using this for a game using the Ep1 engine such as Half-Life 2 or Counter-Strike Source, you would place mdldecompiler.exe in steamappsusernamesourcesdkbinep1bin.
Step 2
Prepare your model to be compiled, stick all 6 files that are part of the model on a folder on your desktop or somewhere uncluttered and make sure you extract the model out of a gcf if you want to modify one of the original models. Now run mdldecompiler.exe and select the model's *.mdl file in the "choose model file" field and select an output directory for the model source files to be dumped and "extract". Please note you may have to manually enter the path names if you have "Use Steam Access" enabled.
If you're getting the "Extra App ID set to 211, but no SteamAppId" error, please go to the gameinfo.txt file of the game/mod that Source SDK is currently set to and put two forward slashes ( // ) in front of the line "ToolsAppId 211" or set your Source SDK to Half-Life 2 and go to steamappsusernamehalf-life 2hl2, open the gameinfo.txt file and put two forward slashes in front of "ToolsAppId 211" like this: "// ToolsAppId 211". Be sure to remove the slashes after you have finished with this tutorial.

Step 3
Once you have decompiled the model, go to the output directory and open the mdldecompiler.qc file with notepad
Step 4
Now go to your skins and rename them to fit the Half-Life 2 naming system. So for example, the vending machine skin is called ‘SodaMachine01a.vmt', so rename your skins to ‘SodaMachine01b.vmt, SodaMachine01c.vmt, SodaMachine01d.vmt' and so on. You also need to make sure that you stick the skins in the corresponding directory, so for the vending machine, the skins would be placed in steamappsSourceModsmodnamematerialsmodelsprops_interiors if it's a mod because the original vending machine skin is found in "source materials.gcf/hl2/materials/models/prop_interiors".
Step 5
Once you have renamed the skins and placed them in the correct folder, go back to the mdldecompiler.qc file in notepad and underneath the line $cdmaterials "modelsprops_interiors/" (vending machine example) add:
$texturegroup skinfamilies
{
{ "SodaMachine01a.vmt" }
{ "SodaMachine01b.vmt" }
{ "SodaMachine01c.vmt" }
{ "SodaMachine01d.vmt" }
}
Ofcourse, adjust what you have just pasted to suit the number of skins you want to add, in this example, we have the original skin plus 3 custom skins, you may want the original and 1 other skins or the original and 10 other skins.

Step 6
Your model is now ready to be recompiled. Download StudioCompiler from here and install it to the same directory as you installed MDLDcompiler. Once its installed, open StudioCompiler.exe.
Step 7
Ensure you are on the Model Compile tab and click "Compile w/Existing QC. Browse for the QC file in the appropriate field and click compile!

Special thanks to Riven for originally helping me figure out how this is done!