How to Resize/Edit existing models

Discussion in 'Tutorials & Resources' started by Fantasma, May 30, 2014.

  1. Fantasma

    aa Fantasma

    Messages:
    882
    Positive Ratings:
    969
    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.
     
    • Thanks Thanks x 9
    Last edited: Mar 25, 2016
  2. Seba

    aa Seba DR. BIG FUCKER, PHD

    Messages:
    2,363
    Positive Ratings:
    2,365
    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.
     
  3. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,213
    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.
     
  4. Berry

    aa Berry Sharing is caring, and I don't care

    Messages:
    979
    Positive Ratings:
    1,461
    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)
     
  5. Beetle

    Beetle L9: Fashionable Member

    Messages:
    627
    Positive Ratings:
    141
    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.
     
  6. Fantasma

    aa Fantasma

    Messages:
    882
    Positive Ratings:
    969
    Not if you use crowbar (which is why I made the tutorial)
     
  7. henke37

    aa henke37

    Messages:
    1,836
    Positive Ratings:
    420
    Uhm, don't you have the option to scale models in hammer nowadays?
     
  8. Fantasma

    aa Fantasma

    Messages:
    882
    Positive Ratings:
    969
    Yes, that requires a prop_dynamic (a lot more costy) and doesn't display in the viewport.
    This tutorial also helps with editing models.
     
  9. Snowshoe

    Snowshoe L2: Junior Member

    Messages:
    53
    Positive Ratings:
    60
    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.
     
  10. xomp

    xomp L1: Registered

    Messages:
    33
    Positive Ratings:
    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: Sep 6, 2014
  11. PC's_Frank

    PC's_Frank L4: Comfortable Member

    Messages:
    179
    Positive Ratings:
    26
    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: Feb 15, 2015
  12. Seba

    aa Seba DR. BIG FUCKER, PHD

    Messages:
    2,363
    Positive Ratings:
    2,365
    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.
     
  13. fisheye

    fisheye L1: Registered

    Messages:
    7
    Positive Ratings:
    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?
     
  14. takabuschik

    aa takabuschik

    Messages:
    660
    Positive Ratings:
    308
    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
     
  15. Seba

    aa Seba DR. BIG FUCKER, PHD

    Messages:
    2,363
    Positive Ratings:
    2,365
    It's been a while since I last decompiled, but ~two months ago I still had this problem.

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

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,819
    Positive Ratings:
    4,661
    Additionally the collision won't update with the new size.