Garry's Mod

Garry's Mod

140 ratings
GMod: Recompiling decompiled playermodels that uses the Proportions Trick
By 8sianDude
This is a guide I decided to write out since several people had came out to me and asked about it, as well as a reference to use for myself when teaching people how to overcome compiling issues with models that utilises the Proportions Trick. This guide will mainly be focused on recompiling existing playermodels that uses the Proportions Trick, that were decompiled for whatever reason. Whether it may be to fix broken hitboxes for your TTT servers or to add a few custom bodygroups such as a hat.

This guide is mainly targeted for people who are planning to:
- Port a custom model to GMod
- Fix broken hitboxes on existing custom models on the GMod Workshop
- Add extra custom bodygroups to existing custom models on the GMod Workshop
- Adding custom animation set addons (such as Dewobedil's Custom Taunt addon) by including "$includemodel" in the QC

NOTE OF WARNING!
This guide might not 100% work for some people potentially due to the utilisation of different compiling and decompiling softwares. I strongly suggest using Crowbar when you compile and decompile GMod playermodels. I personally use Crowbar Version 0.24 for compiling and decompiling GMod models and had been using it since 2016. The majority of this guide will centre around using Crowbar 0.24. Other Crowbar versions may or may not work, as I tried with newer and latest versions, they tend to break the jigglebones. For this case, you may want to refer to Zeqmacaw's guide.

Do note that Source SDK 2013 Multiplayer must be installed in order to compile models for Gmod using Crowbar 0.24. This can be acquired through your Steam library under tools.

2
   
Award
Favorite
Favorited
Unfavorite
Introduction: What is "Proportions Trick"?
Proportions Trick is a method of bypassing forced skeleton alignment with the default animation set featured in many Source engine games such as Half-Life 2, Garry's Mod and Left 4 Dead 2. Originally discovered by CaptainBigButt during her 2014/2015 era of porting MikuMikuDance (MMD) models, the purpose of utilising the Proportions Trick is to use an existing set of animations for a custom model, without the need to make the animation set completely from scratch due to skeleton and mesh differences. In other words, if the model you're porting is shorter or taller in height, or even in a different mesh size (whether it may be shorter arms or legs), without the Proportions Trick, the custom model mesh will be distorted due to the skeleton being forced to the default positions and rotation.

Kind of like this:


In comparison to utilising the Proportions Trick:

(animation seen in the screenshots is the "idle_melee" animation)

Since implementing the Proportions Trick isn't the main focus of this guide, I won't be going in-depth. If you want to know how to implement it, I highly recommend you to check out a well written and summarised guide made by ZeqMacaw (author of Crowbar), which can be found here: https://sites.google.com/site/zeqmacaw/tutorials/proportion-trick
Decompiling (Crowbar, QC, codes & anims)
When decompiling a custom playermodel implemented with the Proportions Trick, you'll most likely end up with broken QC lines, particularly the $sequence lines due to the Proportion Trick utilising predelta options. Depending on the version of Crowbar you're using, the decompiled code lines can vary.

For example
Decompiling using Crowbar 0.24


Decompiling using Crowbar 0.56


(For me personally, I tend to favour Crowbar 0.24 for decompiling and compiling GMod models. In contrary, Crowbar 0.56 for decompiling and compiling L4D2 models.)



Furthermore, the playermodel you just decompiled will also have these files within the "anims" folder.


The file names can potentially vary depending on the author who initially ported the model with implemented Proportion Trick. Decompiling Dewobedil's ported playermodels for example:


Recompiling the decompiled files (QC, codes & anims)
When recompiling the decompiled files of the custom playermodel implemented with the Proportion Trick, there are a few things you'll have to change, check and look out for.

1) $sequence codes in the QC file
2) animation files within the "anims" folder
3) Hitboxes



1)
Firstly, you'll want to replace the following highlighted QC codes situated underneath "// $definebones"...


