Skip to content

sandrolort/VMF-Exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disclaimer: Not something I made. Needed a quick tool to convert VMF to GLTF, and couldn't find a proper one online, so had an AI code this. Wont take any credit for the code. Feel free to fork and rewrite as you see fit. image

VmfConverter

Convert Valve VMF map files to glTF 2.0 / OBJ / STL.

Handles multiple brushes, displacements, and point entities. Groups faces by VMF material name with stub colors (real VTF/VMT texture resolution is not implemented).

Has a GUI and CLI.

Example of displacement. Imported in blender: Screenshot From 2026-04-12 20-58-27

Example of brush materials, model imported in Godot (randomly generated colors for brushes. I didn't want to use Valve files, but I wanted to preserve the materials as they were assigned): image

Download

Prebuilt Linux and Windows binaries are on the Releases page.

For the binary version, substitute python convert.py / python gui.py in the examples below with ./vmfconvert / ./vmfconvert-gui (or .exe on Windows).

Requirements (from source)

  • Python 3.10+
  • No external dependencies

CLI

python convert.py <input.vmf> [output.{gltf,obj,stl}] [--scale N]

Output format is picked from the extension (default .gltf). Default scale is 0.0254 (1 Hammer unit = 1 inch = 0.0254m).

Examples

python convert.py map.vmf
python convert.py map.vmf out/map.gltf
python convert.py map.vmf out.obj
python convert.py map.vmf out.stl
python convert.py map.vmf --scale 0.1
python convert.py map.vmf out.gltf --scale 1

GUI

python gui.py

Tkinter-based. Pick an input VMF, format, scale, click Convert.

Output details

  • glTF: one mesh per brush, one primitive per material within each brush. Includes POSITION + per-triangle flat NORMAL. Root materials array has one stub PBR entry per VMF material name (deterministic color from hash of the name). Point entities (info_player_start, light_*, prop_static, etc.) are emitted as translation-only nodes with classname and all keyvalues preserved under extras.
  • OBJ: one o group per brush, usemtl groups per material, flat vn normals, sidecar .mtl written alongside the .obj with matching Kd colors.
  • STL: binary, flat face normals. No material support (format limitation); point entities are skipped.

About

Converts VMF files into GLTF/STL/OBJ, including displacement. Keeps seperate objects seperate instead of merging everything in one, unlike other converters I've seen.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages