This add-on is a fork of KotorBlender, upgraded to support newer versions of Blender. KotorBlender is in turn based on NeverBlender, forked from version 1.23a.
- Import & export MDL models, including walkmeshes
- Import & export LYT files
- Import & export PTH files
- Clone GitHub repository or download the latest release
- Copy kotorblender folder into Blender addons directory, e.g. "C:/Users/USERNAME/AppData/Roaming/Blender Foundation/Blender/BLENDER_VERSION/scripts/addons"
- Enable add-on "Import-Export: KotorBlender" in Blender Preferences via Edit → Preferences → Add-ons
- Extract MDL, MDX and, optionally, TPC, WOK, PWK, DWK, and LYT files (Kotor Tool, reone-tools, etc.)
- Convert TPC files to TGA/TXI (reone-tools)
- Import MDL into Blender via File → Import → KotOR Model (.mdl)
- Edit model
- Select a MDL root object to be exported
- Export MDL via File → Export → KotOR Model (.mdl)
Most of the time, it will not be possible to use vanilla lighting and UV maps to recreate lightmaps. Depending on the scene, it might be necessary to tweak or replace both.
UV mapping:
- Select objects having the same lightmap texture and enter Edit mode
- Unwrap faces via UV → Lightmap Pack (increase Margin to avoid overlapping faces)
Baking lightmaps:
- Select objects to bake lightmaps for
- If no object is selected, all objects from active collection will be used
- In Render Properties
- Set Render Engine to Cycles
- Set Device to GPU Compute, if available
- In Render Properties → KotOR Lightmaps
- Tweak number of Samples (higher numbers increase quality, but also increase render time)
- Tweak Margin
- Press the Bake button
Fine-tuning:
- In Outliner disable rendering of obstructing geometry, e.g. skyboxes
- Enable Ambient Occlusion in World Properties and tweak Factor to increase contrast
- Select a room walkmesh
- Enter Edit mode and select two vertices adjacent to another room
- Determine 0-based index of the other room into the LYT file
- Enter Vertex Paint mode and set brush color to (0.0, G, 0.0), where G = (200 + room index) / 255
- Ensure that brush blending mode is set to Mix, and brush strength is set to 1.0
- Paint over the selected vertices
- Extract PTH file from the module's RIM file, e.g. "modules/danm13_s.rim" (Kotor Tool, reone-tools, etc.)
- Import PTH into Blender via File → Import → KotOR Path (.pth)
- Create/move path points, or modify path connections via Object Properties
- Export PTH via File → Export → KotOR Path (.pth)
Known to work with Blender 2.93 and 3.2.