Garry's Mod

Garry's Mod

121 个评价
Porting Vroid Studio Models to Garry's Mod
由 Soampbar 和其他 1 人合作完成
The entire process for transforming an exported Vroid Studio model into a usable Garry's Mod playermodel.
5
4
7
2
   
奖励
收藏
已收藏
取消收藏
Introduction
This guide will show you how to go from exporting your model in Vroid Studio to publishing your model on the Garry's Mod workshop. All of the necessary tools used in this guide are free to use, although I absolutely recommend supporting the developers. This guide would not be possible without their contributions <3

If you get lost at any point in this guide, this video shows the entire process outlined in this guide (no optional sections) right up to publishing. While it's possible to complete your playermodel by only watching the video, I would recommend using the video in combination with the written process if it's your first time.
This guide, while more standalone now, used to be a heavy fork of Deadwater's guide. If you need supplementary information for parts of the process, I would recommend watching their playermodel creation series videos!
> https://www.youtube.com/playlist?list=PL5LHjOzRo2dv7Btrr4YXn9yR0TkBuLfVO

Any time I refer to the 'main resources folder' in this guide, I'm talking about 'vrm-porting-guide-files-main', which is named 'vroid-to-gmod-files' in the video version. Keep it in mind!

Any optional sections for extra features will be marked with an 'O'. If this is your first time porting a model, I recommend avoiding the optional sections until you can get your model properly compiled. That all being said, let's get started!
[Part 0] Exporting from Vroid Studio
When I was writing it, I used the Steam versions of Blender 4.1 and Vroid Studio 1.28.1 for this guide.You don't need to use these exact versions, but I'm listing them as fallbacks just in case.

The guide process has been confirmed to work up to/through these versions:
Blender: Versions 4.0 through 4.3
Vroid Studio: Versions 1.28.1 through v2.0.1

First, we need to get the model exported as a .vrm and into blender. Open Vroid Studio and open the model you wish to export. It gets removed when compiling anyway, so the outline can be removed by going to 'Look' at the top, selecting 'Outline' on the left, and setting all the outline sliders on the right to 0.

IMPORTANT NOTE FOR PEOPLE DOING OPTIONAL BODYGROUPS:
If you want to do removable clothing, note that some clothing creates a skin mask that will make the material under the top invisible. To avoid this jumpscaring you later on, we need to remove the skin mask that the top creates. To do this, go to the top and select 'Edit Texture'. Hide the top layer in 'Outfit' and select 'Skin Mask'. Change the brush color to white (#FFFFFF) and paint over the black on the texture. A video on how to do this is below:
IF YOU'RE NOT DOING BODYGROUPS:
It's also possible you may actually want to expand the skin mask so clipping does not occur from inner clothing layers poking through. You can use the same process used above to remove the skin mask, but instead use black (#000000) to expand the skin mask.

After that, we can export the model by going to the top right and selecting 'Export as VRM'.
Keep all the 'Reduce' settings unchanged and click export. Save the .vrm to wherever is most convenient (I saved it to Downloads.) You'll also want to create two folders named 'textures' and 'unused_textures'. After making those changes, your directory should look something like this:
[Part 1] Working in Blender
A list of all the resources you'll need. Watch up to 3:15 on the video below for help installing most of these, as Deadwater does a pretty good job with it. You do not need to download his version of the playermodel template files mentioned at 1:50, as I've repackaged them to better fit this guide.
> https://www.youtube.com/playlist?list=PL5LHjOzRo2dv7Btrr4YXn9yR0TkBuLfVO

Playermodel Template Files
> https://github.com/Althories/vrm-porting-guide-files
Blender
> https://www.blender.org/download/
Old Blender (2.79)
> https://download.blender.org/release/Blender2.79/
Blender Source Tools Plugin
> http://steamreview.org/BlenderSourceTools/
Old Blender Source Tools Plugin (get 2.10.2 at the top of Blender 2.74+)
> http://steamreview.org/BlenderSourceTools/archives/
VRM Add-on for Blender
> https://vrm-addon-for-blender.info/en/
Crowbar
> https://steamcommunity.com/groups/CrowbarTool
VTF Edit
> https://web.archive.org/web/20170913055549/http://nemesis.thewavelength.net/index.php?c=238#p238
VTF Edit Alternate Link
> https://www.tophattwaffle.com/downloads/vtfedit/
Proportion Trick Script
> https://github.com/sksh70/proportion_trick_script
Notepad ++
> https://notepad-plus-plus.org/

Open a new scene in Blender and delete everything inside (except the scene collection.) To import the .vrm into Blender, go to the top-left and click File > Import > VRM (.vrm). The first thing we can do is delete all of the "colliders", as we only need the armature and its attached meshes present. Don't forget to delete "secondary" under the armature, as it's listed inside the armature list.

Now we need to export the model textures, which can be done by going back to File > External Data > Unpack Resources > Write files to current directory (overwrite existing files). This will export the model textures to a folder aptly named 'textures' within your main Blender directory. If you have Blender installed on Steam, you can find this directory by right-clicking Blender in your library > Properties > Installed Files > 'Browse...'. Your exported textures will look a bit different, but should look something like this:
We're going to copy the contents of this texture folder over to the texture folder we made in Part 0. After that, we're going to rename and move some of the textures as appropriate.

Some of these textures are normal maps, which we'll want to rename for ease of use. The normal maps will for the most part export right next to the parts they should be associated with; in this case, _05, _11, N00_000_00_HairBack_00_nml, and N00_000_Hair_00_nml are maps for the face, body, back of the hair, and general hair, respectively. We'll rename these normals to Face_N, Body_N, Hair1_N, and Hair2_N. There should also be a small blue cube named Shader_NoneNormal, which can be renamed to bump_flat.

There are also textures that we won't use in this folder. In any case, we don't need to use MatcapWarp, N00_000_00_Face_00_out, and Shader_NoneBlack. There may also be black textures next to the hair textures, which won't be used either (They're listed as emissive textures in the .vrm material properties.) All of these textures can be moved to 'unused_textures'. You can also move out the thumbnail, although you may want to keep it around for publishing.

