Materials Extractor! (MDL)

Hi, This small app outputs a list of all materials and the material directory a file uses.
In some cases, it’s quite nice to have this easily delivered without having to decompile the model and gaining a shitton of files.

Simply drop the file (.mdl) you’d like to extract info from onto the .exe and it’ll output it to a “output.txt” file in the same directory.
You can also drop a whole folder on it, the program will search through the folders recursively and output the info from all .mdl it finds!

It’s written in C# so you need .NET for it to work, and yeah, Windows only.
Does not require any other .dll or library!

I’ve tried it with models from HL2, EP2 and Portal, and they all work fine, so it should work great in most cases.

Please report any exception or problems you might find!

Download:
https://dl.dropbox.com/s/h5j1xjbaedw349j/MDLToMaterials.exe?dl=1

Source:
https://dl.dropbox.com/s/y24c7jlum3iujz6/Program.cs?dl=1

Example output (combineball.mdl):



directories:

models\effects/

files:

comball_glow1
comball_tape
comball_glow2
comball_sphere


Useful as heck!

[editline]27th December 2012[/editline]

Works great.

[editline]27th December 2012[/editline]

My one suggestion would be to name the output.txt the same as the .MDL that is inputted.

Done, if you put in a single file it’ll name it “<filename>.txt”, else if you put in a folder it’ll go back to output.txt

this is really useful for people that don’t want to dig through a .mdl in notepad. Keep up the good work.

I’ll stick to doing it the old fashioned way since it’s second nature to me though.

Neat! I’m sure this will be useful to many.

Um I think there is more to it than me being too lazy to look with notepad or XVI32. Think of things like TNB’s content pack, maybe I want to use one of heads on their models. Pretty impossible though, because they put like every material in it’s own folder. Manually looking for the materials of their male_54 model took me 15 minutes.

is this wunderboy’s?

No, I made this myself by looking at the StudioMDL structs on the valve devwiki and source’s sourcecode.

what are the differences, if any, between this and wunderboy’s or is it just another option? i don’t have anything against more options, i’m just curious. i’ve used his once to sort out one of my models and found it very helpful, if limited and command line based.

Err, Which are you talking about? I’ve not seen any tool like this in the past, the only thing similar which I’ve seen is the cannonfodder’s mdldecompiler which barely works anyways.

He means mdltexture info

I think the main difference is that his outputs it inside of the commandline, whereas yours outputs it to a textfile really.

correct

I have had intentions to build such a tool, but couldn’t think of a way to properly parse the MDL file.

It never occurred to me see if code regarding how StudioMDL works was on the Valve developer wiki.

You saved me some work by doing this. Thank you. :v: