How to make a viewmodel

Yup. I said it. How do you make a View Model, I’ve heard a bunch of different things, but I want to know the textbook, step by step process in making a view model.

The easiest way would be by studying a Valve viewmodel, and recompiling it with slight changes. There’s no specific textbook process since there’s many methods to get to the finished product. For example, the process could vary greatly depending on your modeling program. Here’s what I’d suggest.

  1. Get GCFScape and a program that can decompile .mdl models.
  2. Get an .smd import and export plugin for your modeling program.
  3. Extract and decompile a viewmodel from Half-Life 2, Counter-Strike: Source or Day of Defeat: Source (they all use roughly the same system).
  4. Recompile it without any changes and see if it works ingame. If not, post about it then proceed.
  5. Import the reference .smd to a 3D modeling program, and study it. Observe how certain model vertices are weighted to certain bones, and move some bones around manually - you’ll see parts of the model move in tandem.
  6. Once you’ve studied the reference .smd enough to be comfortable with it, make whatever changes you want and recompile it.

You should, using this process, end up gradually replacing more and more of Valve’s content with your own.

Okay, I’ll try it out soon, and one more question, How do you fix the crotch-gun error?

The “crotch-gun error” is caused by a world model being weighted to bones that a skeleton doesn’t have. For example, the HL2 multiplayer (used in GMod) models are on the HL2 biped skeleton. Weapon world models from HL2 are weighted to the right hand bone of the HL2 skeleton, so they appear fine in HL2 and GMod. World models that work in Counter-Strike: Source, Day of Defeat: Source, and many other Source games will not work because they are weighted to bones that the HL2 skeleton doesn’t have. Since it can’t find the bone, it’ll just center itself on the root bone (ValveBiped) which happens to be in the crotch of the skeleton.

The only way to fix this is to decompile the buggy weapon world model, re-weight it with a different bone/bones, and recompile it.

What is the model is one I’ve made from scratch?

You must rig it to the right bones or the model wont hold/position the weapons correctly (as was said before). So you must make/import some bones, name them the same as the vale biped ones and rig you model to them. Its a good idea to decompile some exisiting weapons to get a feel for how they are rigged so you know whow to rig yours, also if you’re not gonna make custom anims you will have to use an exisiting skeleton, but if you do under no circumstance will you move the bones or else the anims will fail to work/deform your mesh horrifically.