Please or Register to create posts and topics.

How do I decompile models for use in Blender?

PreviousPage 2 of 2

http://www.erikszeug.de/files/Programmi ... 20Fixed.7z
Take this and be happy.

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.

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.

Falsi sumus crusto!

If you forgot the .mdl extension or are using an output directory that does not exist, it crashes.

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?

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.

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.

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?

materials/models/. The model viewer (not the one inside hammer) will list all the textures associated with a model.

My stuff:
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]

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.

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
PreviousPage 2 of 2