... with these codes:
$sequence reference "modelname_anims/reference.smd" fps 1 $animation a_proportions "modelname_anims/a_proportions.smd" subtract reference 0 $sequence proportions a_proportions predelta autoplay $sequence "ragdoll" "modelname_anims\ragdoll.smd" { fps 30 "ACT_DIERAGDOLL" 1 }
(replace "modelname" with the file names of the custom playermodel)


2)
Next, you'll want to go into the "anims" folder, delete "a_proportions" (file name can vary), copy and paste "ragdoll" into the root decompiled folder, rename "ragdoll" to "a_proportions", and move it back into the "anims" folder.


If you don't delete the decompiled "a_proportions" file and then recompile the playermodel, you'll get this abomination since the "a_proportions" animation file is somehow broken during the process of decompiling:


If done correctly, the model should compile to it's original size proportions without stretching limbs and other errors.



3)
When using Crowbar 0.24 to decompile GMod playermodels, hitbox codes in the QC may be commented out by the "//", thus recompiling the model will result in Crowbar automatically generating the hitboxes as shown in the following screenshots:




Just simply remove the "//" from the hitboxes and it'll fix the issue.




If you're planning on fixing a few broken hitboxes for your server, you can use Half-Life Model Viewer's (HLMV) "Bones" tab to do the alteration. Once done, just click "Generate QC", copy and paste it over the old hitbox codes in the QC file.


Conclusion
In summary, this guide should cover the basics of recompiling GMod playermodels that are implemented with the Proportions Trick. The methods and procedures covered in this guide are all from my own personal experience in overcoming decompiling issues with custom GMod playermodel. It may not 100% work simply due to different Crowbar versions, so I do highly suggest using Crowbar 0.24 when you're following this guide.

Additionally, if you don't want to follow my guide, you can check out ZeqMacaw's guide on overcoming decompiling issues, particularly on the topics of fixing glitched jigglebones with newer Crowbar versions: https://ad.gamersky.info/@steamcommunity.com/sharedfiles/filedetails/?id=1774302855

If you want to learn how to implement proportions from the ground up, MSF wrote a pretty in-depth guide on it for L4D2. The same concept can be applied for Gmod as well: https://ad.gamersky.info/@steamcommunity.com/sharedfiles/filedetails/?id=887935033

CaptainBigButt's very in-depth guide on implementing Proportions Trick is now available as well:
https://ad.gamersky.info/@steamcommunity.com/sharedfiles/filedetails/?id=2308084980
69 Comments
Merken 21 Feb @ 8:28am 
I didnt read anything I just saw sakuya and I inmediatly cliked
ndhart321 2 Mar, 2024 @ 7:46pm 
sakuya!!!
Бездельник 3 Oct, 2022 @ 11:03am 
The method does not work
7ᴇᴍᴘᴇsᴛᴲ 20 Sep, 2022 @ 8:21pm 
Very gud yaaay
Lumarisson 22 Jun, 2021 @ 4:53am 
hello, I may have done all this my model is still stretched...
Pedro 31 May, 2021 @ 7:13am 
for some reasons crowbar says i got a proportions duped : Duplicate animation name "a_proportions" can't find where the duplicate is
8sianDude  [author] 13 Aug, 2020 @ 7:31pm 
There can be a number of factors that may cause the stretching issue afaik:
- reference file is missing from the anims folder
- compiling sequence is incorrectly structured or incorrectly named
- decompiling playermodels using different versions of Crowbar

Or, decompiling a playermodel that didn't even have the proportions trick implemented.
the names jim fist 13 Aug, 2020 @ 6:43pm 
After doing this the proportions on my model are still stretched and look weird, like in the first picture. Is there anything I'm missing?
Maverick 30 Jan, 2020 @ 4:18pm 
Ahh. I think just using default ones would work but I honestly don't know how to do any of that. I've tried figuring it out. Though I mainly just care about changing the group type of the head hit box so it registers as a head.
8sianDude  [author] 30 Jan, 2020 @ 1:37pm 
It depends on whether the model you decompiled have a really messed up and broken hit box or not. Alternatively, you can decompile default HL2 male citizens hitboxes and use those as your reference in the QC.