Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Importing models from Source Engine games into Maya
#1
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]
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#2
This is epic Awesome much better then my 3dripper stuff Awesome i love you
Reply

#3
repd
awesome thanks
Reply

#4
very nice , i might do one for udk games if someone doesn't beat me to it
Reply

#5
Nice UFO OMA
Reply

#6
It's not a UFO. Tongue
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#7
I can export gmod weapons which are in a mdl format as well with this tool?
Reply

#8
will player model skins work as well?
I like turtles
[Image: thumb-275x274-design-609.png]

Reply

#9
(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)
Reply

#10
Player models should work but as I said at the top, you might to merge some models together.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 4,142 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,748 11-08-2013, 05:25
Last Post: [HARD] Tony.
  [Request] Health and Points on hud source robinvm 7 5,636 10-27-2013, 08:23
Last Post: robinvm
  TUTORIAL CHEAT ENGINE for mw3 [HARD] Tony. 5 4,718 10-24-2013, 15:22
Last Post: Tomsen1410
  [Release] [SOURCE] DOOR V2.0 [HARD] Tony. 5 5,391 09-26-2013, 14:01
Last Post: Nekochan
  Spawning Solid Models akillj 5 4,433 09-08-2013, 00:07
Last Post: akillj
  Help Importing BO2 Dog Tags to BO DidUknowiPwn 5 4,022 09-02-2013, 06:37
Last Post: Nekochan
  Using Cheat Engine 6.2 to change BO2 address values wzlrsaur 6 8,150 08-06-2013, 06:28
Last Post: 14th
  [source] medic E-losev 6 5,855 07-26-2013, 06:18
Last Post: E-losev
  [source] vAmpIr E-losev 5 4,972 07-25-2013, 16:28
Last Post: Bandarigoda123

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.