Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/measuredweighed/BSP2OBJ
🎮 BSP2OBJ is a command-line utility capable of converting Quake, Quake 2, Daikatana, Hexen 2, Kingpin and Half-Life map files into OBJ meshes
https://github.com/measuredweighed/BSP2OBJ
daikatana half-life hexen2 modelling pak pak-files quake quake2
Last synced: about 1 month ago
JSON representation
🎮 BSP2OBJ is a command-line utility capable of converting Quake, Quake 2, Daikatana, Hexen 2, Kingpin and Half-Life map files into OBJ meshes
- Host: GitHub
- URL: https://github.com/measuredweighed/BSP2OBJ
- Owner: measuredweighed
- License: mit
- Created: 2017-10-03T15:41:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-28T21:35:34.000Z (almost 2 years ago)
- Last Synced: 2024-11-06T19:12:20.565Z (about 2 months ago)
- Topics: daikatana, half-life, hexen2, modelling, pak, pak-files, quake, quake2
- Language: Python
- Homepage:
- Size: 1.36 MB
- Stars: 47
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-quake - BSP2OBJ - Python module and CLI tool for converting BSPs to OBJ/MTL files with textures. (Mapping / QuakeWorld)
README
![BSP2OBJ](logo.png)
BSP2OBJ is a Python module and command-line utility that is capable of converting BSP map files into OBJ/MTL files (with accompanying PNG textures). It comes with support for Quake, Quake 2 and Half-Life maps.
## Installation
The easiest way to install BSP2OBJ is to simply use `pip` like so:
```
pip install bsp2obj
```The installation process should create an easily accessible `bsp2obj` command-line utility.
## Using the command-line utility
### Exporting Quake/Quake 2 maps:
Both Quake and Quake 2 store map and other associated metadata within PAK files. As such, you'll need to let BSP2OBJ know the target PAK file with the `-p` argument. Additionally, you'll also need to pass along the path of the colour palette within the PAK file to ensure texture data is decoded correctly. This can be done using the `-c` argument.Here's how to extract the starting level of Quake 1:
```
bsp2obj -g q1 -o q1_start -p Q1.PAK -m maps/start.bsp -c gfx/palette.lmp
```And heres how you'd extra the first demo level from Quake 2:
```
bsp2obj -g q2 -o q2_demo1 -p Q2.PAK -m maps/demo1.bsp -c pics/colormap.pcx
```### Exporting a Half-Life map:
Half-Life differed slightly from Quake and Quake 2 by ditching the use of PAK files and opting to instead store textures and other metadata in the file system. As a result, you can omit the `-p` argument in this case, and instead pass absolute paths to the required `.bsp` and `.lmp` palette files.Here's how I went about extracting the first level of Half-Life from my Steam library on macOS:
```
bsp2obj -g hl1 -o hl_c1a0 -m /Users/measuredweighed/Library/Application\ Support/Steam/steamapps/common/Half-Life/valve/maps/c1a0.bsp -c /Users/measuredweighed/Library/Application\ Support/Steam/steamapps/common/Half-Life/valve/gfx/palette.lmp
```### Exporting or listing PAK contents
You may provide the optional argument `-e` to export files contained within a PAK file that match a given regular expression. As an example, one could dump all of the `.bsp` files in a PAK file like so:
```
bsp2obj -g q2 -p Q2.PAK -e ".bsp"
```Alternatively, if you provide a pattern of `*` every file will be exported:
```
bsp2obj -g q2 -p Q2.PAK -e "*"
```If you'd prefer to list files within a PAK, swap the `-e` flag for `-l`