Kitty Corp Meow Mix Forums

Help & Tutorials => Model Tutorials => Topic started by: Oizen on January 16, 2012, 06:25:14 PM



Title: How to import models from Valve's Source games.
Post by: Oizen on January 16, 2012, 06:25:14 PM

I've recently figured out how to port models from Valve's source games (Half Life, Team Fortress 2, Counter strike ect.) and a good deal of Garry's Mod model you can find. (http://www.garrysmod.org/downloads/)
Here's an example of a model I took out of Portal:
(http://i42.tinypic.com/2h6ga3m.jpg)

If you want an in-game shot check this out (http://kc-mm.com/oizenx/dragonborn/01-16-2012/)

Required tools:
3dsmax 2011
The SMD importer plugin. (http://www.chaosincarnate.net/cannonfodder/cftools.htm) The 2010 version works with 2011.
Steam (http://store.steampowered.com/)
A source game. I recommend Tf2, since its free. (http://www.tf2.com)
SourceSDK, you can download this with steam for free if you own one of Valve's major Source Games.
GFScape (http://nemesis.thewavelength.net/index.php?p=26) Only needed if you're ripping from a game yourself.
MDLdecompiler (http://www.chaosincarnate.net/cannonfodder/cftools.htm)
VTFEDIT (http://nemesis.thewavelength.net/index.php?c=178) for extracting materials.

Your favorite Hex editor.

Only read this part if you're extracting a model yourself
Assuming you already own a Source game for steam, you should have .gcf files located in:
C:\Program Files (x86)\Steam\steamapps

Open the game with the model you want in GFScape, I'll be using Portal. If you're using tf2, you're going to have to open team Fortress 2 Materials.gcf Theres two folders you need to be concerned about Materials and Models. Materials contain the textures, while models contain the models.


First we need to extract the model itself, this may require a little bit of digging around.

1.Find the model you want and highlight every file with a similar name to your file (.mdl), right click and extract it to whever you want.

(http://i41.tinypic.com/dvq6pf.jpg)

next we'll need the textures, which are usually in a similar path, only in the materials folder, again export all of the files with a similar name to your model.

(http://i39.tinypic.com/10dt921.jpg)



This next step may already be done, but its important you check anyway.

Open your .mdl file in a hex editor and make sure the character I highlighted below is a ",". (Tf2 models are 0 by default)

(http://i44.tinypic.com/2wnqp2b.jpg)


Open the mdldecompiler and input your model, and an output path, The model decomplier must be located in:
C:\Program Files (x86)\Steam\steamapps\*SteamUserName*\sourcesdk\bin\ep1\bin\ for it to work!

(http://i43.tinypic.com/23iazr4.jpg)

Export your model, and open 3DSmax 2011, and import the ".smd" file the MDLDecompliler makes.

(http://i40.tinypic.com/4l3ebk.jpg)

Now for the textures,  Open the .vtf files with VTFedit, and go File > Export, and chose whatever image format you want. Occasionally, you have to fight with the settings on VTFedit to get the entire texture.

(http://i41.tinypic.com/2h30epl.jpg)

Apply your texture in 3dsmax, export it as a .dae, and you're good to go.

(http://i42.tinypic.com/24e7u5s.jpg)
(http://i40.tinypic.com/1e2xbp.jpg)

I'll do .bsp files (maps) some other time.


Title: Re: How to import models from Valve's Source games.
Post by: BriefCasey795 on January 17, 2012, 08:33:46 PM
oh sweet! now we can have tf2 imports! :D


Title: Re: How to import models from Valve's Source games.
Post by: Oizen on January 17, 2012, 10:00:05 PM
oh sweet! now we can have tf2 imports! :D

Indeed. I've also been experimenting with importing tf2 maps aswell.

But they're significantly larger in file size, the most promising right now is Watchtower.



Title: Re: How to import models from Valve's Source games.
Post by: BriefCasey795 on January 18, 2012, 08:01:57 PM
Yea we really need some tf2 stages to go with the tf2 hacks. 2fort looks like a cool place to brawl on. maybe you could brawl on the RED second floor and BLU second floor. Also, i hope someone can do a model import for heavy on ganondorf.


Title: Re: How to import models from Valve's Source games.
Post by: JBG on March 20, 2012, 02:38:49 PM
Here's a good question.

If you rip a model, is it already rigged?


Title: Re: How to import models from Valve's Source games.
Post by: BriefCasey795 on March 20, 2012, 06:47:38 PM
Most items only have one bone so basically, yeah. I also have a good question: how do you apply the textures? 3ds max or brawlbox?