After making changes, your textures folder should look something like this:
Back in Blender, we're going to use our textures folder to rename the textures on the mesh. Select a part of the mesh you wish to change the materials on, then click the red sphere on the right (Materials.) Generally, the materials will be on the meshes in ascending order of Face, Body, then Hair. Each material has a preview you can check in case you get confused. For example, the first material in the Face mesh will be renamed (by double-clicking the material name) from N00_000_00_FaceMouth_00_FACE (Instance) to _01, assuming the material is named _01 in your textures folder.

Once all the materials are renamed, we're going to import a script to automate bone and shape key renaming. Switch the workspace tab at the top from Layout to Scripting. In the scripting workspace, click 'Open' at the top. In the main resources folder, open the resources folder and open RenameScript.py. You have to be careful with selecting the right things here or else the script will run into an error, so pay close attention. Select ONLY 'Face' in the top right, then run the script by clicking the play button at the center-top. You can see whether the script worked if there's a run_script() message in the bottom-left.

Now, switch back to Layout and select ONLY 'Armature'. Our script will have made a new widget on the right called 'VRM to ValveBiped'. Select this and click RENAME with the armature still selected. At this point, key bones in the skeleton have been renamed to their ValveBiped counterparts, and the shape keys of the mesh have had underscores in their names removed. If you're wondering why we need to remove underscores in those names, it's because the .dmx model format uses them for corrective shapes, something we don't want!

You can check whether the script worked by selecting the armature, entering Edit Mode in the top left or by clicking Tab, selecting a bone (not a hair bone) and clicking the green bone icon on the right. If it says ValveBiped_something, the script worked. You can also check whether the shape keys were renamed by selecting the face mesh and clicking the green triangle with three dots (Data), looking under shape keys.

Now, we'll import a size reference to match our model with Garry's Mod scale. Select File > Import > Source Engine. In the main resources folder, enter smd references and select 'male_07_reference.smd'. Before you import the reference, make sure to switch 'Append to Target' to 'Make New Armature'. Once the reference is imported, you can delete the reference armature. To scale our model, box select the model and press S and drag the mouse to scale. Feel free to vary the scale of the Vroid model in comparison to the reference, as it doesn't need to be exact. Once the model is scaled, you can delete the reference mesh and the 'male_07_reference' collection. Because we altered the scale of the model, we need to apply the change by selecting everything in the scene with A, pressing Ctrl+A to bring up the Apply menu, then selecting 'All Transforms'.

OPTIONAL: If you'd like bodygroups (removable parts) for your model, jump to O - Bodygroups, then return and continue here.

For ease of use, we'll combine the meshes into one. This can be done by shift-selecting parts of the mesh and pressing Ctrl+J to join the meshes. If you made bodygroups, you can keep those parts separate. Make sure to rename the combined mesh(es) to something easy to remember, like 'insert_model_name_pm'.

To export using the .dmx format, we'll need to limit the number of bone influences per vertex. Thankfully, this can be done quickly by going into Edit Mode, and with everything selected, select Mesh > Weights > Limit Total at the top. This will open a popup in the bottom-left, which we'll expand and set 'Limit' to 3.

