Garry's Mod

Garry's Mod

83 ratings
Bob's Guide : How to port VRChat/Unity & Other models into Gmod easily!
By 乃ㄖ乃爪卂匚 Ü
• Another useful guide for players & creators who wants to port VRChat/Unity and other models into GMod.!
I learned alot stuffs for this guide like l4d2 one. I commissioned models. I faced problems but now i made this for y’all.! •

★No Unity engine required but “Well” prepared model and textures required! ★

★ As far as the update, You can port other models from model sites such as (Deviantarts , Sketchtab & others sites) as your model is fine! ★

~ I spent a week on this guide so consider rating or awarding this guide. I would be happy.! ~

Thanks y’all for ratings!! :D
3
2
2
2
   
Award
Favorite
Favorited
Unfavorite
+*Notes & things to know*+
⚠ Read & follow all the instructions carefully or you'll probably run into errors! ⚠
➤ So, This guide may be hard to do in your first time. But you'll probably become professional at porting models later.

➤ This guide will also learn you "Blender basics , Qc. coding , Common problems and basic lua codings for PM & NPC".

➤ Remember to check **Troubleshooting** tab if you got any problems!.

➤ Also I tried my best to make the guide easy as possible so don't worry. Sorry for alot of scrrenshots.. but it can makes you understand faster!.

“Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work.” - Steve Jobs

So don’t get bored when you see alot of sections and alot of stuffs to do! It’s nothing compared to real world!!

══════════════════════════════════════════
+*Requirements*+
★ Checking Model compatibility & Requirements ★

So, Before we starts, We'll look into model requirements to port.
⚠ Stop here if your model doesn't meet these requirements but mostly you'll fine.!
For MMD and Unitypackage types, Check under section!⚠

