-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
482 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
__pycache__/ | ||
.vscode | ||
tests/ | ||
release/ | ||
tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "iwi2dds"] | ||
path = iwi2dds | ||
url = [email protected]:mauserzjeh/iwi2dds.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,74 @@ | ||
# Call of Duty asset importer | ||
![GitHub release (latest by date)](https://img.shields.io/github/v/release/mauserzjeh/cod-asset-importer?style=flat-square) | ||
![GitHub all releases](https://img.shields.io/github/downloads/mauserzjeh/cod-asset-importer/total?color=green&style=flat-square) | ||
|
||
# Call of Duty asset importer | ||
Blender add-on for importing various Call of Duty assets via the game files. | ||
|
||
## Examples | ||
### D3DBSP | ||
<img src="./examples/d3dbsp1.png?raw=true" width="500" height="auto"></img> | ||
<br/> | ||
(overlapping faces and some of the materials need fixes) | ||
<br/> | ||
<br/> | ||
|
||
### XModel | ||
<img src="./examples/xmodel1.png?raw=true" width="500" height="auto"></img> | ||
<br/> | ||
<br/> | ||
|
||
### IWi | ||
<img src="./examples/iwi1.png?raw=true" width="250" height="auto"></img> | ||
<img src="./examples/iwi2.png?raw=true" width="250" height="auto"></img> | ||
<br/> | ||
<br/> | ||
|
||
## Supported assets & features | ||
- Call of Duty 2 | ||
- D3DBSP - Compiled map files | ||
- Geometry | ||
- Materials and textures | ||
- Props | ||
- XModel - Compiled models | ||
- Geometry | ||
- Materials and textures | ||
- Skeleton & weights | ||
- Texture - IWi texture | ||
- Texture import | ||
- DXT1, DXT3, DXT5 decoding | ||
- Normal map generation from bump map | ||
|
||
<br/> | ||
<br/> | ||
## Installation & setup | ||
First of all, extract all the necessary contents of the .iwd files. Make sure to have the exact same folder structure as they have inside the .iwds. | ||
``` | ||
. | ||
├── images/ | ||
├── maps/ | ||
├── materials/ | ||
├── xanim/ | ||
├── xmodel/ | ||
├── xmodelalias/ | ||
├── xmodelparts/ | ||
└── xmodelsurfs/ | ||
``` | ||
|
||
- [Download the latest release](https://github.com/mauserzjeh/cod-asset-importer/releases/latest) | ||
- Launch Blender | ||
- `Edit > Preferences > Add-ons > Install` | ||
- Browse to the downloaded .zip file | ||
- Enable the addon by ticking the checkbox in front of its name | ||
|
||
## Usage | ||
- Launch Blender | ||
- To see import progress, information and errors | ||
- `Window > Toggle System Console` | ||
- To import a map | ||
- `File > Import > Call of Duty map (d3dbsp)` | ||
- Browse to the map inside the maps folder | ||
- To import a model | ||
- `File > Import > Call of Duty model (xmodel)` | ||
- Browse to the xmodel inside the xmodel folder | ||
|
||
## Installation from source | ||
|
||
### Requirements | ||
- [Git](https://git-scm.com/) | ||
- [Python 3.8 <=](https://www.python.org/) | ||
- [Go 1.18 <=](https://go.dev/) | ||
|
||
### Installation | ||
- Open Git Bash in the folder where you would like to clone the repository | ||
- Clone the repository | ||
``` | ||
$ git clone --recurse-submodules [email protected]:mauserzjeh/cod-asset-importer.git | ||
``` | ||
|
||
- Go to the release folder | ||
``` | ||
$ cd cod-asset-importer/release | ||
``` | ||
|
||
# How to use | ||
## Installation and setup | ||
- Extract the contents of all the .iwd files into a folder | ||
- The folder structure of the extracted assets should look the same as below and mainly these are the most important folders which are required for the add-on to work properly | ||
- Run the release script which will compile iwi2dds.exe and pack all the necessary files into a .zip | ||
``` | ||
$ ./release.sh | ||
``` | ||
|
||
- ``` | ||
. | ||
├── images | ||
├── maps | ||
├── materials | ||
├── xanim | ||
├── xmodel | ||
├── xmodelalias | ||
├── xmodelparts | ||
└── xmodelsurfs | ||
``` | ||
- Install the add-on for Blender | ||
- Click on Edit and select Preferences | ||
- Click on the Add-ons tab and click on the Install button | ||
- Browse to the .zip file containing the add-on and then click on the Install Add-on button | ||
- If everything is done right, import options should be available in File > Import menu | ||
- Launch Blender | ||
- `Edit > Preferences > Add-ons > Install` | ||
- Browse to the generated .zip file in the release folder | ||
- Enable the addon by ticking the checkbox in front of its name | ||
|
||
<br/> | ||
<br/> | ||
|
||
## Importing assets | ||
- Click on File menu point and go to the Import menu | ||
- Select Call of Duty map if you would like to import a map | ||
- Browse to the map in the maps folder | ||
- Select Call of Duty xmodel if you would like to import any model | ||
- Browse to the model in the xmodel folder | ||
- Select Call of Duty texture if you would like to import any texture | ||
- Browse to the texture in the images folder | ||
- Set the "Normal map" checkbox to true if you are importing a normal map | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from zipfile import ZipFile | ||
import glob | ||
import os | ||
|
||
|
||
src = os.path.join(os.pardir, 'src') | ||
cod_asset_importer = 'cod_asset_importer' | ||
|
||
with ZipFile('cod_asset_importer.zip', 'w') as zip: | ||
for file in glob.iglob(os.path.join(src, '*.py')): | ||
zip.write(file, os.path.join(cod_asset_importer, os.path.basename(file))) | ||
|
||
folders = ['addon', 'assets', 'utils'] | ||
for folder in folders: | ||
for file in glob.iglob(os.path.join(src, folder, '*.py')): | ||
zip.write(file, os.path.join(cod_asset_importer, folder, os.path.basename(file))) | ||
|
||
zip.write(os.path.join(src, 'bin', 'iwi2dds.exe'), os.path.join(cod_asset_importer, 'bin', 'iwi2dds.exe')) | ||
zip.write(os.path.join(os.pardir, 'LICENSE'), os.path.join(cod_asset_importer, 'LICENSE')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
cd ../iwi2dds | ||
go build -o ../src/bin/iwi2dds.exe | ||
cd ../release | ||
python release.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.