Blender Painkiller ASE geometry exporter plugin (Outdated)
Blender add-on that exports Painkiller (PC game 2004) MPK geometry in ASE format.
The plugins were created by dilettante. Tested on Blender 4.2 LTS.
Note
The guide was written when we did not have proper MPK exporter for Painkiller. Right now this guide can be considered obsolete but is left here for some corner cases.
Before we got a fully fledged Painkiller MPK exporter for Blender, we had to use a combination of tools: Painkiller Ase Exporter Addon for Blender, Painkiller Lightmap MPK list exporter Blender plugin, ase2mpk (an official People Can Fly tool), and PKBlend.
Blender plugin installation
You need to install the following plugins for Blender:
-
Painkiller Ase Exporter Addon for Blender
- Install the plugin as a ZIP archive in Blender.
Additional mandatory tools
-
PKBlend
. You can grab this tool here. -
ase2mpk
is an official People Can Fly tool that is always shipped with the Painkiller game, usually located in thePainkiller Black Full\Exporters
folder.
Alternatively, the tools can be found on ModDB.
Export
-
Make the necessary changes to the geometry.
-
Since you installed the above mentioned Blender plugins, click
File
>Export
>ASCII Scene Exporter
. -
Pay attention to the exporter settings:
-
Triangulate. Note that this option will increase the export time. Better triangulate the whole map manually before the export.
-
Recalculate Normals. This option is disabled by default and I suggest leaving it like that because it can break normals on a map during export.
-
Ivert Y normal. Should be always enabled if we are going to use
ase2mpk
which is a common situation. This is a workaround sincease2mpk
has a bug with inverted normals so basically we will eventually invert normals 2 times to get a proper result. -
Remove Doubles. This option is disabled by default. Removes any duplicate vertices before exporting. Recommended for final maps.
Warning
The latest version of the plugin has one noticed bug: it does not transform the hidden objects. Transformations are very important for Painengine so make sure you unhid all the object before the export.
-
-
Open the system console in case you need to debug the export, it is higly recommended. Go to
Window
->Toggle System Console
. -
Enter the future
.ase
file name and clickExport
. Exporting process is very slow and can take several minutes depending on a map. -
Now we need to export the lighmap information from the map using the Painkiller Lightmap MPK plugin which you installed earlier. Click
File
>Export
>Painkiller Blendlist (.txt)
. -
Now you got 2 files, let's say:
untitled.ase
anduntitled.txt
. -
The next step is to transform our
.ase
geometry into the Painkiller.mpk
format. Go to the original Painkiller directory or just copy thease2mpk.exe
to the directory where you have the.ase
exported file. This is a command line tool so it should be run from Powershell or CMD:Follow the command prompt. You should get a similar output:
Copyright (c) 2003,2004 People Can Fly ase2mpk converts 3ds max ASE files to Pain Engine mpk format version 1.2 mesh data optimization ON, may take a while ... Done! press any key...
The conversion is pretty fast. This tool will create
untitled.mpk
in the same directory. If something goes wrong, the tool creates a log file in the same folder. -
Now it's time to fix lightmaps. This is where PKBlend comes in handy. We need to combine the blendlist
untitled.txt
with the generateduntitled.mpk
. RunPKBlend
. -
You will need to select matching
untitled.txt
anduntitled.mpk
at the same time usingCtrl - left mouse click
. Then clickBlend
:As a result, the
PKBlend
tool will replaceuntitled.mpk
with the updated version ofuntitled.mpk
. The previous file version will be saved asuntitled.bak
.Warning
Painkiller only supports meshes that have 2 UV map channels. If a mesh have more channels,
PKBlend
will throw an error.
Blendmaps
Note
This information is outdated and was added for reference.
Warning
PKBlend v0.3b does not support blendmaps for meshes that have several materials each of which uses its own blendmap. For example, terrain meshes with grass on C5L3_Monastery.
Blendmaps are the mix of textures. The ASE exporter plugin does not export this information. Most often, such complex textures are used for terrain and lava, like on DM_Unseen, DM_Fallen1, C3L6_Forest, C5L4_Hell.
To export such materials properly using the ASE exporter, you need the following prerequisites:
-
A map should be imported with disabled blendmaps:
-
Use mpk2ase on the original map to export the object and texture information. Just drag the map on
mpk2ase.exe
. It'll create several files and you will only needObj.txt
. -
When you complete a map, export by clicking
File
>Export
>ASCII Scene Exporter
. -
Now we need to export the lighmap information from the map using the Painkiller Lightmap MPK plugin which you installed earlier. Click
File
>Export
>Painkiller Blendlist (.txt)
. -
The next step is to transform our
.ase
geometry into the Painkiller.mpk
format. Go to the original Painkiller directory or just copy thease2mpk.exe
to the directory where you have the.ase
exported file. This is a command line tool so it should be run from Powershell or CMD:Follow the command prompt. You should get a similar output:
Copyright (c) 2003,2004 People Can Fly ase2mpk converts 3ds max ASE files to Pain Engine mpk format version 1.2 mesh data optimization ON, may take a while ... Done! press any key...
The conversion is pretty fast. This tool will create
untitled.mpk
in the same directory. If something goes wrong, the tool creates a log file in the same folder. -
Now it's time to fix lightmaps. This is where PKBlend comes in handy. We need to combine the blendlist
untitled.txt
with the generateduntitled.mpk
. RunPKBlend
. -
You will need to select matching
untitled.txt
anduntitled.mpk
at the same time usingCtrl - left mouse click
. Then clickBlend
:As a result, the
PKBlend
tool will replaceuntitled.mpk
with the updated version ofuntitled.mpk
. The previous file version will be saved asuntitled.bak
. -
Now get the
Obj.txt
and combine it with the receiveduntitled.mpk
withPKBlend
once again.
Sometimes Obj.txt
is not generated correctly, so you might need to fix it manually. The full list for two objects might look this way. Pay attention that plane01_trans and plane02_trans do not have gaps between them:
plane01_trans
0.000000
0.000000
5.000000
5.000000
my_lightmap
my_blendmap
0.000000
0.000000
1.000000
1.000000
my_alphamask
plane02_trans
0.000000
0.000000
5.000000
5.000000
my_lightmap
my_blendmap
0.000000
0.000000
1.000000
1.000000
my_alphamask
If you see gaps and some fields are missing, it means whether the original mesh did not have them or these was an incomplete export and you need to fix the list manually.