These are my own documented steps on how to turn cosmetics from Steam Workshop into bodygroups for custom TF2 player models
-
Download Crowbar: https://steamcommunity.com/groups/CrowbarTool
-
In this guide I will use the following Gmod addon: https://steamcommunity.com/sharedfiles/filedetails/?id=332220769
-
Extract the .gma file (tf2_hex_-_mountain_lab_accident_332220769.gma) using /Steam/steamapps/common/GarrysMod/bin/gmad.exe
-
Place everything in a tf/custom folder, e.g. mountain_lab_accident. This makes it easier to test the model later on in HLMV. Here is how my folder structure looks like:
tf\custom\mountain_lab_accident\models\workshop\player\items\medic\scientist_head
tf\custom\mountain_lab_accident\models\workshop\player\items\medic\scientist_pants
tf\custom\mountain_lab_accident\models\workshop\player\items\medic\scientist_shirt
tf\custom\mountain_lab_accident\materials\models\workshop\player\items\medic\scientist_head
tf\custom\mountain_lab_accident\materials\models\workshop\player\items\medic\scientist_pants
tf\custom\mountain_lab_accident\materials\models\workshop\player\items\medic\scientist_shirt
-
Open Crowbar and click on the "Decompile" tab
-
Browse and select one of the .mdl files. I will start with "models\workshop\player\items\medic\scientist_head\scientist_head.mdl".
-
Change Output directory if you wish. I prefer using "Subfolder (of MDL input)"
-
Click Decompile. You can leave all decompile settings to default. Now you'll have a "decompiled 0.72" folder in the scientist_head folder.
-
Next you will want to decompile the Medic player model. To extract the Medic model, use GCFScape. Extract all "models/player/medic" files (.dx80.vtx, .dx90.vtx, .mdl, .phy, .sw.vtx, .vvd, _animations.mdl, _user_animations.mdl) to a folder by opening "tf/f2_misc_dir.vpk". As mentioned earlier I like using the tf/custom folder to place new files, so I will place them in
tf/custom/mountain_lab_accident/medic_model
-
With the Medic model extracted, use Crowbar and point to "medic.mdl", and then click on Decompile.
-
Now, copy all the scientist_head decompiled files over to the Medic decompiled folder. (scientist_head/decompiled 0.72/ -> medic_model/decompiled 0.72/)
-
Since scientist_head has its own facial flexes, this will be tricky. I don't know how to add bodygroups that use their own facial flexes. I will instead add it as its own model inside medic.qc. Is this the right approach? I have no idea.
-
Open "scientist_head.qc" with a text editor
-
Copy
$model "default" "berliners_bucket_helm_reference.smd" {
starting at line 5 down all the way down to line 143. -
Now paste this into medic.qc underneath the end bracket of
$model "medic" "medic_morphs_low.smd" {
Here is how it should look: https://pastebin.com/UtB5ATb7 -
Now we'll want to include the lod model. Since there is only one, I have added
replacemodel "berliners_bucket_helm_reference.smd" "berliners_bucket_helm_reference_lod1.smd"
to $lod 44 and later. -
Add
$cdmaterials "models\workshop\player\items\medic\scientist_head\"
underneath$cdmaterials "models\player\items\all_class\"
-
Now compile by clicking on the Compile tab on Crowbar. Select Team Fortress 2 as the game, and select medic.qc as QC input file. Now click Compile. If this doesn't work then set up the Steam library path in the "Set Up Games" tab.
-
Now you should have new medic model files in the output folder you chose. You can inspect medic.mdl using HLMV and see how it looks. You can compare your medic.qc file with mine here: https://pastebin.com/XcSCTTg8
There is an issue here where the scientist head is clipping through Medic's facial mesh. I don't know what's causing this. It might be because this was not set up as a bodygroup, however I had success using the same approach with another Engineer facial cosmetic (Big Texas chin).
-
Todo: write skinfamilies instructions & ubercharge texture support