OPTIONAL: If you'd like eye posing flexes and a blink animation, jump to O - Eye Flexes and Blink Animation, then return and continue here.

Finally, time to export! Enter the Scene tab at the right (white cone and circle) and expand 'Source Engine Export'. Open the browser by pressing the folder icon and, inside the main resources folder, set compile folder template as the export location. After making sure the export format is DMX, select Export > Scene Export. A popup will appear at the bottom when the file exports. I'd also recommend saving the .blend file with Ctrl+S in case you need to use it later.
O - Bodygroups
If you want your model to have removable parts, read this section.

There's a lot of ways to do this, but the method I use in the video below allows you to be relatively less precise by selecting linked vertices/faces. I've included a video below on how this is done, but you're essentially just separating the mesh into additional parts by selection. I separate the shoes in the video, but the same process can be applied to any clothing article. It doesn't show it on the key reader, but I press Shift, then L to additively select mesh vertex groups.
Before you go!! Depending on how you made your bodygroups, there's a chance you accidentally duplicated your shape keys onto other mesh parts. This might happen if you combined a mesh with the face, then re-separated that part off the face. Doing this will assign shape keys (flexes) to both meshes. Make sure to delete all shape keys except those on the face to avoid an error.
O - Eye Flexes and Blink Animation
Read if you'd like for your model to have:
- Face flexes for eye posing
- Blink animation

By default, there are 57 unique shape keys. If you just want to have these, you can ignore this section. The .dmx format actually automatically handles the default flexes for Garry's Mod, which is a great time saver! However, make sure to keep underscores out of the names of your new flexes, as the .dmx format treats flexes with underscores differently.

I typically make 4 different eye poses, being LookUp, LookDown, LookRight, and LookLeft. To make an eye pose, select the vrm armature and enter pose mode > change the pivot point to 'Individual Origins' > select eye bones in pose mode > rotate to desired positions > go back to object mode > select mesh > go into modifiers > save as shape key on the dropdown for the Armature modifier > reset eye pose using the pullout menu (press N.)

To add a blink animation, we can copy one of the existing eye-closing shape keys. I find that either 'Fcl_EYE_Close' or 'Fcl_EYE_Joy' work best, depending on the model. To copy the shape key, select the key, turn on 'Shape Key Lock' (click on the pin icon below the shape key list), expand the 'Shape Key Specials' menu next to the list (the open, downward pointing arrow) and select 'New Shape from Mix.' Rename the new key to 'Blink'.

Here's a visualization for making the eye pose and blink animation keys:
[Part 2] Applying Proportion Trick
I'm not going to explain proportion trick myself, just cause it isn't really necessary for this guide. If you'd like to hear explanations for some of the steps taken, refer to part 2 of Deadwater's video series linked in the introduction. I also do it a lot in this section, so keep in mind that A selects/deselects everything. And as a final note, don't save the scene at any point in case you need to reuse the file for making other models.

That all being said, time to use 2.79 Blender! Right away, we're going to open the proportion trick scene by selecting and opening File > Open > proportion_trick_2.7_new.blend. Then, we'll import our .dmx model by selecting File > Import > Source Engine, then selecting our .dmx file inside compile folder template. Again, make sure to switch 'Append to Target' to 'Make New Armature' before importing.

OPTIONAL: If you made bodygroups, you'll have to import each part separately. Do the above paragraph with any model part, and then import the rest of the parts by switching 'Make New Armature' back to 'Append to Target'.

Once the model's in the scene, rename it to gg. Deselect everything in the scene, then select only the skeleton by clicking the armature icon in the top-right. Then, click 'Run Script'. Right-click the black bone on the armature, shift-right-click the green bone above it, press SPACE to open the search menu, then type and select 'Pose: Copy Constraints to Selected Bones'. With the entire skeleton selected, go to the bottom-right and select Pose > Apply > Apply Pose as Rest Pose. A warning popup will appear at the top, which you can ignore. With the entire skeleton still selected, open the search menu with SPACE to type and select 'Pose: Clear Pose Constraints'. The bones should change color a bit, which is fine.

Now, we'll adjust the foot bone rotation to match the floor in Garry's Mod. Switch to Edit Mode in the bottom-left and select View > Right, also in the bottom-left. Zoom in on the lowest bones (the toe bones) and box select them with B. We need to rotate them to be straight as possible, which can be done by pressing R and dragging the mouse. After straightening the bone, a rotate widget will appear in the bottom-left. Copy the degree of the angle by selecting he box and pressing Ctrl+C. Then, deselect all bones and move to the other toe bones (should be directly connected and to the right.) Box select these bones, press R, and press Ctrl+V to paste the rotation to these bones.

