Nearly all existing tutorials are several years old and outdated, so I decided to make one myself. This is probably not the best way, but it’s how I do it, and it seems to work.
Note: This tutorial assumes you have a basic knowledge of Source. IE you know how to make a QC, set up textures, etc.
I’m using Blender, the steps will be different for 3DSMax or Maya.
Now, when you have a model, the first thing you should do is ask: Is it rigged to the ValveBiped skeleton? If it is, skip Section 1.
Section 1-Repurposing Rigging
Alright, you have a ragdoll, you’ve decompiled it and loaded it into a 3D editor. Now you need the rig it to the ValveBiped skeleton. To get one, decompile any Half-Life 2 model. I recommend “models/humans/male_01.mdl”.
I don’t know about everyone else, but I cannot rig. I’m terrible with the Weight Paint tool and I don’t know how to do it in Max. So, here’s a trick to get around that.
Select the model, click the Object Data tab, then open Vertex Groups. You’ll see a list of all the bones the model is rigged to. Now, rename them all to match the ValveBiped bones. If you pose the model a bit you’ll see the mesh automatically jump to the bones as each group is renamed.
After all the weights are renamed, you may need to adjust the bone positions to match the mesh.
Tada! Your model is now on the ValveBiped, and without rerigging!
Section 2-Adding Animations
If the model was just a ragdoll, you need to give it animations or else it’ll be t-posing around.
Open your QC, then add the following lines, corresponding to the model gender/type.
Male: $includemodel m_anm.mdl
Female: $includemodel f_anm.mdl
Zombie: $includemodel z_anm.mdl
Section 3-Enabling it In-Game
Once your model is on the ValveBiped and has animations, you need to do some Lua scripting in order for it to appear in the playermodel list.
Navigate to “…\Steam\steamapps\common\GarrysMod\garrysmod\lua\autorun” and create a new .LUA file. The name of the file doesn’t matter.
player_manager.AddValidModel( "Model Name", "models/ModelPath/Model.mdl" )
This line adds the model to the playermodel list. “Model Name” will be the name of the model when you hover over the icon. ModelPath is your $modelname path.
player_manager.AddValidHands( "Model Name", "models/ModelPath/HandsModel.mdl", Skin#, "Bodygroup#" )
This line give the model custom hands. If your hands model has skins or bodygroups, you can toggle them on a per-model basis. That way if you have multiple playermodels you can put all their hands into one .MDL file.
And that’s it! Your model should now appear in the list. If it has paintability, skins, or bodygroups, you can change those in the tabs just like any other playermodel.
Model is the DBS Striker from my Sleeping Dogs pack, the map is nt_pissalley_ctg from the mod NeoTokyo.
If you need any clarification just ask. I don’t know how well I explained things.