Are there any open source Source engine VTX/VVD viewers?

| | August 10, 2015

I’ve been playing with loading and displaying Source Engine models (TF2, specifically) and have had mild success, but there are some aspects of it that are eluding me still. I’ve been primarily looking at http://developer.valvesoftware.com/wiki/MDL and online forks of the SDK headers like http://hlssmod.net/he_code/public/studio.h to understand the formats, but I’ve found the headers to be helpful, but lacking some crucial implementation details. The Developer Community pages do talk implementation, but much of it is speculation and I’ve already identified several points where it is wrong, so I’m struggling to locate some better resources.

I’ve got the whole .VVD file parsing now (as in: I can get the correct verts for a given LOD, verified by rendering a pointcloud.) The specific issue I’m looking at now is in the .dx90.VTX file. Drilling down into the Mesh Strip Groups, it seems like I can render the first strip group just fine (I have the Heavy’s chest, arms, and legs rendering) but subsequent meshes are a mess of random triangles. It feels to me as if there should be a per-mesh offset into the .VVDs vertexes somewhere within the .VTXs structure, but I can’t locate one. Maybe there’s something in the .MDL, which I haven’t started looking into yet, but it feels very odd to me to have such closely related data in separate files.

I know that’s probably all gibberish to anyone that’s not intimately familiar with the Source model formats. Really what I could use more than anything else is some reference code from another app that is loading these files. Are there any open-source exporters/viewers out there?

One Response to “Are there any open source Source engine VTX/VVD viewers?”

  1. You could use the source code for DuctTape as a reference. Be aware it’s GPL licensed.

Leave a Reply