After that, zoom out and switch back to Object Mode. To view the mesh, select the left-top circle in the little grid in the bottom-center, which will have the square directly to the right of the left-top square darkened before selection. Now, select only the skeleton using the skeleton icon and switch 'Proportion Trick' to 'Proportion Trick 2' by selecting the notepad icon in the top-left. Once again, click 'Run Script'. Select the mesh with right-click, press Ctrl+L, then select 'Modifiers' in the 'Make Links' menu that pops up.

OPTIONAL: If you made bodygroups, you'll want to make sure every part of the mesh is selected before selecting 'Modifiers' > 'Make Links'.

Export time! On the right, select the Scene tab (cylinder, sphere, and sun) and set the Export Format to DMX. This time, set the Export Path to 'proportion trick compile' inside 'compile folder template'. After that, click Export > Scene Export. Exit the file without saving so it can be easily reused for making other models.
[Part 3] QC and Crowbar
In 'proportion trick compile' in the main resources folder, open 'pm compile.qc' with Notepad++. This is what we'll be feeding to Crowbar in order to compile our model, so it's critical to make sure our directories are correct and free of any typos. Editing the file is pretty self-explanatory, but I'll list all the lines you need to pay attention to just in case.

- Line 1: $modelname. Replace mentions of your_name with your username (soampbar in the video), and mentions of model_name with the name of the .dmx export (sample_pm in the video.)
- Line 3: $model. Same deal with $modelname.
- Line 5: $cdmaterials. This line tells the qc file where to find textures for the model. Change model_name as mentioned in $modelname.
- Lines 34 & 35: $ikautoplaylock, which is explained in the file (thank you CaptainBigButt!!!) You'll be messing with this after compiling if necessary.
- Line 54: $collisionjoints. Set this to fembase.dmx/mascbase.dmx depending on your model.

==========
OPTIONAL: If you made bodygroups, you'll need to define them in the .qc. I'd put these lines after '$model', but they might be fine anywhere. As an example, let's say I made a model with one bodygroup watch, meaning I'd have a main body mesh and a watch mesh. In the .qc, I would make this bodygroup definition:

$bodygroup "watch"
{
studio "watch_mesh_name.dmx"
blank
}

The 'blank' in the second definition will mark the bodygroup as removable, and on by default. The names after $bodygroup will show up as the part labels in Gmod, so make sure to name them appropriately.
//end optional note
==========

Once you're done editing the .qc, open Crowbar and open the Compile tab at the top. Select 'Browse...' next to 'QC input' and select the edited 'pm compile.qc' inside the proportion trick compile folder. Then, make sure 'Output to:' is set to 'Work folder' on the left. Browse to 'proportion trick compile' and select the 'output' folder.

You're ready to Compile! So, hit the Compile button. Crowbar will tell you if it runs into any errors in the log below in case you messed something up. If your model compiled, great! To make sure it compiled correctly, we can open the Half-Life Model Viewer by selecting 'Use in View' in the bottom-right, then selecting 'View' in the bottom-left. The result should look like your model, just with the classic black and pink/purple missing texture checkerboard. You can test whether the skeleton's working by clicking on 'Sequence', clicking one of the 'reference' dropdowns, and selecting an animation.

Now, navigate to 'output' inside 'proportion trick compile'. We'll copy-paste this folder inside your_model_pm, which you'll rename to the same name as your edited model_name inside the .qc. Inside the model_name_pm folder (sample_pm in the video), enter materials > models and change your_model_pm to the edited model_name as well. This has to match the cdmaterials line in the .qc, so make sure it does! Next, open lua > autorun and rename the .lua to, you guessed it, your edited model_name.lua.

Open the .lua with Notepad++. Just like in the .qc, you'll rename the directories in here to match those inside your_model_pm. The "Model_Name" can be replaced with what you want your model to be called in the playermodel selector. In the video, I actually forget to replace the model_name on the second line, so make sure to double-check!
[Part 4] VTFEdit, Textures, and Testing
Now, we need to give our model textures! Remember that 'textures' folder we created in Part 1? We're going to convert all those .png files to .vtf and .vmt files that the source engine can read.

