ItsMods

Full Version: Importing models from Source Engine games into Maya
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This is a tutorial on how to get models/textures from a Source Engine game (I assume most Source Engine games pack files like TF2). In this tutorial, I will be using Team Fortress 2. I would like to thank moley @ fpsbanana for some of this tutorial. Please note I have not tested this on a character model since it appears some of the body parts are separated and it's pretty tedious to do.

Requirements:
- Maya 2009 (or whatever)
- Source SDK (free from Steam)
- GCFScape
- VTFEdit
- StudioCompiler

Setting up (one time only) - sorry, no screenshots for this
1. Install the Source SDK, GCFScape, VTFEdit and StudioCompiler (or download the compressed version).

2. Go to <Steam Folder>/SteamApps/<your username>/sourcesdk/maya/4.5/scripts and copy everything into My Documents/maya/scripts (overwrite if necessary).

3. To fix any compatibility problems, go into the smd folder and select smdRead.mel and smdMakeShader.mel. Right-click on one of them and click Properties and uncheck the Read-Only box and click OK.

4. Open smdMakeShader.mel with Notepad/text editor and change this line:
connectAttr -f ($place + ".mirror") ($fileTex + ".mirror");
to this instead:
//connectAttr -f ($place + ".mirror") ($fileTex + ".mirror");

5. Save and close and then open smdRead.mel and change this line:
print system "time";
to this instead:
//print system "time";

6. Save and close.

Extracting GCF Files (and VPK files*)
1. Open GCFScape and click File > Open. Browse to the GCF file you would like to extract from. In this example, I'm using team fortress 2 materials.gcf.
*(note, for games that use the new VPK format such as L4D2 and Portal 2, you choose the VPK which is named pak<number>_dir.vpk)

[Image: 1409201144700pm.png]

2. Find the model(s) that you would like to extract. You can normally find models in <game name>/models.
[Image: 1409201144715pm.png]

3. Find the model(s) (with the .mdl extension, include any .vtx and .vvd files if they exist) and extract them by right-clicking and clicking on Extract.
[Image: 1409201145020pm.png]

4. Now, we will need to find the matching texture file for the model. You can normally find textures in the <game name>/materials folder. Go into the models folder and find the matching .vtf file for the model. (eg. my model was in tf/models/props_gameplay so the texture should be in tf/materials/models/props_gameplay). If only a .vmt file exists for the model, extract it and open it with Notepad++ (or whatever) and look at the texture referenced next to $basetexture and find it.
[Image: 1409201145329pm.png]

5. Extract like before and close GCFScape. Open up StudioCompiler (run as admin on Windows 7/Vista) and click on the Model Decompile tab. Browse to the MDL file and choose an output directory.
[Image: 1409201152447pm.png]

6. Hit Extract and click OK. If it fails, try ticking Dump Old Unweighted SMD's.
[Image: 1409201145926pm.png]

7. Now we've got the models all sorted out. Now we need to convert the VTF files into a format that Maya can understand. Open up VTFEdit and go to File > Open. Browse to the VTF file.
[Image: 1409201150241pm.png]

8. Go to File > Export and select .PNG as the save as type (for some reason TGA doesn't work). (If the texture does not look the same or seems like it has something missing, save it as TGA and use a program like Photoshop and save it as a PNG).
[Image: 1409201150411pm.png]

9. Open up Maya and click on File > Import SMD. Find the SMD file for your model (normally it's the name of the .mdl file with _reference at the end).
[Image: 1409201151707pm.png]

10. Another popup should appear, it's looking for the texture file. Browse to the PNG we created with VTFEdit and wait while Maya renders the vertices.
[Image: 1409201151740pm.png]

11. A popup should come up asking what direction you would like the model to be but you can select No Change since it should already be OK for the COD world.
[Image: 1409201151859pm.png]

Enjoy, hope this worked for you! The texture for the model should be in Hypershade already. Wink

[Image: 1409201151635pm.png]
This is epic Awesome much better then my 3dripper stuff Awesome i love you
repd
awesome thanks
very nice , i might do one for udk games if someone doesn't beat me to it
Nice UFO OMA
It's not a UFO. Tongue
I can export gmod weapons which are in a mdl format as well with this tool?
will player model skins work as well?
(09-14-2011, 15:02)birdplane Wrote: [ -> ]will player model skins work as well?

[Request] TF2 spy pistol (Diamond Black thats the name of the one I want)
Player models should work but as I said at the top, you might to merge some models together.
Pages: 1 2