[Valve Files] Model/Material Editing

Hey guys,
I would like to edit the ak47 (Gmod/CSS) files, and i did edit the material, the thing is, I want to “create” a new weapon with the new material I made, and use with the original model.
If I simple change the name of the model to match the material, it doesnt work because the model file has the material path in it right?
How can I edit the material path on the model?
Sorry for my noobness :stuck_out_tongue_winking_eye:

Thanks for reading :slight_smile:

If I’m not mistaken you have to decompile the .mdl and tell it a new $cdmaterials path in a new .qc file and compile it again

Ok I will try to do that :smiley:

Hex editing should achieve exactly that. http://source.gamebanana.com/tuts/8003

Hex editing has it’s pros and cons. The pro is that it used to be faster than decompiling and recompiling (not anymore due to Crowbar making that extremely easy to do), while the cons are that you are limited to the amount of characters you can use to rename the file, and in this case you also have to “hex” the materials by changing the folder and/or file names to fit the same character limit.

Also if you mess up one thing the whole model is ruined, whereas decompiling > edit QC and SMD’s > recompile is much easier and has a much lower chance of getting broken.

Actually the benefit of hexing is that you get a 1 to 1 version of the model, including stuff like flexes. The problem decompiling has, is that decompiling is never 100% perfect.