Open VTFEdit. In the top-left, you should see a 'Tools' tab. Click that, and then click 'Convert Folder'. You'll want to set the 'Input Folder' to the folder where you stored all the exported .vrm textures. Then, set the output folder to the your_model_pm folder inside materials > models. Make sure 'Create VMT Files' is checked. Before you click Convert, your 'Batch Convert' window should look something like this:
Click convert. Once it's finished, open the output folder directory. There should now be a .vtf and .vmt file for each file that was in the 'textures' input folder. We don't need the .vmt files for any of the normal maps, so delete 'bump_flat.vmt', 'Body_N.vmt', 'Face_N.vmt', etc.

Now, the monotonous part. We need to edit each .vmt file in Notepad++ to include the correct parameters, so go open every .vmt file in Notepad++. You can actually delete whatever's in the files at the moment, as you'll be replacing them with the parameter sets I gave you in 'vmts.txt', located in the resources folder inside the main resources folder. The file contains parameters that you can copy paste into each .vmt file depending on what texture it's meant for. As an example, my face texture is _04, so my _04.vmt file would look like this:

"VertexlitGeneric"
{
"$basetexture" "models/sample_pm/_04"
"$bumpmap" "models/sample_pm/Face_N"
"$lightwarptexture" "model/sample_pm/base"
"$alphatestreference" .3
"$alphatest" 1
"$nocull" 1
"$nodecal" 1
}

Before you do this for every file, decide whether you want to include the $lightwarptexture line. $lightwarptexture can be best explained here:
> https://developer.valvesoftware.com/wiki/
$lightwarptexture is used here to preserve the model's look in Garry's Mod. Below shows the difference if you use $lightwarptexture:
I personally include it cause I believe the model looks more accurate to the standard Vroid shading, but it's really up to you. If you do decide to keep $lightwarptexture, ensure 'base.vtf' is in your materials folder with your other .vtf and .vmt files, as $lightwarptexture relies on it. base.vtf is placed in that folder by default.

Additionally, one or more of your textures may be transparent. To make it so the texture doesn't appear completely solid, add "$allowalphatocoverage" 1 to any .vmt file that requires transparency.

You might wonder, 'why does the video's body .vmt use bump_flat and not Body_N? Great question! In testing, I've found that Body_N can sometimes display the body texture incorrectly, while bump_flat will always (at least so far) display it correctly. So, I default to using bump_flat for the body normal.

Okay, NOW you can edit the parameters for each file. I recommend the copy-paste process I do in the video to speed things up. After editing each .vmt, we can paste our finished your_model_pm folder into our Garry's Mod directory. Copy the folder and open your Garry's Mod directory, which can be done easily through Steam. Then navigate to garrysmod > addons and paste the folder inside addons.

Now for the scary part, testing! If you open a map in Garry's Mod and pull up the playermodel selector, you should be able to select your textured model. If all went well and your playermodel looks good, congratulations!! You're basically done.

Once you've completed texturing your model, you may also wonder: 'Why is the icon in my playermodel selector still untextured?' Thanks to @rizu., I can tell you how to fix it. First, it's a clientside issue. So even if you don't fix it, other people downloading your addon will see the icon as textured. If you enter your Garry's Mod directory and navigate to GarrysMod > garrysmod > materials > spawnicons > models, you can pick out your username from the list of folders and enter it to delete the icons (the same username used in your .qc file.) New icons will automatically be generated upon re-entering Garry's Mod, displaying previously untextured icons as textured.
[Part 5] Making Viewmodel Arms
Your model's almost ready! All we need to do now is create the viewmodel arms. They're technically not required, but it's a real bummer when you find out a model you really like doesn't have matching viewmodel arms. So, I'm requiring it! Take that!!

OPTIONAL: If you'd like to use the longer method to make potentially more accurate viewmodel arms, jump to O - Better Viewmodel Arms, then jump to the 'Start here' footnote upon returning.

In Blender, open a new scene and delete everything but 'Scene Collection'. Import your finished .dmx (post-proportion trick) and delete the 'your_model_pm' collection in then top-right. Make sure to rename the mesh by adding a _carms to the end! Then, enter Edit Mode. In the top-right, toggle the icon with two overlapping squares to enable X-Ray mode. From here, you can box select your mesh to remove vertices until you're left only with the arms of the mesh. I'd make sure to delete any mesh pieces that jut towards the head, as they may obstruct the model's field of view.

Once you're satisfied with your edits, select 'Scene' at the right for another Source Engine Export. This time, we'll set the path to the 'c arms compile folder template' inside the main resources folder. Make sure once more that the Export Format is set to DMX, then press Export > Scene Export.

//Start here if you're coming from O - Better Viewmodel Arms!

