Is decompiling a Source Engine .mdl even possible anymore?


I haven’t touched Source .MDL files to animate for sometime now and Ive noticed that I cant decompile a single .mdl from and Source game correctly without a complete failure on the decompiler’s end, whether it be it failing to decompile completely, or partially compile most animations but leave most .smd files damaged and unusable. I’ve tried using every variant of MDLDecompiler and StudioMDL but to no success.

My question is; does anyone know how to properly decompile models from, for example, Team Fortress 2?

I have searched all over the internet but have found no answer and I was hoping someone here on Facepunch may be able to help me,



Did you just skim the thread and notice he mentioned TF2? He’s asking if there’s a way to decompile models without fucking up the animations.

-snip being a dick-

You’re making an ass of yourself

[editline]31st July 2012[/editline]

There is no known way to properly decompile Orange Box+ engine models animations by the way. Daimao was writing a decompiler that could do it (and it even worked for all SMDs, couldn’t create a useable QC though iirc), unfortunately he hasn’t been working on it for at least a year and he never even released a private beta, let alone a public one (I had to personally ask him everytime I required a model to be decompiled).

Alright, thanks for answering my question.

[editline]31st July 2012[/editline]

I previously mentioned in the original post that I searched the internet and tried every method shown on those websites and they still turn up no results.

If you just need the animations, you could hex the original model, and include it in your compiled one.

Do you mean using $includemodel in the .qc for the model containing my animations?

I mean hex the original.
Decompile the unhexed version. Make your own animations, and also $include the hexed model so that the original animations are intact.

Actually, that reminds me, each of the Team Fortress 2 classes have two animation .mdls: “class_animations.mdl” and an empty .mdl called "class_user_animations.mdl.

This must mean I can use the user_animation.mdl instead of hexing as it decompiles correctly, so I can just apply the method you mentioned to it.

Doesn’t the SDK GCF have sources for all the player models? Or are they horribly out of date now?

To my knowledge, the Source SDK’s .GCF files only contain the content from Half-Life 2. Anything else is pretty much read from the corresponding .GCF files of other Source games. Don’t quote me on that one though, that’s just my speculation.

They’re in a folder named sourcesdk_content in the folder named after your account but I think they haven’t been updated for a long time now.

I know for certain models you cant decompile them for 2 reasons.
First its missing a .dx80.vtx file and if you open the .mdl with notepad you might see IDST1, or something like that which needs to be changed to IDST0

The only class that has provided files is the Heavy Weapons Guy and most the files are outdated.

The HL2 animation files only have a few actual animations such as a few weapon holdtypes.

Refresh your sdk content, all the TF2 player sources are available now.

Their animations are .dmx which cannot be opened in 3DS MAX.

Couldn’t you just buggily copy the .dx90.vtx and rename it like they used to do?

Unfortunately no, that doesn’t seem to work properly anymore. On top of that, opening the .mdl file in Notepad or any other program is unnecessary if Hooch’s fixed version of MDLDecompiler is used instead of Cannonfodder’s.