This guide will go through the process of getting files for a Source SDK character that can be edited in a modeling program and an image editing program. The process for non-character objects would be similar.
You will need
VTFEdit
GCFScape
MDLDecompiler (drop this .exe into C:\Program Files\Steam\steamapps\
How it's done
Extracting from GCFs
First, a little background information. All of the Steam game assets are found in GCF (Game Cache Files) files that relate to each of the games. They're all packaged together like that so that the game assets aren't changed when you're working with your own files. You have to extract out your own copy to edit and use.
1) Install GCFscape and in the installer choose to have it associated with GCF files.
2) Navigate to where the GCF files are stored.On my computer (and probably yours too) it's on C:\Program Files\Steam\steamapps.
3) We have to open up two different GCF files to get what we need: one for the .mdl files, which hold the character's structure and animations, and one for the .vta files, which hold the character's texture information. First, we look for the .mdl file. In my case, I'm exporting the female_02 model. So, double-click on "source models.gcf" and GCFscape will come up with an explorer pane. You can find all kinds of assets in there, but I'm going to navigate to hl2/models/humans/Group02 to get my model. Over in the right pane, select all the items prefixed with Female_02, right click, and select "Extract".
5) Now, we're going to repeat nearly the same process, except for the textures. Open "source materials.gcf", go to hl2/materials/Models/Humans/Female/Group02. Grab and export all the files in that folder to the same folder you put the other stuff in. Those are only the faces for all the females, so you'll also need to get their clothes, eyes, and mouths. These are found a folder up in hl2/materials/Models/Humans/Female/. Select all the files in that folder, and export them as well.
You're done extracting from the GCF file!
Decompiling the model
Now, we want to decompile the model from the .mdl file into some .smd files so we can import them into XSI Mod Tool, or Maya, or whatever other modeling program we're using.
1) Open up MDLDecompiler. It's annoying because you can't browse to the model; you have to copy and paste its location. So, find it in Windows Explorer, copy and paste the address bar, plus the name of the file. Then, you can browse to find the output directory. Make sure all three of the lower checkboxes are unchecked.
2) Click the "Extract" button. If all goes well, a couple dialog boxes will tell you that you've loaded the model, and then that you've completed dumping the model. You're done! If you look in the folder that you dumped it to, you'll find a bunch of .smd files, which are animations and models. You'll find a .qc file, which is code written in Quake C that defines the model and its animations. Then, you'll find one or more .vta files,which define facial animations. We're not opening any of those files yet.
You can edit the SMD files in Maya, given the correct plugins. I'm waiting on a Maya license at the moment so as soon as I get that I'll write a how-to guide on editing SMD models there.
Converting the textures
Now, to get the textures into a format we can work with. The compiler will want .tga files, so we want to decompile the .vtf textures into .tgas.
1) Open up VTFEdit and navigate to the folder where you put all your textures. Or, if you associated your files with VTFEdit at install time, you can double-click on them to open them up.
If you click on a .vmt (Valve MaTerial) file, you'll get a text file that looks something like this:
(for dark_eyeball_l.vmt)
"eyes"
{
"$basetexture" "models/Humans/Female/dark_eyeball_l"
"$iris" "models/Humans/Female/pupil_l"
"$halflambert" 1
}
Don't worry aobut those for the moment. If you open up a .vtf file you'll see an image.
There are bunches of check boxes and stuff on the left that we're not going to worry about for now. They'll be useful on recompile but right now we're just worried about exporting.
2) Go to File>Export and then pick where to save your .tga file. Your file will be exported into that location, then you can edit the Targa (.tga) file using an image editor like GIMP. It's just like editing any other image.
That's it! Let me know if you have any questions.





No comments:
Post a Comment