Skip to content

headassbtw/mdlshit

Repository files navigation

Model converter go brr

Converts source engine model files from version 49 to version 53.

Compiling:

  • git clone https://github.com/headassbtw/mdlshit --recurse-submodules
  • It's cmake, figure it out

Zero support or consideration will be given in regards to using MSVC, find a better compiler.

If shit hits the fan

If the app crashes or behaves weirdly (lots of red/purple error text in the log window or hanging on the conversion progress bar) follow these steps:

  1. Navigate to the Debug listing in the top left options bar, click it, then click the Enable Log Fileentry. Screenshot_20230404_203023
  2. Recreate the crash, or odd behavior.
  3. Create a GitHub issue, explain what you did, and upload log.log from the folder you ran mdlshit from.

Using

This app has two main "views," the "Convert" view, and the "Tools" view. Only convert is relevant for most/beginner use cases.

Convert view

Screenshot_20230404_180527

The left side of this view is dedicated to primary input files, you can click browse to select them, or drag them in. The bottom area is the log output.

All of them will be auto-generated by studiomdl, once you go through the effort of compiling a compatible v49 model.

  • MDL - Base model data, ties the other formats together - REQUIRED
  • VTX - Vertices
  • VVD - Vertex data
  • VVC - Vertex color (most models do not use this, which is why it is disabled by default)
  • PHY - Physics data - generally not created for viewmodels

Now for the right side:

The Clear File Paths button does what it says, resets the left (and later right) file slots to their default states.

You can ignore most of the extra files on the right, these were for debug, except for RUI, we'll come back to that later after i go over the other view.

Once you've dragged these files in, press the Check button to make sure they're valid, the Convert button will then enable itself if they are, at which point you can click it, and your model will start to convert.

After the process is done, a dialog box should show:

Screenshot_20230404_181422

Then, a file in the same folder as your input .mdl file will be created, with the same filename as the input, but with _conv appended to the name.

Tools View

Screenshot_20230404_202144

This interface is a bit more simple. Drag or browsse for a file at the top, then press Read MDL.

After this, the UI will open up a bit, enabling you to do a few more things. Screenshot_20230404_202402

The important option here is the new options next to the Extract button. The default file type is Rui Structs, the others are not important for most users.

If you click the Extract button on a model with 0 RuiMeshes, or a model with a version below 53, the app will error or crash. The way to check for this is the details in the left panel, version is on top and RuiMesh count is at the bottom.

Once you've verified your input .mdl has RuiMeshes, click the Extract Button and a .rui file will be created in the same directory as the input .mdl.

This file can then be used in the convert view in addition to the normal conversion process.