Now, we'll edit and compile the .qc for the viewmodel arms. Open pm_carms.qc with Notepad++. Just like the main .qc, we'll be replacing directory names to match our own directories. Nothing else to say here, just make sure that you keep the _carms at the end of the $modelname and $model lines. We'll hop over to the 'Compile' tab in Crowbar once more, this time setting the QC input to 'c arms compile folder template' > 'pm_carms.qc' and the output to 'c arms compile folder template' > 'output'. Hit compile and check for errors as usual.

Inside the output folder, navigate to models > username > your_model_pm and copy all of the files inside. Paste these files inside the models > username > your_model_pm folder INSIDE YOUR GARRY'S MOD DIRECTORY. There should now be 11 files inside the folder. Still inside the Garry's Mod directory, we'll navigate back to our .lua file and open it with Notepad++. Change and uncomment the 5th line of the file as necessary. After that, you're ready to test!

If your viewmodel arms obscure the screen when using the default crossbow or other default weapons, it'll likely have problems with other things. Play around with how you edit the arms in blender to keep it clear.

If you're reading this, congrats!! Again!! Your model's ready to be used and published :D
[Part 6] Publishing
Crowbar makes publishing pretty straightforward, so this'll be short. In Crowbar, move to the Publish tab. A new template should be open by default, where you can insert mod Title, Description, Tags, etc.

For the Content Folder, you'll browse to the your_model_pm folder inside the addons folder of your Garry's Mod directory that we made earlier. You can make the Preview Image anything you want, but I believe it must be under 2mb, meaning that if you want to use the Thumbnail.png in the 'unused_textures' folder, you'll have to compress it.

