# Quake (1996 game) bsp import script

**URL:** <https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191>\
**Category:** Released Add-ons and Extensions\
**Created:** [June 17, 2013, 8:40am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191 "2013-06-17T08:40:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_Flamey](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mr\_Flamey](https://blenderartists.org/u/Mr_Flamey)\
**Post date:** [June 17, 2013, 8:40am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/1 "2013-06-17T08:40:52Z")

</div>

**Update** : I just updated this addon to work with Blender 2.80. You can find the source and recent readme on the github page here: [https://github.com/andyp123/blender\_io\_mesh\_bsp](https://github.com/andyp123/blender_io_mesh_bsp)

The latest release supports BSP2, importing of lights for eevee and cycles, camera setup based on info\_player\_start and info\_intermission entities, much better material setup, supporting masked emission and transparency and also imports files MUCH faster.

I also made a companion add-on for importing Quake .map files, which can be found [here](https://github.com/andyp123/blender_io_mesh_qmap/releases).

v0.0.7 (Blender 2.79) : [Download](https://github.com/andyp123/blender_io_mesh_bsp/releases/download/v0.0.7/io_mesh_bsp.zip)  
v1.1 (Blender 2.80) : [Download](https://github.com/andyp123/blender_io_mesh_bsp/releases/tag/v1.1)

* * *

Original Post (minus pasted readme):

I’m not sure how many people here will want to import level geometry and textures from a 17 year old game, even if it is pretty much the best game ever, but I thought I would upload it just because there might be someone, or it might be useful for someone who wants to write their own mesh importer for some other game etc.

The script takes any valid Quake 1 BSP file and loads each model as a separate mesh. Quake stored textures in each .bsp file, so the textures are also loaded as materials and applied to the meshes. There are a couple of simple import options to disable creation of materials, load only the main level geometry and also a scale parameter.

Pics:

 ![G4pKc8k](https://blenderartists.org/uploads/default/original/4X/4/c/c/4cc936ce41cbf95448e0ebf4f041cf2d4d016ec9.jpeg)  
 ![kZ8F6WR](https://blenderartists.org/uploads/default/original/4X/1/8/2/182923a9eb9f4385dcb7b07a5ef716e9adbe92dd.jpeg)  
 ![Xt8UkAN](https://blenderartists.org/uploads/default/original/4X/b/b/e/bbe8db37de3dbf6dae0442f412c6ae9672ef64ce.jpg)

---

<div class="post-metadata">

**Author:** ![Mr\_Flamey](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mr\_Flamey](https://blenderartists.org/u/Mr_Flamey)\
**Post date:** [June 17, 2013, 8:55am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/2 "2013-06-17T08:55:22Z")

</div>

I forgot to mention that if anyone actually wants to try this script, you can find level bsp files on this site: [http://www.quaddicted.com/](http://www.quaddicted.com/) in the maps section. The original levels are contained in Quake/ID1/pak0.pak and pak1.pak, and although extracting them is fairly trivial, I did not add any tool to do this in the importer. There are tools available to extract the files from .pak files for Windows, though I’m not sure if such a tool exists for Linux. There are lots of tools available here: [https://www.quaddicted.com/files/tools/](https://www.quaddicted.com/files/tools/) (hint: try pakscape, pak explorer, qped2 etc.)

---

<div class="post-metadata">

**Author:** ![laune](https://blenderartists.org/user_avatar/blenderartists.org/laune/32/9146_2.png) [@laune](https://blenderartists.org/u/laune)\
**Post date:** [June 17, 2013, 9:36pm UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/3 "2013-06-17T21:36:26Z")

</div>

not sure what to do with it, but I think it’s great. Thanks a lot for your contribution! Quake1 was also my favourite fps game ever.

---

<div class="post-metadata">

**Author:** ![PyroGXPilot](https://blenderartists.org/user_avatar/blenderartists.org/pyrogxpilot/32/18257_2.png) [@PyroGXPilot](https://blenderartists.org/u/PyroGXPilot)\
**Post date:** [June 17, 2013, 10:57pm UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/4 "2013-06-17T22:57:07Z")

</div>

Man this is one of the coolest thing ive seen in Blender

---

<div class="post-metadata">

**Author:** ![eXKR](https://blenderartists.org/letter_avatar_proxy/v4/letter/e/839c29/32.png) [@eXKR](https://blenderartists.org/u/eXKR)\
**Post date:** [June 18, 2013, 12:16am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/5 "2013-06-18T00:16:09Z")

</div>

I totally love it! I’ll “play” with it surely… just one question: it would not work with Quake 3 BSPs, doesn’t it?

Thanks!!

---

<div class="post-metadata">

**Author:** ![motorsep](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@motorsep](https://blenderartists.org/u/motorsep)\
**Post date:** [June 18, 2013, 11:21pm UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/6 "2013-06-18T23:21:15Z")

</div>

@Mr_Flamey: Nice!

Would you be able to fix Quake 3 map exporter by chance?

---

<div class="post-metadata">

**Author:** ![Mr\_Flamey](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mr\_Flamey](https://blenderartists.org/u/Mr_Flamey)\
**Post date:** [June 19, 2013, 4:34pm UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/7 "2013-06-19T16:34:10Z")

</div>

Sorry, it only works with Quake 1 bsps. I played, but was not a big fan of Quake 3 to be honest, since I really enjoyed the single player modes in the first two games, and played Quake 2 multiplayer, rocket arena and ctf way more than I played Q3. Despite many people complaining that Q2 was too slow, I enjoyed it a lot.

motorstep: Sorry, I just wanted to write a script that would import Quake bsps and don’t have any plans to expand it. I think there already is a Q3 map export script though, so have a look and see if it still exists and works.

---

<div class="post-metadata">

**Author:** ![motorsep](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@motorsep](https://blenderartists.org/u/motorsep)\
**Post date:** [June 19, 2013, 4:43pm UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/8 "2013-06-19T16:43:41Z")

</div>

Quake 3 .map exporter is bundled with Blender and works, but it doesn’t work correctly (order of brush faces is screwed up in the output, wrong strings are being written, etc.)

[http://projects.blender.org/tracker/index.php?func=detail&aid=35099&group\_id=9&atid=498](http://projects.blender.org/tracker/index.php?func=detail&aid=35099&group_id=9&atid=498)

---

<div class="post-metadata">

**Author:** ![PyroGXPilot](https://blenderartists.org/user_avatar/blenderartists.org/pyrogxpilot/32/18257_2.png) [@PyroGXPilot](https://blenderartists.org/u/PyroGXPilot)\
**Post date:** [June 20, 2013, 11:30am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/9 "2013-06-20T11:30:22Z")

</div>

i notice it fails on Aerowalk/pkeg

---

<div class="post-metadata">

**Author:** ![Mahalin](https://blenderartists.org/user_avatar/blenderartists.org/mahalin/32/24705_2.png) [@Mahalin](https://blenderartists.org/u/Mahalin)\
**Post date:** [June 20, 2013, 12:20pm UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/10 "2013-06-20T12:20:39Z")

</div>

I’m getting an error on importing ns maps:

> Read new prefs: C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.67\co  
> nfig\userpref.blend  
> found bundled python: C:\Program Files\Blender Foundation\Blender\2.67\python  
> – IMPORTING BSP –  
> Source file: D:\Program Files (x86)\Steam\SteamApps\common\Half-Life  
> s\maps\co\_  
> core.bsp  
> bsp contains 113 models. (faces = 8194, edges = 19911, verts = 11202)  
> – LOADING TEXTURES –  
> [0] ‘door\_yellgrey02’ (128x128 16384bytes)  
> [1] ‘flr\_grey02 ents’ (128x128 16384bytes)  
> [2] ‘fx\_damage07 g…’ (128x256 32768bytes)  
> [3] ‘fx\_elevator2 …’ (256x128 32768bytes)  
> [4] ‘fx\_lgt\_panel02’ (128x32 4096bytes)  
> [5] ‘light\_panel02 s’ (128x32 4096bytes)  
> [6] ‘misc\_damage01 s’ (64x64 4096bytes)  
> [7] ‘misc\_damage07 s’ (128x256 32768bytes)  
> [8] ‘misc\_doortrack’ (32x128 4096bytes)  
> [9] ‘misc\_pipes03 ts’ (128x128 16384bytes)  
> [10] ‘misc\_pipes05 ts’ (128x128 16384bytes)  
> [11] ‘wall\_grey08 nts’ (128x128 16384bytes)  
> [12] ‘wall\_panel01 ts’ (256x256 65536bytes)  
> [13] ‘wall\_panel05 …’ (256x256 65536bytes)  
> [14] ‘wall\_panel08 ts’ (256x256 65536bytes)  
> [15] ‘wall\_panel11 ts’ (256x256 65536bytes)  
> [16] ‘wall\_panel14 ts’ (256x256 65536bytes)  
> [17] ‘{floor\_panel02’ (128x128 16384bytes)  
> [18] ‘!r25\_stagnant’ (128x128 16384bytes)  
> [19] ‘+0nos\_ind ant’ (16x16 256bytes)  
> [20] ‘+1nos\_ind tor r’ (16x16 256bytes)  
> [21] ‘+2nos\_ind tor r’ (16x16 256bytes)  
> [22] ‘+3nos\_ind tor r’ (16x16 256bytes)  
> [23] ‘+4nos\_ind tor r’ (16x16 256bytes)  
> [24] ‘+5nos\_ind tor r’ (16x16 256bytes)  
> [25] ‘+6nos\_ind tor r’ (16x16 256bytes)  
> [26] ‘+7nos\_ind tor r’ (16x16 256bytes)  
> [27] ‘hint walllights’ (16x16 256bytes)  
> [28] ‘joinaliens-b ts’ (256x64 16384bytes)  
> [29] ‘nos\_pipe2 nel 2’ (48x16 768bytes)  
> [30] ‘observe-b 11’ (256x64 16384bytes)  
> [31] ‘r25\_monitorbox2’ (128x64 8192bytes)  
> [32] ‘skip lights3 2’ (16x16 256bytes)  
> [33] ‘wall\_lab2 e3’ (256x256 65536bytes)  
> [34] ‘black 26 a 03’ (32x32 1024bytes)  
> [35] ‘clip ebar 2’ (16x16 256bytes)  
> [36] ‘origin l h r’ (16x16 256bytes)  
> [37] ‘sky litedawn’ (16x16 256bytes)  
> [38] ‘{blue d e’ (16x16 256bytes)  
> [39] ‘{fence lr 1 e’ (256x192 49152bytes)  
> [40] ‘+0~nos\_wklt’ (64x48 3072bytes)  
> Traceback (most recent call last):  
> File “C:\Program Files\Blender Foundation\Blender\2.67\scripts\addons\io\_mesh\_  
> bsp\__init_\_.py”, line 75, in execute  
> bsp\_importer.import\_bsp(context, self.filepath, options)  
> File “C:\Program Files\Blender Foundation\Blender\2.67\scripts\addons\io\_mesh\_  
> bsp\bsp\_importer.py”, line 263, in import\_bsp  
> texture\_data = load\_textures(context, filepath)  
> File “C:\Program Files\Blender Foundation\Blender\2.67\scripts\addons\io\_mesh\_  
> bsp\bsp\_importer.py”, line 125, in load\_textures  
> miptex\_name = miptex.name.decode(‘ascii’).rstrip(‘\0’)  
> UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0x8d in position 12: ordinal  
> not in range(128)

> location: \<unknown location\>:-1

> location: \<unknown location\>:-1

And on a different map:

> Read new prefs: C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.67\co  
> nfig\userpref.blend  
> found bundled python: C:\Program Files\Blender Foundation\Blender\2.67\python  
> – IMPORTING BSP –  
> Source file: D:\Program Files (x86)\Steam\SteamApps\common\Half-Life  
> s\maps\co\_  
> faceoff.bsp  
> bsp contains 99 models. (faces = 6087, edges = 14594, verts = 8376)  
> – LOADING TEXTURES –  
> [0] ‘miptext\_name1’ (16x16 256bytes)  
> [1] ‘miptext\_name2’ (16x16 256bytes)  
> [2] ‘miptext\_name3’ (64x64 4096bytes)  
> Traceback (most recent call last):  
> File “C:\Program Files\Blender Foundation\Blender\2.67\scripts\addons\io\_mesh\_  
> bsp\__init_\_.py”, line 75, in execute  
> bsp\_importer.import\_bsp(context, self.filepath, options)  
> File “C:\Program Files\Blender Foundation\Blender\2.67\scripts\addons\io\_mesh\_  
> bsp\bsp\_importer.py”, line 265, in import\_bsp  
> texture\_data = load\_textures(context, filepath)  
> File “C:\Program Files\Blender Foundation\Blender\2.67\scripts\addons\io\_mesh\_  
> bsp\bsp\_importer.py”, line 132, in load\_textures  
> pixels\_pal = struct.unpack(‘\<%dB’ % miptex\_size, file.read(miptex\_size))  
> struct.error: unpack requires a bytes object of length 4096

> location: \<unknown location\>:-1

> location: \<unknown location\>:-1

If I replace line 125 with a different name format, it works.

BTW, this plugin came just in time. TY!

---

<div class="post-metadata">

**Author:** ![Mr\_Flamey](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mr\_Flamey](https://blenderartists.org/u/Mr_Flamey)\
**Post date:** [June 21, 2013, 5:01am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/11 "2013-06-21T05:01:29Z")

</div>

[PyroGXPilot](http://www.blenderartists.org/forum/member.php?100202-PyroGXPilot): Wow, thanks for spotting that; I didn’t exactly test it very thoroughly to be honest. I knew that because the texture names contained special characters that can’t be used in windows filenames I couldn’t save the textures out, but the generally work in the blend file. I will have a look at that bug and see if I can fix it.

---

<div class="post-metadata">

**Author:** ![Mr\_Flamey](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mr\_Flamey](https://blenderartists.org/u/Mr_Flamey)\
**Post date:** [June 21, 2013, 5:04am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/12 "2013-06-21T05:04:36Z")

</div>

[Mahalin](http://www.blenderartists.org/forum/member.php?144223-Mahalin): Are you trying to import half-life bsps? I think that would require a different importer since although the bsp format used by Half-life is similar to Quake, I doubt they are the same. However, if you managed to get a half-life bsp loading just by changing one line of code, I’d love to see a pic of the level you loaded. If it works I can add half-life maps as an officially supported option I guess.

Still, I’ll check out Aerowalk and Powder Keg.

---

<div class="post-metadata">

**Author:** ![Mr\_Flamey](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mr\_Flamey](https://blenderartists.org/u/Mr_Flamey)\
**Post date:** [June 21, 2013, 6:50am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/13 "2013-06-21T06:50:25Z")

</div>

Ok, the bug is fixed. Turned out is was simply caused by texture names not being 0 padded (only 0 terminated) in bsps compiled with older compilers and all the maps I was testing were recent.

New version here:  
[http://www.quaketastic.com/upload/files/misc/blender-quake\_bsp\_importer-v0.0.4.zip](http://www.quaketastic.com/upload/files/misc/blender-quake_bsp_importer-v0.0.4.zip)

Aerowalk: [http://i.imgur.com/CQ1iRgQ.jpg](http://i.imgur.com/CQ1iRgQ.jpg)  
Powder Keg: [http://i.imgur.com/230kPmm.jpg](http://i.imgur.com/230kPmm.jpg)  
Death by the Dozen: [http://i.imgur.com/SYzciYz.jpg](http://i.imgur.com/SYzciYz.jpg)

---

<div class="post-metadata">

**Author:** ![slight](https://blenderartists.org/letter_avatar_proxy/v4/letter/s/b19c9b/32.png) [@slight](https://blenderartists.org/u/slight)\
**Post date:** [September 16, 2013, 9:12am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/14 "2013-09-16T09:12:21Z")

</div>

I have made some additions to Mr\_Flamey’s cool importer script as [v0.0.5](https://projects.blender.org/tracker/?func=detail&atid=467&aid=35778&group_id=153). Blender 2.68a must have changed bmesh enough so that a change was needed in the way UV coords are mapped. Version 0.0.5 adds options to use cycles shader nodes and an option to create lights based on the entities list.

Here is a cycles rendered map with water (glass shader)

 ![](https://blenderartists.org/uploads/default/original/3X/1/f/1f78da9ebb548b17d6bc45c3fe204aae2bfe641e.jpg)  

Here is a blender internal rendered map with lights

 ![](https://blenderartists.org/uploads/default/original/3X/e/1/e18d0d69ecfd49779cb2110fa9f830e5ead69227.jpg)

---

<div class="post-metadata">

**Author:** ![Sanctuary](https://blenderartists.org/user_avatar/blenderartists.org/sanctuary/32/12611_2.png) [@Sanctuary](https://blenderartists.org/u/Sanctuary)\
**Post date:** [September 16, 2013, 9:45am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/15 "2013-09-16T09:45:14Z")

</div>

Thanks for that importer and the update delivering that nostalgia from the past

[![](http://i.imgur.com/fn6wBoZ.png) ](http://i.imgur.com/fn6wBoZ.png)

---

<div class="post-metadata">

**Author:** ![Mr\_Flamey](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mr\_Flamey](https://blenderartists.org/u/Mr_Flamey)\
**Post date:** [September 17, 2013, 5:12am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/16 "2013-09-17T05:12:48Z")

</div>

> [@slight](#):
>
> I have made some additions to Mr\_Flamey’s cool importer script as [v0.0.5](https://projects.blender.org/tracker/?func=detail&atid=467&aid=35778&group_id=153)…

Wow, great work! It’s unreal how close the renders look to Quake screenshots. I’d love to see how stuff looks with ambient occlusion and no textures, but most Quake maps look pretty crap, so I doubt it would be so great. Originally I made it with the intention of adding details to some Quake maps I made and doing a couple of nice renders, but I got distracted by other things 🙂

---

<div class="post-metadata">

**Author:** ![Safetyman](https://blenderartists.org/user_avatar/blenderartists.org/safetyman/32/897453_2.png) [@Safetyman](https://blenderartists.org/u/Safetyman)\
**Post date:** [September 17, 2013, 5:52am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/17 "2013-09-17T05:52:04Z")

</div>

Does this script also import the character models (the monsters and such)?

---

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [May 19, 2014, 8:30pm UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/18 "2014-05-19T20:30:47Z")

</div>

I brought in a BSP map, added a remesh modifier in block mode and followed that with a bevel.

### Attachments

 ![](https://blenderartists.org/uploads/default/original/4X/6/3/2/632d820b46188decdccd8230c214d794e713d56a.jpg)

---

<div class="post-metadata">

**Author:** ![motorsep](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@motorsep](https://blenderartists.org/u/motorsep)\
**Post date:** [August 26, 2015, 10:37am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/19 "2015-08-26T10:37:26Z")

</div>

Has anyone tried the add-on with Blender 2.75+ ?

---

<div class="post-metadata">

**Author:** ![eppo](https://blenderartists.org/user_avatar/blenderartists.org/eppo/32/18441_2.png) [@eppo](https://blenderartists.org/u/eppo)\
**Post date:** [August 26, 2015, 11:48am UTC](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191/20 "2015-08-26T11:48:51Z")

</div>

Did try. Script needs 2 lines more and it just works.  
[http://www.pasteall.org/pic/show.php?id=92335](http://www.pasteall.org/pic/show.php?id=92335)

… and [this marvel](http://www.pasteall.org/pic/show.php?id=92339)…Too bad, looks like it’s not a single player mod.

[Next page](https://blenderartists.org/t/quake-1996-game-bsp-import-script/578191.md?page=2)
