From Valve Developer Community
Jump to: navigation, search
Español Русский
For a guide to studiomdl's usage, see Compiling a model.

Studiomdl is the command-line tool used to compile models from intermediate formats exported from modeling packages to the binary .mdl format that is read by the Source engine.

It can be found at "common\<gamename>\<gamefolder>\bin\studiomdl.exe".

Tip.png Tip: The name "studio" is a throwback to the development of Half-Life 1, during which Valve used 3D Studio Max to create their models.
Bug.png Bug:  Attempting to use Studiomdl or a shortcut of it pinned to the taskbar in Windows 8 will result in an invalid target path even when -game and an associated path is specified. However using a shortcut on the desktop still works. This is an issue on Microsoft's end unfortunately.


The only parameter required is a QC file. Any others must come before it.

studiomdl [options] <path\QC>


-game <gamedir>
Override the VProject game path.
Suppresses some console output, such as spewing the searchpaths.
Enable Xbox 360 output, overriding the Gameinfo.txt
Disable Xbox 360 output, overriding the Gameinfo.txt
Disable warnings.
-maxwarnings <int>
Print no more than the specified number of warnings.


See $definebone.
Writes extra bone info to the console.
To do: Appears to dump xnode data for each node?
Equivalent to specifying $unlockdefinebones in QC.
Prints engine-ready keyframe data for each animation.


Skip processing DX7, DX8, X360, and software VTX variants (use .dx90.vtx only). This speeds up compiling.
Skip splitting quads into tris. This changes the rendering flags for the model, most likely resulting in slower performance or buggier rendering in-engine.
Don't truncate really big collision meshes (Ep1 only; OB uses $maxconvexpieces).
Ignore all $lod commands.
-minlod <lod>
Throw away data from LODs above the given one (see $minlod).
-mdlreport <path\model.mdl>
Report performance info for an already-compiled model. A QC file is not needed when using this command.
-perf <path\model.mdl>
Same as -mdlreport.
Report performance info, per LOD, as a comma-delimited spreadsheet. It will appear in the form:
Path to VTX, VTX file extension, LOD number (1 is the root lod), tri count, number of batches rendered, number of materials used
Must be used with -mdlreport or -perf!
Note.png Note: It doesn't actually write a spreadsheet to disk.


Dumps various glview files (10 per LOD per VTX file),
Dump hitboxes to console.
Tag bad normals.
Dump names of used materials to the console.
Ignore warnings.
Replaces all materials with the default pink check pattern
Prints an easily parseable message indicating whether the compile was successful or a failure.
Prints info on which bones are being retained and which bones are being collapsed.


Disables Valve's Perforce integration. Unless you actually have Perforce set up for your game/mod (a highly unlikely scenario), you should use this.
Compile the model, but don't actually write the results to disk.
-a <normal_blend_angle>
Auto-smooth faces equal to or below specified angle. Will override normal data for all meshes.
Flip all triangles.
Bug.png Bug: Does not work in Orangebox and later builds of Studiomdl. You can achieve the same behavior with $body, however.
-vsi <path\[QC|MDL]>
Generates a VSI file from a QC or MDL.
-stripmodel <path\model.mdl>
Strips down a model, removing its LOD info.
-stripvhv <path\sp_hdr_x.vhv>
Strips down hardware verts (VHV) of their LOD info.
Generates a simple makefile for later compiling. It also parses the QC for any errors, and runs in -quiet mode.
-basedir <path>
Runs studiomdl in the context of the provided path.
-tempcontent <path>
Adds the provided path as a content search path.


"Tag reversed".
Probably meant to test the model collision for any physics errors. Skips whatever argument is provided after it.

Input Files

StudioMDL supports a range of input formats. These include SMD, DMX, and OBJ for reference meshes and VTA files for vertex and flex animation. <Counter-Strike: Global Offensive> Counter-Strike: Global Offensive also supports FBX, but with limited functionality. Flexes are not directly supported, nor are FBX sequences, however an SMD/DMX sequence can be used on an FBX model.

Note.png Note: While FBX does technically seem to support flex animations, an SMD file is required to generate the VTA file, making the use of an FBX file for flexes redundant.

Output files

Skeleton, animations, bounding/hit boxes, surface materials, LOD index...
Vertex data optimised for software rendering, XBox 360, DirectX 7, 8 and 9 respectively.
Note.png Note: .360.vtx files are just byteswapped .dx90.vtx files.
Remaining hardware-agnostic vertex data, including the UV map
Collision mesh data

See also