Hexing Source Models In The Year Of Our Lord 2022

Because For Some Reason We’re Still Using This 18-Year-Old Game Engine


What Is Hexing?


Hexing is a very old technique for creating independent copies of Source models. Its name derives from its using a hex editor to modify the target model files, which are binary formats that cannot be easily edited with a text editor like Notepad.


When To Use Hexing?


You use hexing whenever you want to make changes to a model’s materials, but you don’t want to affect any existing project files or saves that use that model. In the days of old, this was predominantly used for personal skins, where several people can have their own unique textures for the same character models. Hexing allowed all of these unique textures to be used simultaneously.


Why Hex?


Hexing is much faster than decompiling and recompiling models, requires much less setup, and has less things that can go wrong.


Hexing is much more scalable than using Material Overrides, only needing to be done once per unique material setup desired. Material Overrides have to be repeated for every shot in every project file.


What Can And Can’t Hexing Do?


Hexing can only change the materials used on a model. It cannot add additional functionality, like new flexes or bodygroups. It cannot add new materials or skingroups. It cannot arbitrarily rename models or materials. It is an extremely simple operation, and can only accomplish the extremely simple task of making a model’s materials independent.


What Do You Need To Hex?


You need the completely free programs of XVI32 and Notepad++. These are both extremely lightweight programs.


How Do You Hex?


The process of hexing is extremely simple. You can click here to watch a video on how to hex. Here is the process, typed up with images.


1.) Find all model files sharing the name of the model you wish to hex. Make a copy of them all. For this example, we will hex kleiner.





2.) Rename all of the copied files, changing precisely one character* in the filename. For this example, we will rename the copies to kleine2.





*You can technically change any characters that you want. However, the number of characters must rename the same. It is for this reason, and for simplicity, I recommend only changing a single character. Similarly, I recommend only changing the last characters in the model name, so that the models will show up right beside each other in Source Filmmaker’s model browser.


3.) Open the newly-renamed .MDL file in XVI32. At the very top of the file, you see the old model name. Make the same exact name-change as you did to the file. The filename must exactly match the name you change it to in XVI32.




4.) Scroll down to the very bottom. You will see a handful of material paths. Change the relevant material paths. In this example, we are going to change models\Kleiner to models\Kleine2. Save the file and close XVI32.




5.) Find and copy the material paths you changed in XVI32. Rename them to match the changes you made.



6.) Open the newly renamed material paths. Sort the folder by Type. Select all of the VMTs, right-click, and choose Edit With Notepad++.






7.) Use Ctrl-H to bring up Find and Replace. Find the old material path, and replace it with the new material path. Replace All in All Opened Documents. Then use Ctrl-Shift-S to save all open files.



8.) Your model is now successfully hexed! Make any changes you wish to this new material folder.


For this example, we are going to change Kleiner’s face texture to his mouth texture.


Then we simply go into Source Filmmaker, spawn in the original Kleiner.mdl, and spawn in the newly-hexed Kleine2.mdl. We can see them here, side by side, wholly independent of one another.