❖ Requirements ❖
  • Model format must be FBX, OBJ , gltf or Blend file (most of booth.pm models have blend. files)
  • Model must contain "Textures (png.)" files. (Not necessery bcuz' most vrc models come with png.)
  • Model must be rigged and every first bones parents must be hip. Pelvis must be the root bone and no bones should be beside the Pelvis, but they can be under it. (No need to worry bcuz' most models are already rigged and set their first bones to hip.)
  • Model can't be have more than 4 spine bones. (but no need to worry that much if your model is not a big guy. :p)
  • Fingers are optional. (You can port the model even it has 1 finger..)
  • Model can't be a heavy model with 100k polygons or something more..
    (You’ll have to optimize the model until heavy model part only lefts 11-12k vertices.)
    (And you can still continue if your model have alot of bodygroups already.)
    💡 : To see bone counts and others. Just click "Viewport overlay" and check ☑ "Statistics". And press "Tab" while your model bones are selected and you'll see.

    ⚠ Update : Models bones can be collapse if it's more than 256 bones.. Visit +*Bopne collapse*+ after passing +*Qc editing & Jigglebones*+.. Don't visit early :p.

    ════════════════════════════════════════════

    Viewport overlay & Statistics



    Edit mode & bone counts while model "Armature" with green stickman icon selected..


    ════════════════════════════════════════════

(We're gonna use dmx. in this guide not smd.)
★ If your meet all requirements, you're free to go.! ★
+*Tools for MMD & Unitypackage*+
★Tools you may need if your model is MMD (pmx.) or unitypackage..★

You may need these to import MMD (pmx) and extracting unitypackage into fbx.
⏚ Cat Blender Plugin : Essential for importing MMD models, Optimising models and more for MMD & Vrchat models both.
➤Link : https://github.com/absolute-quantum/cats-blender-plugin
As my recent discovery , there may be a error when you import the addon into blender so use “Youtube” if error appears!

══════════════════════════════════════════

⏚ EasyUnitybundleExtractor : A tool that can extract the unitypackage. into files including fbx. & png. textures.
➤Link : https://github.com/HakuSystems/EasyExtractUnitypackage
I used this before and it goes smooth!.

══════════════════════════════════════════

⏚ UABE : Another tool that can extract the unitypackage. Haven’t used this before but ik it can..
➤Link : https://github.com/SeriousCache/UABE

══════════════════════════════════════════
+*Tools and Software*+
══════════════════════════════════════════
★ 3D Software and Add-ons ★

Blender : Blender will be used for this guide but any 3d software that exports to DMX will work.
Link : blender.org/download

Blender Source Tools : A Blender addon needed to export DMX files from Blender.
Link : steamreview.org/BlenderSourceTools

══════════════════════════════════════════
★ Tools and Editors ★

Crowbar : A toolbox to decompile models and other useful tools.
Link : github.com/ZeqMacaw/Crowbar/releases

VTFEdit : An tool to convert images to VTF.
Link : github.com/NeilJed/VTFLib/releases

Notepad++ : A simple text editor.
Link : notepad-plus-plus.org/downloads

VS Code : A powerful text editor.
Link : code.visualstudio.com

Source Engine Support : A extension for VS code to support source engine files.
Link : marketplace.visualstudio.com/items?itemName=stefan-h-at.source-engine-support

══════════════════════════════════════════
★ Scripts and Templates ★

Bone naming script : To rename bones + save your time..
Link : drive.google.com/file/d/1ixOJSOR9n4pFavBIpa1FqXm_KqmTDewl/view?usp=sharing
• Big credit to @Darkshoro (Original creator of the script and my inspired guide.)

Proportion Trick : One of most important scripts.
➤Link : github.com/sksh70/proportion_trick_script

Template : Essential for most steps
★ (Contains Dmx qc. Physic mesh + Size reference & Source tool plugins ★

Link : https://drive.google.com/file/d/1XAm994QyV4IOZmS-hfl9KcsIm4nF8opY/view?usp=drive_link

══════════════════════════════════════════
+*Setup*+
★ This is to show how to setup the project and tools. ★

════════════════════════════════════════════
Project Files
To keep your files organized you want to create a root directory. It can be named what you want it but keep it relevant to what the addon is going to be. This is were all your files that you will be working on will go.



════════════════════════════════════════════
Crowbar
Crowbar has a most source engine games setup already, that includes Garry's Mod.
The main thing you want to setup is the Steam executable path and your Steam library directory.

First for the Steam executable you want it to be the Steam.exe.



Then you should add the directory paths for your steam libraries.



════════════════════════════════════════════
Blender
There is only a few things to setup for blender.

1. Installing the Blender Source Tools addon.

Step 1: Open the preferences window with (CTRL + ,) and navigate to the "Add-ons" menu.



Step 2: Navigate to the top right of the window to a dropdown box, click on the button labled "Install from Disk..."



Step 3: Select the addon zip file and click "Install from Disk" and the bottom right.



════════════════════════════════════════════
+*Bone naming*+
★ Now, We'll be renaming bones for model. But one thing, Follow all steps carefully and watch your step carefully or you'll completely destroy your model.. so please follow carefully. (Thanks.). ★

So we'll import our model into "Blender" first.
I'll be using "Sara" as our tutorial model. (But I'm sure you already have your model.. Right?)..

https://booth.pm/en/items/5323373
(Don't blame me for using this model for guide 💀 )

OK,.. So in this model... I get these files.
  • FBX.
  • Textures (png.)
  • PSD (photoshop textures but no need for our guide..)

════════════════════════════════════════════

What i got..



FBX. ☑ checked!



PNG. ☑ checked!



════════════════════════════════════════════

Now, We got our required files so we can continue our process.!
⚠ If you have diffrent files such as OBJ and others. It'll still work as i mentioned!. ⚠

Step 1 : Open "Blender 4.2 LTS". or other blenders.. (Downto 2.9)..

Step 2 : When you're in, Press A and delete the "Light , Cube , Camera" by pressing "delete" on your keyboard bcuz we don't need them.

Step 3 : Then, Press "File" and choose your model type and import it by selecting your model file.
I'll import my FBX. file bcuz' my model is FBX.

★ If your model include .blend , Just open it.

════════════════════════════════════════════





════════════════════════════════════════════

So, You won't see your model bcuz' it's too small. Use "Mouse scroll wheel" until you see your model.. If you see. Go ahead.

Step 4 : Delete the "Collection" by clicking the "Collection" with a box icon and press "Del" on your keyboard bcuz' we don't need collection. Now , We'll rename our bones by using script i linked before.

════════════════════════════════════════════



════════════════════════════════════════════

Step 5 : Go to "Scripting" tab , click "Open" and import the script i linked before and press "Open text".

════════════════════════════════════════════





════════════════════════════════════════════

Step 6 : Now you'll see alot (alot) of texts but don't worry.. that's child's play if you follow carefully..
First , You won't need to touch the first "5" lines which are "hips , spine , chest , neck , head).
But i only tested in FBX. so you might need if you use other types..

════════════════════════════════════════════



════════════════════════════════════════════

Step 7 : Click "Armature" from right-side panel.

Step 8 : Now you'll see your model's bones..

════════════════════════════════════════════



════════════════════════════════════════════

Step 9 : Click the small arrow of "hips" and then "Chest" (Continue to "Neck and then Head if you're using other model types but as i mentioned before i haven't tested other types of formats..)

Step 10 : Click the small arrow of "Shoulder" and then "Elbow , Wrist" and you'll see your model's finger bones.
⚠ Shoulder , Elbow , Wrist bone names might be diffrent due to model authors..but remember Elbow might be upperarm or something diffrent , Wrist might be hand.. so don't worry just click until you see five bones with finger names ⚠

Step 11 : Now, Click the small arrow of "Leg" and then continue clicking the arrow until you reach the toe.
⚠ Remember bone names might be diffrent in your model..⚠

Step 12 : Ok. now you might see the bones you need to rename.
⚠ You must click your Right & Left both. You need to rename both. ⚠

════════════════════════════════════════════

Here are examples..





════════════════════════════════════════════

Step 14 : Now Copy the bone names and paste into the script with its places.
★ Mini guide ★

Double click the bone name and press "Ctrl + C" and you'll copy the bone name. Now, Paste it inside the " " with their belonging places.

So, We will copy the bones inside "Shoulder" including itself.
⚠ Things to careful ⚠
Sometimes , Model fingers order might be not correct in some models. But order must be.
"Thumb" must be "Finger0"
"Index" must be "Finger1"
"Middle" must be "Finger2"
"Ring" must be "Finger3"
"Pinky" must be "Finger4"

And others are
"Shoulder" must be "Clavicle"
"Arm / Elbow" must be "Upperarm"
"Forearm / Wrist" must be "Forearm"
"Hand" must be "Hand" (simple..)

"Upperleg / Thigh" must be "Thigh"
"Lowerleg / Knee" must be "Calf"
"Foot / Ankle" must be "Foot"
"Toe" must be "Toe".

Also some model leg bones might be tricky such as alot of toes , wrong named legs but you got eyes.. so just look out.

════════════════════════════════════════════

⚠ Name Left & Right both!. Also be careful with naming with Left side & Right side..! ⚠
Hips section example



Shoulder & Fingers section example



Leg section example



════════════════════════════════════════════

Step 15 : Now, You might be done with copy+paste.. (boring right?..)
Now press the play button to run the script.!



Big credit again to @Darkshoro.. :P
★ Swipe the corner a bit if your screen is too small and you can't see the play button.

════════════════════════════════════════════

Here how it bone names looks after renaming.. Check your model bone names if it's correct like this screenshot.!



════════════════════════════════════════════

Now, We're done with Bone renaming section!.
+*Size reference & Shapekeys*+
★ Size reference ★

Step 1 : While blender is opened. Click "File" and then "Import".. then "Source engine".

Step 2 : Import the size reference file inside my template folder with "Size reference" named on it with bone append mode to "Make new armature".

══════════════════════════════════════════



══════════════════════════════════════════

Step 3 : After that, You'll see a bigger reference. (Now, you'll see your model is smaller compared to the gmod models.)

Step 4 : Now, Delete the reference's skeleton cuz' we don't need it. To delete it, just click the "reference_skeleton" from right-side panel and press "Del" from your keyboard. (basic..)

Step 5 : After that, You'll have to select your model and your model skeleton by pressing "A" on your keyboard and hold "Ctrl" and then slowly double-click the "size_reference" and its collection to deselect the reference.

══════════════════════════════════════════

It looks like this after you selected.!


══════════════════════════════════════════

Step 6 : Put your cursor in the middle of your small model. And press "S" and swipe up until your model perfectly fit the reference.
⏚ If your model is a child/kid/loli 💀 character, Just scale your model to half of reference or any size you want for it.
⏚ Also your model doesn't need to be fit perfectly. Just scale it as you want!. but don't be too small..

══════════════════════════════════════════

How i scaled.


══════════════════════════════════════════

Step 7 : After that , Delete the reference and its collection. (Select from right-side panel and just press "Del" from your keyboard.. simple.)

Step 8 : Now, Press F3 and type "select all" and then click "Select • All" and again , Press F3 again and type "All transforms" and click "Object • Apply (Ctrl+A)". Now, We saved the model scale.

Faster way : Press "A" on your keyboard and then press "Ctrl+A" and choose "All transforms".
⚠ Don't forget this step or you'll get big trouble in next steps. ⚠

══════════════════════════════════════════

Here are the commands


══════════════════════════════════════════

Now, We're done with size. We'll head to shapekeys this time.

★ Shapekeys & Export★

Step 1 : Select your model parts by clicking on the right-side panel.

Step 2 : Now, We'll check the meshs to see if there's other shapekeys hidden inside or not.
Most models have main shape keys inside "Body" which is head. So, We need head.
Just click other parts and click the green triangle icon and see the shape keys if there's any or not in other parts. If there's any.. you can delete them by selecting shapekeys and pressing the " - minus" button.

💡 : To understand why're we deleting other body parts shapekeys. We can only have shapekeys in one body part. Source won't accept shapekeys from muti-body parts. But you'll only need "Body" for face-posing.
⚠ "Body" means your model's head.your model might be named something else! ⚠

══════════════════════════════════════════

Shapekey button


Removing button


══════════════════════════════════════════

Step 3 : So after removing necessery shapekeys from your body parts (Ik it's pain bcuz some model were supposed to customize model with shapekeys and there's alot..) We'll edit the shapekeys of your model's head "Body".

Step 4 : Select the model's head which is msotly named "Body" or "Head" depending on the model.
Click the green triangle button and you'll now see your model shapekeys (faceflexes).

Step 5 : Now, You'll have to do some stuffs.

Renaming : Most Booth.pm models always named model keyshapes with japanese language , If it's try using a translator to translate them. But if you're using a blend. or your model is already textured.
Just click the "Pin" button to pin the faceflex, So you can know what faceflex it's and you can rename.
To rename , just double-click the keysh
ape name and type any names you wants.

Deleting unnecessary shapekeys : You have to delete "vrc.blink" and "vrc.blinkleft/right". Bcuz' they didn't work in gmod when complied but there's still a chance it can work.. Also you can delete "vrc. " shapekeys if your model has alot of shapekeys bcuz' some included shapekeys might be same as those vrc. shapekeys. Such as "Blink" included from model.

Removing symbols : Be careful with " _ underscore" and " - minus" symbols. and other symbols such as " + plus". Sometimes it work but sometimes it won't so you better remove them and rename something better.

Removing MMD shapekeys : They’re useless.. but you can translate , rename and keep it if you wish.

Duplicated keyshapes : Just remove the duplicated or shapekey name with same name.
❖ Future 乃ㄖ乃爪卂匚 Ü : you'll get this error in future if you don't.. ❖



══════════════════════════════════════════

How it look like when "Head" / "Body" is selected.


══════════════════════════════════════════

⚠ Things to check ⚠
  • Your model can't have more than "96" shapekeys.
    (Remove the unnecessary shapekeys!)
  • Make sure to translate every shapekeys if your model shapekeys needed to be translated to english.
    (Just doing this bcuz' you might not understand what those faceflex are in-game).
  • Make sure to check other body parts if there's any leftover shapekeys.!

For my model, There's only some shapekeys so im not gonna delete and rename the most shapekeys..
+*Material check & Exporting*+
★ We'll have to do some basic checks before we export our model. ★

Step 1 : Some model might be incorrectly named the materials of model. To check it, click the arrow beside with orange triangle with model parts. And you'll have to click the arrow besides green triangle and you'll see your model part's material with its name. faulty material names example shown below.

══════════════════════════════════════════



══════════════════════════════════════════
We'll see that material is named to "Material #822" instead of hair texture for the tail of model.

Step 2 : To correct it, Go inside of your original model folder and then check inside of textures files (png.) and check the name of textures and copy the name and go inside "Blender". Double-click the material's name and rename it . i'll rename "Material #822" to "Hair01" bcuz my hair (png.) file name is "Hair01.png".

══════════════════════════════════════════

My model's hair file name.


Double-click the material name.


Copy and paste the texture name.


══════════════════════════════════════════

Step 3 : Other parts which using hair's texture may rename itself.
Check for other parts and correct the faulty names for other parts to make sure texture file names and model's material names are matched correctly!.

Step 4 : After that, We'll export the model. To export, Go to "Scene" tab. Choose your export path.
And make sure "Engine format" is "Dmx". (We won't use dmx. here)
Yes.. “DMX”. Not smd. So please read carefully..

══════════════════════════════════════════





══════════════════════════════════════════

Step 5 : After that, Click "Export" and choose "Scene export". But You'll get some warnings for sure. To check, Click "Windows" and then click "Toggle system console". You'll see the warning shown below.

══════════════════════════════════════════



══════════════════════════════════════════

Step 6 : We'll have to use "Weight link cull threshold" option. Swipe it and set it to 0.10 first.
And try exporting again. Check console for errors. If you get these, You're good to go for next section.

══════════════════════════════════════════



══════════════════════════════════════════

If you still get the "Source doesn't export this" error in console. Increase the number a little bit of "Weight link cull threshold". example : 0.05 to 0.06 or 0.07.. until you get the warnings log above.
Also don’t use “Weight link cull threshold” alot.. It can cause issues.. And when it’s exported correctly, try to lower down a bit until you get a perfect spot!.
⚠ Keep an eye sharply on error log to make sure there's "no source doesn't support this!" error lefts.
+*Proportion trick*+
★ Doing proportion trick ★

Now, We'll have to proportion trick and this is the one of most important steps.

Step 1 : Open the blender. Click "File" and "Open". Go inside the "proportion trick script" file you downloaded before. and then find "proportion_trick_2.9.blend". Select it and click "Open".

Step 2 : You'll be in front-view. Use "MMB" (Middle mouse button) to move around. We'll import the model by importing the model's face. Click "File" again and "Import". We'll choose "Source engine".

Step 3 : Find your model and import the model's head first with bone append mode "Make new armature". I'll import the "Body.dmx" one first bcuz' that's my model's head.

Here are screenshots.

════════════════════════════════════════════





════════════════════════════════════════════


Step 4 : And then import the other body parts with bone append mode "Validate against target".
💡 : Hold shift and select the parts to save your golden time..

════════════════════════════════════════════



════════════════════════════════════════════

Step 5 : After importing every parts, Double-click "Armature" and rename it to "gg"with no capital letters and click it to select the model bones. Press the "Play" button which is a button shown below.

════════════════════════════════════════════





════════════════════════════════════════════


Step 6 : Scroll your mouse wheel to get a closer view. And you'll see green bones and some white bones.

════════════════════════════════════════════

Here how it looks normally.


════════════════════════════════════════════

But if you get more closer to the model's chest. You'll see a white bones. Click "Z" to change your model view and hover into "Wireframe mode" and click it.. It'll change into "Wireframe mode", so you can see clearly.!

⚠ Search around for white bones, If you find white bones in fingers (Not included if your model only have less fingers.) , or others places such as arms , legs.. You may need to check your bone namings. That's mean you missed some bone naming process, So you might need to go back and rename them again and rename it.

Another one, If your model only have like 4 fingers or less.. It'll show other fingers with white bones. Go to +*Proportion trick 2*+ for solution. But proceed to step 11 until you go to that section! ⚠

Step 8 : Now hold "RMB" to swipe around. and turn a little bit right-side view to see white bones.
Target is near model's chest. There may be 2 white bones which are mean to be spine1 & 2.

════════════════════════════════════════════





════════════════════════════════════════════

Step 9 : When you found white bones. Hold shift and left-click those white bones which are spine bones. And then also right-click the nearest green bone with those white bones. I recommand you to select the green bone which is nearest to the 2 white bones.

════════════════════════════════════════════



════════════════════════════════════════════

Step 10 : While those 3 bones were selected (including the "spine4" the green bone you selected). Press "F3" on your keyboard. And type in "Copy constaints to selected bones". Then choose that one and click.

════════════════════════════════════════════

Command you need to choose.


How it'll happen when you clicked the "Copy constraints to selected bones". White bones will teleport to the green bone and they'll become green bones.



════════════════════════════════════════════

⚠ Step 11 from 16 screenshots are shown below as my steam got bugged. ⚠

Step 11: Check if every bones of your model are green.! When all of bones are green, Click "Pose" and then "Apply" and choose "Apply pose as rest pose". You'll get a little warning but it's completely ok.

Step 12 : Again, Press "F3" and type in "Clear pose constraints". and click it.

Step 13 : We'll choose "Proportion trick 2" from upper section. To select the "Proportion trick 2". click the button beside with "Proportion trick". 

Step 15 : After that, Run the script by clicking the "play" button.Your model will be like this after running script.

Step 16 : We're done with proportion trick and you may export your model now. But you'll have to use "Scene export" this time for proportion trick animation files.
⚠ You won't need to apply "Weight link cull threshold" again! ⚠

════════════════════════════════════════════
Apply pose.

════════════════════════════════════════════

⚠ Step 11 from 16 screenshots are shown below as my steam got bugged. ⚠

Step 11: Check if every bones of your model are green.! When all of bones are green, Click "Pose" and then "Apply" and choose "Apply pose as rest pose". You'll get a little warning but it's completely ok.

Step 12 : Again, Press "F3" and type in "Clear pose constraints". and click it.

Step 13 : We'll choose "Proportion trick 2" from upper section. To select the "Proportion trick 2". click the button beside with "Proportion trick".

Step 15 : After that, Run the script by clicking the "play" button.Your model will be like this after running script.

Step 16 : We're done with proportion trick and you may export your model now. But you'll have to use "Scene export" this time for proportion trick animation files.
⚠ You won't need to apply "Weight link cull threshold" again! ⚠

════════════════════════════════════════════
Apply pose.



Clear pose constraints.



Changing "Porportion trick 2".



Result after running "Proportion trick 2"



Scene Export



════════════════════════════════════════════
+*Proportion trick II *+
⚠This section is only for model with less than 5 fingers.. ⚠

So, Most of model that’s not human or whatever.. doesn’t have 5 fingers, like furries only has 3-4 fingers.. And We have to do a additional step to deal with it. Not hard.. good to go if you understood.

Step 1 : Continue the proportion trick or re-import the model if you closed blender :/.
And now, You may be done with spine bones.. So, We’ll head to fingers, Use your mouse to view around and “Shift” from your keyboard..

Step 2 : When you see your finger, It may shown like this. White bones counts may be different with finger counts..

════════════════════════════════════════════



════════════════════════════════════════════

As you can see , There’s white bones near middle finger (locations may be different on your model but mostly it’ll be near middle finger..)

Step 3 : We’ll select the first 2 white bones besides with a green bone.(Nearest green bone). And then press “F3” and type “Copy bone constraints”. And those 2 white bones will teleport (lol.) to green bone.

════════════════════════════════════════════





════════════════════════════════════════════

Step 4 : Ok. We still have 4 white bones.. so we’ll do 2 white bones each until we get every finger bones green.! So repeat the process!.
So, You might be understood what i mean.. Don’t forget to do the same process to other side’s fingers!

Step 5 : After making every bones green.. Press “F3”, Type in “Clear pose constraints” and click it.
And do “Apply pose as rest pose”..

⚠ Step 5 is mentioned in +*Proportion trick*+ section.. So, Go see how to.. ⚠
+*Physic mesh*+
★Physic mesh step is easy if you can follow my steps carefully or you used blender before★

Step 1 : Now , We'll go back to "New blender". Open it and import the "Physic mesh" from my template folder.

════════════════════════════════════════════



════════════════════════════════════════════

Step 2 : We have to delete the "pm_physics_skeleton" by clicking it in right-side panel and press "Del" from your keyboard.. (very simple..)

════════════════════════════════════════════

Delete the skeleton..


════════════════════════════════════════════

Step 3 : Um.. Import your model from proportion tricked model folder. Import model's head first with "Make new armature" and other parts with "Validate against target".

Step 4 : We'll change to wireframe mode so we can see clear between physic mesh and model.
To do that, Press "Z" and move the cursor to left-side and let the mouse go when wireframe mode is selected. Or you can click these button shown below.

════════════════════════════════════════════



════════════════════════════════════════════

Step 5 : After that , Click "pm_physics" from right-side panel. and press "Tab" on your keyboard to change to "Edit mode". So we can adjust the physic mesh until it fitted.

Step 6 : So, You'll have to make the physic mesh fit perfectly with model. (It's easy.)
Here useful basic blender controls for you to edit physic mesh.

⏚ Basic controls ⏚
LMB : Select verts or parts
RMB : Move around
Middle mouse button : Spin around
A : Select everything
Shift + Mouse swipe : Select each verts with muti selectable
Ctrl + L : Select the linked verts (Combo : Select with mouse and press to select linked verts)
S : Scale the selected object
Use these tools as well. (Move, Scale , Rolate etc.)
G : While selected use "G" to move around (Use with Ctrl + L combo) and then click again to confirm.



Ok, Have fun doing it until it fit perfectly for you.
⏚ Don't blame me for not explaining big. I don't wanna write the same thing just like my l4d2 guide again, But if you're having some troubles.. check my l4d2 guide and switch to "Physic mesh" section.

https://steamproxy.net/sharedfiles/filedetails/?id=3313639808

So some of model like small characters might need to be work a little bit hard with physic mesh but dont worry. Use “S” on your keyboard while physic mesh selected and use your cursor to scale it down and click “LMB” when you’re satisfied and you can adjust the physic mesh arms..

════════════════════════════════════════════



════════════════════════════════════════════

Step 7 : When you're satisfied , Go back to "Object mode" by pressing "Tab" Just delete your model's parts bcuz' we only need the physic mesh.
⚠ Don't delete the model's bones "Armature". ⚠
(From right-side panel..)

════════════════════════════════════════════



════════════════════════════════════════════

Step 8 : Now, You'll have to go into "Modifiers" tab with blue wrench icon. Once, You're in.
Just click the black box beside with "Object" and choose "Proportion" which is model's bone.
⚠ Don't forget this step or you'll get t-pose ragdoll.. ⚠

════════════════════════════════════════════



════════════════════════════════════════════

Step 9 : So, You can export your physic mesh now into your proportioned model's folder. not the old one.
+*Qc editing & Jigglebones*+
★ Now we'll edit the qc for the model. ★

Step 1 : Copy the Qc. file into your model folder from inside of template folder.

Step 2 : Now, Right-click the "QC Example" and open with "Notepad++".

Step 3 : First, You have to rename the model mdl. name as you want. To do that,You'll need to edit the "$modelname" line. I'll edit "Yourmodel.mdl" into "Sara.mdl" as my model name.
❖ You can name anything you want.! ❖

Step 4 : Now edit "Name" with your model name again.. And then edit "Body.dmx" into your model's head dmx. file name. My model's head is already "Body.dmx" so i don't have to touch it.

Step 5 : Ok, We'll edit material path to any path you want but path is also important.
Example to give.
(When i say “use your material path” in next sections.. use this path!.)

VRC/Sara/
Bobmac/Sara

So give it as you want. i'm just giving examples. We'll put

════════════════════════════════════════════



════════════════════════════════════════════

Step 6 : We'll go to bodygroup commands. As you'll see i gave two type of bodygroup command.
One with "blank" and one with no blank under the studio. Now put your model part dmx. file name into the " " beside "studio". Copy & paste the given commands if you have alot of body parts to do bcuz' you'll have to do "$bodygroup" for every model parts or undone parts will not show up in game.

Here example usage with normal one and blank one.

════════════════════════════════════════════



════════════════════════════════════════════

❖ Explaination ❖
I used body-2 bcuz' it's body of model so i don't have to make it toggleable but i used blank one for ears so i can toggle and untoggle ears of model in-game. So, Copy the blank lines and normal lines. Customize your own. Use blank included line for bodyparts that you want toggleable in game.
Example as (Ears,Tails,Mask etc.) But if you're a coomer or a damn r-18 mf. just use on.. uhh idk.. skirts, clothes ig. but please don't do it...

════════════════════════════════════════════



════════════════════════════════════════════

Ok, That's how i managed. Tails , Ears , Hair deco with blank and others with no blank.

Step 7 : For now.. Jigglebones. First thing you have to do is open blender.. Check your model's bones that you want to be jigglebones or just do a definebones from crowbar. And then i putted the parameters for you with each parts. Just replace the $Jigglebone "Ears" with your model's ear name. duplicate the line if you have other ear bones. Others goes well as same.

⚠ One thing, Your jigglebones must be weighted to use as jigglebones.. ⚠

Ears : For model's ear bones like.. (Cat ears , Fox ears..) but don't do with human ears..
[ It'll be very "hilarious" tbh]..

Tail : For model's tail bones. (Usually, models with tail has alot of tail bones attached. so just copy-paste the original one for alot of time and then replace.

Oppai : UHHH B--bs.. You know what i mean but don't do if your model don't have.. 0_o.

Other doesn't need to explain alot so just read those and see what they're for.

════════════════════════════════════════════

Example with tail. I grabbed Bip_tail07 and put it in jigglebone line like this,




Example with ears. I grabbed ear bones. and paste inside jigglebone lines for ears.




════════════════════════════════════════════

So, You might be understand now. just copy bone names from blender. paste inside the line " " with their places and duplicate , triplicate or more for bones that want to do as jigglebones.. Have fun copy-pasting!. >:)

Step 8 : So, After suffering from copy-paste, You can finally scroll down and find a line.

"$sequence reference "anims/reference_female" fps 1"
Name "female" to "male" if your character is male.

Step 9 : Scroll down a-bit. And, You'll see some "$includemodel" lines..
Replace "female" with "male" for male character.
E.g $includemodel "humans/female_shared.mdl" To $includemodel "humans/male_shared.mdl"

And replace " f " with " m " if your character is male..
E.g $includemodel "f_anm.mdl" to $includemodel "m_anm.mdl"

════════════════════════════════════════════

Replace with "male" if your character is male.




════════════════════════════════════════════

⚠ Only for male characters. For female. Go ahead. ⚠
Now, You're done with Qc. & Jigglebones. Press "Ctrl + S" to save.
+*Bone collapse (Optimization)*+
★ Woo! No more manual bone optimization! ★

⚠ Not guaranteed to work 100%.. as it can sometimes ruin the model. ⚠

So.. Most of boothpm and other unity models might exceed the dmx bone limit 256 easily but you won't need to delete bones until you get 256 bones anymore!. Thanks to "Jakobg1215" for telling me the bone collapse method.

Step 1 : Open your qc with "Notepad++".

Step 2 : Under "$contents", you"ll have to paste a code. But code is already included in template file.
Open my template folder, Go inside "Bone collapse" and open the qc with "Notepad++". Copy everything inside and paste the code under "$contents" with "Double enter space". I mean press "Enter" on your keyboard twice so you'll get a little space to paste the code..

════════════════════════════════════════════



════════════════════════════════════════════

And you're done. Complie the qc of model again if you're done with every sections.. or if you're new, Please proceed to "Qc editing & Jigglebones" section and come back.!
Also it won’t collapse the jigglebones..!
+* C_arms (optional) *+
Announcement : This section will be updated with better ways to create c-arm.. so stay tuned!

★ Arms for model.. But optional.. I have to rewrote this lol ★

Step 1 : Open new blender.

Step 2 : Now, We'll have to import the model. But you'll have to import the model's body (not head..) , Upper clothes. So, Choose wisely and import until you get a model for arm ripping.

Example : I imported the model's body and a cloth.. (It's enough for arms..)

════════════════════════════════════════════



════════════════════════════════════════════

Step 3 : Select your model parts. (Bones not included.!). and then press "Tab" to change into "Edit Mode".

Step 4 : Then, Use your mouse and delete the middle part which is unnecessery.
★ Use "Delete" key on your keyboard and select "Vertices" to delete the vertices of middle part.

════════════════════════════════════════════

Example.




════════════════════════════════════════════

Step 5 : After that, Export the arm with dmx. into my template "C_arms" folder, Go inside "C arms" folder from my template. and edit my qc with notepad++.

**Replace**

➜ "arm.mdl" to anything you want. I'll name it "sara_arms.mdl".

➜ "arms.dmx" to your arm dmx name. You can use one each If you have 2 versions. I'll go with gmod skeleton one so i'll name it "

➜ "Material path" to your model's material path you used in model qc before. Mine is "VRC/Sara/".

That's it. Open the qc with crowbar and select a export path you want and click complie.!
And click "View" so you can see the arms are okay or not.
⚠ Fingers may be a little weird if model doesn't have bone weighing.. ⚠

Also go complie your model.! If there's any errors. Give a visit to +*Troubleshooting*+..
+*Materials & VMT*+
★ We bake da' materials.. The end is near.

Step 1 : Open VTFEdit that i linked before.
⚠ One thing to mention.. While you're in installer, Make sure to check ☑ these two option.! ⚠
If you haven't, try to reinstall it with those options checked ☑!

════════════════════════════════════════════



════════════════════════════════════════════

Step 2 : Now, Click "File" and then "Import". Find your model's textures (png.) files and import it.
When this thing popped up, Just click "Ok". It may take a while depending on your device..
So i recommand you to open a lot of VTFEdit and import every materials. Uncheck ☑ "Generate normal map" if it's checked ☑!. but we'll need it later.!

Step 3 : When it done. Just click the save icon.

════════════════════════════════════════════



════════════════════════════════════════════

Step 4 : You'll have to make the material path for the materials that you used for qc before. I used "VRC/Sara/" so i have to create two folder.
First one is "VRC" and then "Sara" inside again and then we'll save the materials inside of that "Sara" folder. So you might be understand what i mean. Your materials path u used will be diffrent depending on what you putted inside qc.!

Step 5 : Type the "filename" same as your texture's name. Im exporting body's texture (body.png) so i'll type "Body.vtf" in "filename".

════════════════════════════════════════════



════════════════════════════════════════════

Step 6 : After saving the vtf. , Click "Tools" and click "Create VMT file".

Step 7 : Click "options" and choose shader to "VertexlitGeneric".Ignore other buttons bcuz we’ll put a custom parameters into VMt later.

════════════════════════════════════════════





════════════════════════════════════════════

Step 8 : Repeat the same process for other materials. After doing every materials. Re-import every materials and now check ☑ "Generate Normal map". And save them with other names. i imported "Body.png" for normal map so i'll save it as "Body_m.vtf", Do for other textures as well.. Just doing this to avoid confusion.!
Also you don’t have to do the VMT for normal maps.
⚠You don’t have to generate normal maps if model included “normals” inside texture folder ⚠

════════════════════════════════════════════



How it looks when normal map is generated.


════════════════════════════════════════════

Step 9 : After that , Go inside the material folder and edit the VMT with notepad++.
And we'll add some parameters.

Open the vmt. files and put these codes inside of them!. i mean replace the written codes.

VertexLitGeneric { $basetexture Materiel path/Material name $bumpmap Materiel path/Normal Map $phong 1 $phongboost 1.0 $phongfresnelranges "[0.35 0.85 1.0]" $phongexponenttexture vgui/white $phongexponent 1.0 $phongalbedotint 1 $rimlight 1 $rimlightexponent 5.0 $rimlightboost 1.0 $lightwarptexture Material path/basewarp }

Customization : You can adjust numbers as you wish. im just giving my parameters..

Step 10 : After pasting them inside of their own vmt.
We'll have to edit and replace some parameters.

Replace "$basetexture" "Materiel path/Material name" with your material path (path from qc) and material's name.
Example, Im editing body.vmt.. So I'll have to edit it to

"$basetexture" "VRC/Sara\Body" (vtf not included!, only name.)

And now, We'll edit "$bumpmap".
Replace "$bumpmap" "Material path/Normal map name" with your material path and material's normal map name.
Example, I have "Body_m" as normal map of body that i generated before. So I'll have to edit it to

"$bumpmap" "VRC/Sara\Body_m"

You might understand what you have to do now. So open every vmt. and edit those parameters with path and material names and save those vmt. files by clicking "Ctrl + S".

Finally as, "$lightwarp"..You have to go inside my template folder, Copy and paste it to your model's material folder or you can make one if you're a professional gmod modder. Ok, Go back inside to vmt. Replace the "Material path" with your material path (from qc).. Leave "basewarp" as lightwarp name is just same..

Example : "VRC/Sara\basewarp".
⚠ Lines for lightwap are same for every vmt. so you can just copy paste the "$lightwarp" line. ⚠

Update : If your model is filled with purple in-game, Make sure you put the basewarp inside material folder.!

════════════════════════════════════════════

Example (This example is outdated as i updated parameters.. but it’s still useful.!)


════════════════════════════════════════════

When you're done with every vmt. You can go to final section...
+*Lua coding & Testing*+
★ Last section ★

Step 1 : So, We'll create a addon folder. Create a folder and name it anything you want.

Step 2 : Go inside that folder and create three folders. And name them :
  • models
  • materials
  • lua
⚠ No capital letters! ⚠

Step 3 : Go inside "models" folder first. Go copy the complied model's mdl and model's arm files.
And paste it inside "models" folder or create a another folder inside of "models" ,name it and paste them inside if you want. but it'll make lua line longer.!

════════════════════════════════════════════

So i created a sub folder and paste the model & arm files inside!.

════════════════════════════════════════════

Step 4 : When done, Copy your material folder that you created in last section and paste it inside "materials" folder.!

════════════════════════════════════════════



════════════════════════════════════════════

Step 5 : Now, Go inside "lua" folder and create a new folder named "autorun".
⚠ No capital letters! ⚠

Step 6 : Go copy the lua file from my template inside "pm lua" and paste it inside "autorun" folder.

════════════════════════════════════════════



════════════════════════════════════════════

Step 7 : Open the lua. file with "Notepad++". We'll do some codings but it's easy.

════════════════════════════════════════════

★ To write lua for work. You'll have to replace some codes. ★

**Replace**
➜ *Category* : to your desired category name. *You can change any*

➜ *Name* : to your desired model name. etc. Sara. *You can change any name*
⚠ "models/*Name*/*modelname*.mdl" Not included! ⚠

➜ *modelname* : with your mdl. name. etc. Sara.mdl *You have to put exact mdl. name from your model folder so go inside the model folder and copy the model mdl. file and replace with *modelname*, Wrong mdl. name will not work so check it's matched or not*

➜ *arm* : with your model arm mdl. name. *check your model folders and copy the arm mdl. name,Wrong mdl name will not work just like modelmdl name.*

➜ Mdl. path : Check inside your model's folder, As you saw before.. i created a sub folder inside "models" so i putted "models/VRC/sara.mdl". You don't have to put the middle one if you didn't created a sub folder inside "models". Check below for compared screenshots.
⚠ Don't remove "models" from line. ⚠

────────────────────────────────────────────

**Customize**
# Health = "100" *Change 100 to any amount you want*
# Numgrenades = "4" *Change 4 to any amount you want*

════════════════════════════════════════════

Here is comparison of **Uncompleted** one and **Completed** one.
Lines i modified will be shown with greens from left side.
⚠ To avoid confusion, Please look at those two comparison carefully! ⚠





════════════════════════════════════════════

Step 8 : After editing the lua. Press "Ctrl + S" to save the lua. Now you can name the lua file with your desired name. I named it "Sara.lua".

Step 9 : You can test the model now. Go to this path. Or browse the game file from steam and go inside "addons" folder.

" C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons\ "
( Drive name may depends on your storage card. etc E:\ , D:\)

Step 10 : Paste the model folder inside "addons" folder and now you can launch your game to test it!.

════════════════════════════════════════════



════════════════════════════════════════════

Step 11 : You may need this addon to spawn ragdoll.. Or you can kill the Npc inside.
https://steamproxy.net/sharedfiles/filedetails/?id=104603291

Step 12 : Create any game. (Now, wait till it loaded.. also rip if you have 1000+ of addons).

Step 13 : Now, We'll spawn ragdoll first to see if there's any physic errors like stretchy ragdolls.
You'll see your addon at "Addon - Legacy".

════════════════════════════════════════════



────────────────────────────────────────────

Ragdoll also fine


Npc also seems fine.


PM also fine..


Arms also fine.!


Future 乃ㄖ乃爪卂匚 Ü : Model in screenshots might be bright, that was before i added lightwarp.. So you'll be fine.

════════════════════════════════════════════

Now, We're done! Congratulations!! You have ported the model into GMOD.! If you have some problems. Move to next section for troubleshooting the common problems.
+*Troubleshooting*+
★ I got solutions for you.. ★

**Common problems/mistakes**

Encountered vertex in delta state : Check every bodyparts except model's head to make sure there isn't any shapekeys. You got this error bcuz you have some inside in other parts. Sometimes your face shapekeys might have the same name like “Moutho” and “MouthO”..

T-pose ragdoll : Make sure you did the "Modifier" thing at "Physic mesh" section. Please go double-check it. And view the model from crowbar.. while HLMV, check the Collision model. And see if it's ok or not.

Error model : Make sure you linked the model mdl name correctly in lua.
Example "models/VRC/sara.mdl"
Can be mistake with "model" without "s", no mdl behind modelfile name such as "models/VRC/sara".

Error model arms : Make sure you linked the arms mdl name correctly as well.
Same as above. Just need an sharp eye to check.!.

Lua corrections : use "/" instead or "\" in lua code if you copied from path shown in file explorer.

════════════════════════════════════════════

**Rare problems**

Stretchy model parts : Basically bcuz' model parts are heavy, try optimizing the heavy bodyparts by decimating & Un-Subdivision. I’ll make a small guide about it later :p

ERROR : EXCEPTION_STACK_OVERFLOW / VIOLATION (or whatever). : Check the vertice and bone counts of your model parts.
Check +*Requirements*+ to see how to check… it must be 12k or less vertices for “Each bodyparts”.
Not the whole model.. also bone counts must be 256 or less..

Stretchy tail : Most common on model with tail , All you have to do is merge tail with main body. To do that, Select the tail and main body and press "Ctrl + J" and it'll merge into one part. Remove the tail.dmx bodygroup line and complie it again.

ERROR! : R_addvertextomesh : bad vertex (numbers) : Same solution as above. Model just need some optimization. But even myelf still figuring it out..

Weird c_arm fingers : Well. Mostly issue came from bone not aligning the default arm bones position.. don’t worry. I’ll update the guide with a new section.

Stretchy C_arm fingers : make sure to name fingers in order. Thumb , index , middle , ring and pinky.

Too many material coordinates : Remove unnecessary UV maps from model. Models only needs one.
If still not helped.. Try optimizing model or reduce the UV island amount..

Unattached parts : Sometimes.. ported models can be a little bit quirky with bodyparts such as flying parts , unattached parts. All you have to do is do "CTRL + J" with the part that floating around and a good part. I mean join 2 parts in blender by selecting the part you want to attach to and select the part you want to join and then press the key i mentioned.

════════════════════════════════════════════
+*Credits*+
★Credits as always! ★
Bobmac - Writing guide & assets from template.
Jakobg1215 - Writing guide & Revamping sections (Big thanks.!)
Darkshoro - Bone naming script
K10[booth.pm] - Model author
Deadwater2 - Tutorials for proportion trick and other stuffs.

Make sure to give a credit to me if you used my guide for a workshop item!!
You can check out my another guide for l4d2 models

https://steamproxy.net/sharedfiles/filedetails/?id=3313639808

That's all folks. Like & comment down if you encountered any problems I haven't encountered.
Bye.!
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
+*Updates*+
★ Update log for guide ★

V1.1 : Material parameters update!
- Added “rimlight” and other additional lines for better lighting.
- Fixed some grammer issues (blame my fingers.)

Shorten version guide & “More” extension guides coming soon!

V1.2 : A little revamp update.!
- Added arm template and some sections revamped
- Fixed some spelling.
- Rewritten "C arm" section.
- Updated "Proportion trick" section with newer version of blender.
You won't need old blender anymore..

V2 : New sections and template update!.
- Added "Bone collapse" & "Reduce poly" sections.
- Updated template!. If you're still porting the model, You'll have to download the updated one!.
- Removed "Bone count" limit, You can collapse bones now!.

V2.1 : Bypass vertice limit per part update.!
- Added “Vert limit bypass” section to bypass vertice limit and fix stretchy parts!
That’s it.

Report any issues if found!.

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
55 Comments
jose.lisboa 13 Feb @ 6:13am 
@乃ㄖ乃爪卂匚 Ü i sent you a friend request on discord. That way i can give you more context
Vaelastrasz 13 Feb @ 1:12am 
Thank you !!!
乃ㄖ乃爪卂匚 Ü  [author] 12 Feb @ 11:34pm 
Yes.
Vaelastrasz 12 Feb @ 10:43pm 
I want to ask about proportion trick script.

If all of source engine using same "valve.biped.bip" skeletons, is that script working on half-Life 2 and left 4 dead 2 ?

I think no one ask about that.
乃ㄖ乃爪卂匚 Ü  [author] 12 Feb @ 8:41pm 
I really really needs to work on rewritten version soon as possible..

this guide is compared to “alpha version” to rewritten version.

Also @jose.lisboa come into my discord : Bobmacjefferson

I need more context..
cygniius 12 Feb @ 1:58pm 
thank you so much for this guide, it was very helpful!
jose.lisboa 12 Feb @ 6:15am 
Hey, im getting an error that says that my model's list index is out of range. What does that mean, and how do i fix it? Thanks in advance.
Vaelastrasz 11 Feb @ 8:15pm 
So umm.. i only used Bone collapse.
That was helpful.
乃ㄖ乃爪卂匚 Ü  [author] 11 Feb @ 7:19pm 
I thought gmod complier supported it as first.. silly me back in early 2024..
乃ㄖ乃爪卂匚 Ü  [author] 11 Feb @ 7:17pm 
Also just a tip here if you’re still using this guide..

As my recent experience, To use $maxverts.. you’ll need SFM complier and use it as complier..

Correct usage is $maxverts 65536 65536 and it can help alot with VRC models.. You don’t need to optimize the model anymore.. in other words, No more stretchy model results..

(This is golden tip tbh.. )