How do I decompile models for use in Blender?
Quote from Skotty on October 23, 2013, 6:01 pmhttp://www.erikszeug.de/files/Programmi ... 20Fixed.7z
Take this and be happy.
http://www.erikszeug.de/files/Programmi ... 20Fixed.7z
Take this and be happy.
Quote from DFTBA on October 23, 2013, 6:20 pmNow the program starts properly, but hitting "Extract" makes it run for a moment, then I get "Half Life2 MDL Decompiler has stopped working". The files do not appear at the destination.
Now the program starts properly, but hitting "Extract" makes it run for a moment, then I get "Half Life2 MDL Decompiler has stopped working". The files do not appear at the destination.
Quote from FelixGriffin on October 23, 2013, 6:44 pmWhich model did you try to decompile? It's to be expected that the decompiler will crash like that, but usually it will spit out a few of the files before dying.
Which model did you try to decompile? It's to be expected that the decompiler will crash like that, but usually it will spit out a few of the files before dying.
Quote from Skotty on October 24, 2013, 9:47 amIf you forgot the .mdl extension or are using an output directory that does not exist, it crashes.
If you forgot the .mdl extension or are using an output directory that does not exist, it crashes.
Quote from DFTBA on October 24, 2013, 10:28 amAlright everyone, all your help was able to get me a model file that opens in Blender. However, the whole thing is grey. I know I need to apply the texture file to it. How do I do that? What I mean is, where are the files for the textures on models?
Alright everyone, all your help was able to get me a model file that opens in Blender. However, the whole thing is grey. I know I need to apply the texture file to it. How do I do that? What I mean is, where are the files for the textures on models?

Quote from Gemarakup on October 24, 2013, 11:45 amThe VTFs and the VMT's are the textures for the model, but I don't think you apply them in the modeling application, I think that somehow the model gives you information about the scale of the texture.
The VTFs and the VMT's are the textures for the model, but I don't think you apply them in the modeling application, I think that somehow the model gives you information about the scale of the texture.
Quote from Skotty on October 24, 2013, 12:30 pmModel textures are in Portal 2's VPK files. To open them, download GCF Scape. Use portal2_dir.vpk to open the game's content. To get a .TGA file from the .VTF files, you need VTF Edit.
Model textures are in Portal 2's VPK files. To open them, download GCF Scape. Use portal2_dir.vpk to open the game's content. To get a .TGA file from the .VTF files, you need VTF Edit.
Quote from DFTBA on October 24, 2013, 1:48 pmYeah, I found the vpk files and stuff. That's how I got the original mdl. But, within that file in GCFScape, where in the folders are the files relating to the model textures?
Yeah, I found the vpk files and stuff. That's how I got the original mdl. But, within that file in GCFScape, where in the folders are the files relating to the model textures?

Quote from TeamSpen210 on October 24, 2013, 3:29 pmmaterials/models/. The model viewer (not the one inside hammer) will list all the textures associated with a model.
materials/models/. The model viewer (not the one inside hammer) will list all the textures associated with a model.
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]
Quote from HMW on October 24, 2013, 3:51 pmEdit: I had typed up a convoluted process here for getting the full paths of the materials, but that's actually much simpler... I totally forgot you could see this in the model viewer
Anyway, once you know where the materials are, open the Portal VPK file and look for a .VMT file with that name. It is a text file that describes the material and it will have one or more lines referring to yet another set of files of the type .VTF. Those are the actual textures, which you can open with VTFEdit and extract the image file (PNG or TGA, likely) for use in Blender.
To make this texture show up on the model in Blender:
make sure you have a 3D panel and an image/UV panel open. Switch to edit mode in the 3D panel and select everything. In the UV panel select everything again and click on "image => open image" from the menu. Select your extracted PNG or TGA image in the file browser to associate it with all faces on the model.
Edit: I had typed up a convoluted process here for getting the full paths of the materials, but that's actually much simpler... I totally forgot you could see this in the model viewer
Anyway, once you know where the materials are, open the Portal VPK file and look for a .VMT file with that name. It is a text file that describes the material and it will have one or more lines referring to yet another set of files of the type .VTF. Those are the actual textures, which you can open with VTFEdit and extract the image file (PNG or TGA, likely) for use in Blender.
To make this texture show up on the model in Blender:
make sure you have a 3D panel and an image/UV panel open. Switch to edit mode in the 3D panel and select everything. In the UV panel select everything again and click on "image => open image" from the menu. Select your extracted PNG or TGA image in the file browser to associate it with all faces on the model.
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic