How to Resize/Edit existing models

Fantaboi

Gone and one day forgotten
aa
Mar 11, 2013
892
1,050
How to Resize/edit an existing model!

Ever had a perfect model in the perfect brush, yes it's a satisfying feeling but what if the model is too big or small to fit properly where you want it? What if one of the wood beams clips the building below it? With this tutorial you'll be able to decompile the model, edit it to what you want, and recompile it fuss free.
What you need:
You’re going to need a few programs, fortunately they’re all freeware:
  1. Guistudiomdl
  2. Crowbar
  3. Notepad
  4. Gcfscape

Extracting the model
To begin, you’re going to need to get the model by itself, using GCFSCAPE go into the tf2_misc_dir.vpk File and extract the model files you need. (all the models are in the /models directory)

With each model you'll need the following files:
Modelname.dx80.vtx
Modelname.dx90.vtx
Modelname.mdl
Modelname.phy
Modelname.sw.vtx
Modelname.vvd

Decompiling the model
Open up crowbar and select the .mdl file of the model you want to resize, once loaded click DECOMPILE, there should now be a new bunch of files.
These are the settings I use, I recommend something similar

Rescaling the model
In the folder you have extracted the files to, find MODELNAME.qc and open it in notepad.

Add one of the following DIRECTLY BELOW the file name.

$scale 0.5 (for half the size)

$scale 2.0 (for double size)

$scale 0.25 (for quarter size)

$scale 1.0 (for the regular size)

Once done, change the model name, I usually add _Small to the end, this is to prevent conflicts with the original model.

Be sure to edit the collision mesh with the changes you made to the original (the _phys.smd file is the collision mesh)

For example

Extra Changes
If you want to make any other changes to the model, for example rotating it 90 degrees or cutting a part of it, you can edit the _REFERENCE .SMD file in your favourite source modelling tool (For example 3ds max with wallworm plugin)


Recompiling
Open GuistudioMdl and set it up the team fortress 2 directory like so

In your team fortress 2 Folder, you're going to need to manually make the folders shown in your .qc file, for example I had to manually make the /models/egypt/pillar folders when recompiling pillars.qc

Then select the .qc file you have been editing, and press COMPILE
Again, these are the settings I use

Grabbing your new model
Granted you did everything correctly it should turn up in the model browser like any other model! Like this

Packing
Make sure you pack your models into your map when releasing it, or else users will receive big read ERROR models around the map.

Conclusion
Hopefully that’s all you needed to know with resizing a model permanently, So be sure comment below if you find any issues so me, another mapper or void can help fix your issue.
 
Last edited:

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
Finally we'll have something to link to people asking about this, thanks. Might want to mention that props without collisions don't have .phy files though, just in case someone starts panicking when decompiling their first model.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Doesn't decompiling and recompiling also have the side effect of rotating the prop 90 degrees? I hate it when I get edited props in that condition; it's unintuitive and untidy to have similar props that have to be rotates differently after being placed. I recall reading somewhere that you can change a prop's rotation manually to counter this by editing the .qc file, but I forget how.
 

Berry

resident homo
aa
Dec 27, 2012
1,056
1,898
Doesn't decompiling and recompiling also have the side effect of rotating the prop 90 degrees? I hate it when I get edited props in that condition; it's unintuitive and untidy to have similar props that have to be rotates differently after being placed. I recall reading somewhere that you can change a prop's rotation manually to counter this by editing the .qc file, but I forget how.

If you're using blender, you have to import it with the Y axis as the up axis (for some dumb reason Z is default)
 

Beetle

L9: Fashionable Member
Aug 17, 2008
627
178
If you're using blender, you have to import it with the Y axis as the up axis (for some dumb reason Z is default)

I assume that's only the case for decompiling then recompiling? because I don't have to do that when it's my own original model.
 

Fantaboi

Gone and one day forgotten
aa
Mar 11, 2013
892
1,050
Doesn't decompiling and recompiling also have the side effect of rotating the prop 90 degrees?

Not if you use crowbar (which is why I made the tutorial)
 

henke37

aa
Sep 23, 2011
2,075
515
Uhm, don't you have the option to scale models in hammer nowadays?
 

Fantaboi

Gone and one day forgotten
aa
Mar 11, 2013
892
1,050
Uhm, don't you have the option to scale models in hammer nowadays?

Yes, that requires a prop_dynamic (a lot more costy) and doesn't display in the viewport.
This tutorial also helps with editing models.
 

Snowshoe

L2: Junior Member
May 16, 2012
53
125
As a general rule, feel free to disregard and/or discard any .sw.vtx files. As far as I'm aware, TF2 does not have a directx 7/software mode. The only files needed are .dx90.vtx and .dx80.vtx.

It saves filesize during packing, depending on how many custom models you have. Sometimes it's a negligible difference and other times it's a good chunk saved. Regardless, keeping .sw.vtx files around is pointless for TF2. Same with those useless .xbox.vtx files.
 

xomp

L1: Registered
Jun 28, 2008
33
8
I've noticed that when re-sizing a model that has gibs/physics, the physics are drastically changed. How would you solve that problem?
 
Last edited:

PC's_Frank

L4: Comfortable Member
Aug 29, 2012
178
24
This guide is pretty good, but I have a question. When you say to also re-edit the collision mesh, may it also be found in the same smd file, or is it a separate file placed elsewhere? Also, where can I find a QC file?
 
Last edited:

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
All the files necessary for recompiling should be dumped in one place, but I don't remember the naming conventions of the decompiler so I can't tell you what the collision model will be called. However, it's possible the model doesn't have a CM, in which case there won't be an .smd for that. The .qc is also dumped with the rest of the files.
 

fisheye

L1: Registered
Feb 28, 2009
7
1
Been a while since I done any mapping/modelling, but I remember that decompiling models always broke the smoothing groups. Is that still the case?
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
Been a while since I done any mapping/modelling, but I remember that decompiling models always broke the smoothing groups. Is that still the case?

It's been a while since I last decompiled, but ~two months ago I still had this problem.

You can now resize them through the scale property in the entity menu (as long as it isn't prop_static or prop_detail-- I recommend using prop_dynamic)

So basically decompiling isn't needed any longer

Keep in mind the models won't update in hammer so if you're basing some brushwork off the model recompiling is better (probably)