A Python GUI application that converts Source Engine .map files to Valve Map Format (.vmf) files. This tool is designed to help map creators convert their map files for use in Source Engine games like Half-Life 2, Counter-Strike, and other Source-based games.
- Graphical User Interface: Easy-to-use PyQt5-based GUI
- Custom Texture Support: Specify custom texture paths for material replacement
- Progress Tracking: Real-time conversion progress with detailed logging
- Material Replacement: Automatically replaces
__TB_emptymaterials with a user-defined texture - Detailed Statistics: Shows conversion statistics including brush count, face count, and material replacements
- Cross-Platform: Works on Windows, macOS, and Linux
- Standalone Executable: Can be built into a self-contained executable that doesn't require Python installation
- Python 3.6 or higher
- PyQt5 5.15.0 or higher
-
Clone or download the project files
git clone https://github.com/Ammarillo/map2vmf.git cd map2vmf -
Install dependencies
pip install -r requirements.txt
-
Run the application
python map2vmf.py
-
Clone or download the project files
git clone https://github.com/Ammarillo/map2vmf.git cd map2vmf -
Install dependencies
pip install -r requirements.txt
-
Build the executable
python build_exe.py
-
Run the executable
- Windows: Double-click
dist/Map2VMF_Converter.exe - Linux/Mac: Run
./dist/Map2VMF_Converter
- Windows: Double-click
- Start the application
python map2vmf.py
-
Run the standalone executable
- Windows: Double-click
Map2VMF_Converter.exe - Linux/Mac: Run
./Map2VMF_Converter
- Windows: Double-click
-
Select Input File
- Click "Select .map File" to choose your Source Engine
.mapfile - The application supports standard Source Engine map files
- Click "Select .map File" to choose your Source Engine
-
Configure Texture Settings (Optional)
- The default texture path is
dev/dev_measuregeneric01b - You can change this to any texture path you prefer
- This texture will replace all
__TB_emptymaterials in the map
- The default texture path is
-
Select Output Location
- Click "Select Output Location" to choose where to save the
.vmffile - The output file will be in Valve Map Format
- Click "Select Output Location" to choose where to save the
-
Convert
- Click "Convert Map to VMF" to start the conversion process
- Monitor the progress bar and conversion log for real-time updates
The conversion process will show detailed statistics including:
- Number of brushes found and processed
- Number of faces processed
- Number of material replacements made
- Default texture used
- Output file size
Source Engine map files contain:
- Worldspawn entity with properties
- Brush definitions with faces
- Material assignments
- Texture coordinates and scaling
Valve Map Format files contain:
- Worldspawn entity with preserved properties
- Solids (converted from brushes)
- Sides (converted from faces)
- Material assignments
- Texture coordinates and scaling
The converter automatically replaces __TB_empty materials with a user-defined texture. This is useful for:
- Converting placeholder materials to actual textures
- Ensuring compatibility with Source Engine games
- Maintaining visual consistency in converted maps
-
"No input file selected"
- Make sure you've selected a valid
.mapfile - Check that the file exists and is readable
- Make sure you've selected a valid
-
"No output file selected"
- Ensure you've chosen a location to save the
.vmffile - Make sure you have write permissions in the target directory
- Ensure you've chosen a location to save the
-
Conversion errors
- Check that the input file is a valid Source Engine map file
- Verify the file isn't corrupted or incomplete
- Review the conversion log for specific error messages
-
PyQt5 installation issues
- On some systems, you may need to install additional dependencies:
# Ubuntu/Debian sudo apt-get install python3-pyqt5 # macOS (with Homebrew) brew install pyqt5
- On some systems, you may need to install additional dependencies:
If you encounter issues:
- Check the conversion log for detailed error messages
- Verify your input file is a valid Source Engine map file
- Ensure all dependencies are properly installed
- Check file permissions for input and output locations
- MapToVmfConverter: Core conversion logic
- ConversionWorker: Background processing thread
- MapToVmfConverterGUI: PyQt5-based user interface
- Parse
.mapfile content - Extract worldspawn properties
- Process brush definitions
- Convert faces to sides
- Apply material replacements
- Generate VMF format output
- Worldspawn entity properties
- Brush geometry and faces
- Material assignments
- Texture coordinates (uaxis/vaxis)
- Texture scaling
- Lightmap scaling
This project is open source. Feel free to modify and distribute according to your needs.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
- v1.0: Initial release with basic conversion functionality
- v1.1: Added custom texture path support
- v1.2: Enhanced GUI with progress tracking and detailed logging