After that, you're good to hit Publish at the bottom. The log to the right of the Publish button will tell you if anything goes wrong. In the past (this may not be the case for all models), the upload has failed because the .sw.vtx files inside the 'models' folder aren't allowed by the whitelist. While taking these files out of the folder solves the problem, I have no clue if this has any consequences (I haven't come across any yet.)
O - Better Viewmodel Arms
This method will have you create two viewmodel arms files: One set without this trick applied, and one with. That way, you can compare which method turned out better. I would only really use this method if the standard method of creating viewmodel arms had a particularly bad result, as doing it the better way will not guarantee the arms are actually better. A video using the process below is also provided.
Open a new Blender scene and delete everything except 'Scene Collection'. In 'smd references' in the main resources folder, import c_arms_citizen.smd and c_arms_citizen_hands.smd at the same time. Note that you will not move or scale the reference at any point in the process. Then, import the finished model .dmx. Make sure to set 'Append to Target' to 'Make New Armature'. Enter Edit Mode on your model's mesh and toggle X-Ray mode in the top-right. We'll start by deleting vertices for everything but the arms using box select.

Once you're satisfied with how they look, go back to Object Mode and select the finished .dmx armature. In the Data tab (green stickman icon) on the right, expand 'Viewport Display' and turn off the 'Shapes' checkbox under 'Show'. This will make it easier to align the bones between the reference's and our own model's skeletons. Then, select your model's armature and enter Pose Mode.

What we want to do is align the bones and mesh of the Vroid model with that of the reference. You can use S (scale) and G (move) to accomplish this, among other methods of alignment. Any time you scale or move the Vroid model mesh and armature, make sure to apply the change by selecting both and pressing Ctrl+A > Apply > All Transforms (note this can only be done in Object Mode). Try to prioritize aligning the fingers, as they're the most important thing to get right. It's also fine to stretch the mesh if needed, as long as you have a good idea of what will be shown and hidden in the viewmodel arms animations.

Once you've aligned the meshes and bones to the best of your ability, get one more Apply > All Transforms in for good measure. At this point, you can delete the mesh of the reference arms and hands. Select the finished model mesh and go into Data. For the next step to work, you need to delete all shape keys stored in the mesh. Then, go to the 'Modifiers' tab (blue wrench icon) and apply the armature by clicking the dropdown arrow and clicking 'Apply'. Then select the finished model skeleton, enter Pose Mode, and with the entire skeleton selected, go to Pose > Apply > Apply Pose as Rest Pose at the top.

Back in Object Mode, we'll go back to Modifiers and add a new Armature to the finished mesh. For the target object, select the reference skeleton. Rename the mesh to something useful like 'your_model_pm_carms_unedited', select only the reference skeleton and finished model mesh, and do a REGULAR DMX export (not scene export!!), which is just the option above scene export.

To export the edited skeleton, we'll once again go to Modifiers on the mesh and switch the target object to the finished model's skeleton. Rename the mesh to something like 'your_model_pm_carms_aligned', select only the finished model skeleton and finished model mesh, and do another regular export.

Now, you can jump back to Part 5. You should have two different viewmodel arms you can test, so here's hoping the aligned skeleton was worth the effort!
O - More Accurate Ragdoll Physics
The goal of this section is to better align the physics ragdoll with the mesh of the finished model. We'll do this using Blender. A video has also been provided using the same process detailed below.
Open a new Blender scene and delete everything but 'Scene Collection'. Then, select File > Import > Source Engine and navigate to compile folder template > proportion trick compile inside the main resources folder. Then, import fembase_physics.dmx or mascbase_physics.dmx, depending on your model. Delete the skeleton and collection that imported with the mesh. Then, import the .dmx of your finished model, making sure to switch 'Append to Target' to 'Make New Armature'.

Switch to Wireframe Mode by selecting the wireframe sphere in the top-right. For ease of editing, you'll probably want to do most of the editing in 2D views, which can be switched to by either navigating through the view choices in View > Viewpoint in the top-left or by clicking on axis ends of the colored viewpoint gadget in the top-right. Enter Edit Mode on the physics model mesh. To the best of your ability, you want to align the pieces of the physics mesh up with parts of the finished model. A few tips when doing this:

1. You can select a vertex then press L to select linked, which will select all vertices of a physics mesh chunk. You can use this in combination with shift to move multiple chunks at once.
2. It's okay if pieces of the physics model mesh jut out or are contained completely inside the finished model mesh. As long as it's close enough!
3. When adjusting the physics model chunks for the hands, make sure the mesh of the finished model's hands are contained completely inside the physics model mesh. It's important for finger posing!

Once you're satisfied with your modifications, you can delete the finished model mesh. Back in Object Mode, select Modifiers on the physics model mesh and set the target object for the armature to to finished model's skeleton. At this point, rename the mesh to something useful like 'your_model_pm_physics'. After that, you're good to make another Scene Export in the DMX format, exporting to the 'proportion trick compile' folder. Lastly, change the name of the physics model .dmx in your .qc to match the one you made and recompile the model.
O - Defining and Altering Jigglebones
If you want your model to have physics bones for hair/cloth/bust/etc, read this section. Additionally, I've included a video following the same process written out here, done for the model's hair bones.
In the main resource folder, 'physconstraints.txt' contains a separate set of physics constraints for hair, bust, and cloth. They're slightly edited to work better with the Vroid Studio model's physics, but you may need to tweak them further to be perfect for your model. Make sure you know which bone controls what part of the model when you're defining the jigglebones, as it comes in handy for tweaking specific bones.

The easiest way I found to do this is to open your finished model in Blender. Have your main .qc open too, and find the comment about jigglebones. For every bone, paste the jigglebone template into the .qc and replace the . in the jigglebone template with the name of a bone you want as a jigglebone. You can easily access bone names by going into Edit Mode or Pose Mode on your finished model and selecting individual bones. Some bones may not actually control a part of the mesh they're inside, which tends to happen with the ends of hair. There is no need to add jigglebone definitions for these bones. After you have all the jigglebone definitions you need, recompile the model and update the folder in your Garry's Mod directory.

It's more likely than not that some of the bones will go unused, which will be labeled as 'unused' when compiling. It seems to be by design of the vrm armature. Although it isn't necessary, feel free to delete $jigglebone definitions for unused bones. Also, feel free to delete/exclude physics definitions for certain hair bones if they cause clipping issues with the head (you'll find this out after compiling), something that tends to happen with upper hair bones. This WILL cause these bones to be rigid, but it's less noticeable for upper hair bones + clipping looks pretty bad.

For minor physics adjustments, you'll be spending most of your time adjusting the values in the jigglebone definitions for length, pitch/yaw_stiffness, and pitch/yaw_damping. Read here if you'd like some additional information on each attribute.
> https://developer.valvesoftware.com/wiki/$jigglebone
Credits, Troubleshooting, and Final Remarks
========
CREDITS
========
First of all, HUGE thanks to Deadwater Gaming for letting me make a fork of their video guide. The updated guide relies on his content much less so now, but I still couldn't have made this guide without his materials. They seem super chill and I accidentally ended up watching some of their content. Go follow them on everything! https://www.youtube.com/@DeadwaterGaming
Next, extra shoutouts to:
HeyKaisky - How to fix the model for bodygroups (the method I had before I found this was much worse) - https://www.youtube.com/watch?v=TsvYxMFkdT4&ab_channel=HeyKaisky
Siknesd - On how to add a blink animation - https://www.youtube.com/watch?v=fz-4TJyeR5M&ab_channel=Siknesd
Artificial Light - For making the original version of the bone renaming script - https://www.youtube.com/@ArtificialLight
nombremuyoriginal - For re-purposing Artificial Light's script to rename bones - https://steamcommunity.com/profiles/76561199388415699
LightShoro - For having published a .dmx version of the general porting process I could study for the updated guide - https://steamcommunity.com/id/LightShoro
Enderbendfender - The original inspiration for me ending up making this guide, after wanting to figure out how to port my own model into the game. He's so cool - https://www.twitch.tv/enderbendfender
Shameless Plug - I also do stuff, like streaming! I got all my socials here - https://linktr.ee/soampbar

And, everyone who's helped with bugs:
Alejolanz - The first person other than me to actually test the guide. Shared good info about revisions and the .dmx model format - https://steamcommunity.com/id/Alejolanz
rizu. - Discovered what caused some models have duplicate facial flexes; provided a fix for untextured icons in the playermodel selector - https://steamcommunity.com/id/Injitin
==============
FINAL REMARKS
==============
I've published the model used in this guide to the workshop (as well as several other models made with this guide's methods), which can be found here:
https://steamcommunity.com/sharedfiles/filedetails/?id=3102463427
The whole reason I made this guide was because people who knew how to do all this didn't seem to want to make a guide for it. So hopefully this helps! That being said, though, this guide isn't perfect, and I'm no expert. If you have any suggestions for fixes/optimizations of this guide, please let me know in the comments!

I'm also planning to make a similar guide for Left 4 Dead 2 sometime in the future. I assume it's a different-ish process, so it probably won't be out for a while. I'll post updates when I get around to it!
nombremuyoriginal is also working on a Spanish translation, which is honestly quite lovely
Thanks for reading <3
=================
TROUBLESHOOTING
=================
I have current issues listed below.
1. For those who do wish to preserve it, neither the hair emission texture nor the character outline is preserved in conversion. There are definitely ways around this, and I'm looking into it!
2. Blinking flex method may be outdated as the flex is defined and working in the face poser but the blink will not occur. I don't believe this is a .smd to .dmx transition issue, as models that were uploaded in the old (.smd) format lost blink functionality too.
3. There's been a particular unicode problem with importing into old blender that MIGHT have to do with user language settings. Still looking into a fix at the moment, but until I get confirmation I can't really say why the import doesn't work

BEFORE LEAVING A COMMENT: If you run into any problems in porting your model, try looking here first: https://github.com/Althories/vrm-porting-guide-troubleshooting.
This repository lists some of the more common problems, with fixes to match.
945 条留言
Soampbar  [作者] 4 月 4 日 上午 7:04 
@Xboxlegend1336 np :steamthumbsup: :P3R_Aigis:
Xboxlegend1336 4 月 3 日 下午 9:36 
Oh ok I see. That's alright then. Though people gatekeeping the process when itself is a bit easy if hard at first too. But glad you did make a guide like this. Thank you so much too for some of the help as well.
Soampbar  [作者] 4 月 3 日 下午 8:55 
@Xboxlegend1336 I have no experience working with MMD, so it would not be something I'd work on anytime soon. Sorry to disappoint!

A big reason I made this guide was cause I saw porters kinda gatekeeping the vroid to gmod process and it ticked me off
Xboxlegend1336 4 月 3 日 下午 7:45 
Oh and I wanna ask. Do you ever consider doing a tutorial for MMD models? I've been wanting too do one despite one already existing in the workshop but I still wish to hone my skills further. I'm only asking cause considering this is a tutorial on RVoid models, I wonder if the process could be the same or slightly different to MMD models. Trying to find any tutorials on youtube or online forums is difficult too. If it's not in your consideration that'll be fine.
Soampbar  [作者] 4 月 3 日 下午 3:34 
@Xboxlegend1336 :mhwgood:
Xboxlegend1336 4 月 3 日 上午 8:33 
I went back to the part one before the proportion trick and realized I forgot to add the underscore to 22 which was why it kept showing as a error texture since I forgot to add it so I'm good rn. But thank you very much.
Soampbar  [作者] 4 月 2 日 下午 7:16 
@Xboxlegend1336 apologies, I was away at a movie event. What did you change to get it to work, if you know? I try to write down bugs to put into the troubleshooting log
Xboxlegend1336 4 月 2 日 下午 7:09 
Ok finally got it to work, thanks
Xboxlegend1336 4 月 2 日 下午 5:19 
So when doing the whole blender thing in part one I must've screwed something up? Could it be fixable easily or do I have to go back and go through the process again?
Soampbar  [作者] 4 月 2 日 下午 4:40 
@Xboxlegend1336 Oh! At least there's something that you can confirm is off. Perhaps the same inconsistency is reflected in the part 1 material list.