AGIDMGen 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. agidmgen-0.1.0/LICENSE +21 -0
  2. agidmgen-0.1.0/PKG-INFO +259 -0
  3. agidmgen-0.1.0/README.md +242 -0
  4. agidmgen-0.1.0/pyproject.toml +30 -0
  5. agidmgen-0.1.0/setup.cfg +4 -0
  6. agidmgen-0.1.0/src/py/AGIDMGen/IDModGenService.py +300 -0
  7. agidmgen-0.1.0/src/py/AGIDMGen/__init__.py +78 -0
  8. agidmgen-0.1.0/src/py/AGIDMGen/__main__.py +24 -0
  9. agidmgen-0.1.0/src/py/AGIDMGen/constants/DXGIFormats.py +35 -0
  10. agidmgen-0.1.0/src/py/AGIDMGen/constants/DumpDataKinds.py +41 -0
  11. agidmgen-0.1.0/src/py/AGIDMGen/constants/FileEncodings.py +39 -0
  12. agidmgen-0.1.0/src/py/AGIDMGen/constants/GIMIBuffers.py +53 -0
  13. agidmgen-0.1.0/src/py/AGIDMGen/constants/GIMITextureLayouts.py +58 -0
  14. agidmgen-0.1.0/src/py/AGIDMGen/constants/ModDownloadRepos.py +45 -0
  15. agidmgen-0.1.0/src/py/AGIDMGen/constants/ModLoaders.py +33 -0
  16. agidmgen-0.1.0/src/py/AGIDMGen/constants/WWMIBuffers.py +95 -0
  17. agidmgen-0.1.0/src/py/AGIDMGen/constants/__init__.py +13 -0
  18. agidmgen-0.1.0/src/py/AGIDMGen/data/ModDownloadData.py +4519 -0
  19. agidmgen-0.1.0/src/py/AGIDMGen/data/__init__.py +13 -0
  20. agidmgen-0.1.0/src/py/AGIDMGen/exceptions/BadAssetData.py +31 -0
  21. agidmgen-0.1.0/src/py/AGIDMGen/exceptions/DownloadFailed.py +39 -0
  22. agidmgen-0.1.0/src/py/AGIDMGen/exceptions/Error.py +25 -0
  23. agidmgen-0.1.0/src/py/AGIDMGen/exceptions/UnknownDXGIFormat.py +37 -0
  24. agidmgen-0.1.0/src/py/AGIDMGen/exceptions/__init__.py +13 -0
  25. agidmgen-0.1.0/src/py/AGIDMGen/main.py +272 -0
  26. agidmgen-0.1.0/src/py/AGIDMGen/model/IDModGenStats.py +84 -0
  27. agidmgen-0.1.0/src/py/AGIDMGen/model/ModDownload.py +74 -0
  28. agidmgen-0.1.0/src/py/AGIDMGen/model/__init__.py +13 -0
  29. agidmgen-0.1.0/src/py/AGIDMGen/model/files/DumpDataType.py +144 -0
  30. agidmgen-0.1.0/src/py/AGIDMGen/model/files/DumpElement.py +109 -0
  31. agidmgen-0.1.0/src/py/AGIDMGen/model/files/FmtFile.py +161 -0
  32. agidmgen-0.1.0/src/py/AGIDMGen/model/files/IbDumpFile.py +119 -0
  33. agidmgen-0.1.0/src/py/AGIDMGen/model/files/VbDumpFile.py +217 -0
  34. agidmgen-0.1.0/src/py/AGIDMGen/model/files/__init__.py +13 -0
  35. agidmgen-0.1.0/src/py/AGIDMGen/model/gimi/GIMIComponent.py +112 -0
  36. agidmgen-0.1.0/src/py/AGIDMGen/model/gimi/GIMIIdentityMod.py +122 -0
  37. agidmgen-0.1.0/src/py/AGIDMGen/model/gimi/GIMITextureSource.py +145 -0
  38. agidmgen-0.1.0/src/py/AGIDMGen/model/gimi/__init__.py +13 -0
  39. agidmgen-0.1.0/src/py/AGIDMGen/model/wwmi/WWMIBlendRemap.py +54 -0
  40. agidmgen-0.1.0/src/py/AGIDMGen/model/wwmi/WWMIComponent.py +235 -0
  41. agidmgen-0.1.0/src/py/AGIDMGen/model/wwmi/WWMIDrawRange.py +93 -0
  42. agidmgen-0.1.0/src/py/AGIDMGen/model/wwmi/WWMIIdentityMod.py +201 -0
  43. agidmgen-0.1.0/src/py/AGIDMGen/model/wwmi/WWMIMesh.py +94 -0
  44. agidmgen-0.1.0/src/py/AGIDMGen/model/wwmi/WWMIShapeKeys.py +101 -0
  45. agidmgen-0.1.0/src/py/AGIDMGen/model/wwmi/__init__.py +13 -0
  46. agidmgen-0.1.0/src/py/AGIDMGen/py.typed +0 -0
  47. agidmgen-0.1.0/src/py/AGIDMGen/tools/DumpValueTools.py +120 -0
  48. agidmgen-0.1.0/src/py/AGIDMGen/tools/FormatTools.py +58 -0
  49. agidmgen-0.1.0/src/py/AGIDMGen/tools/ModDownloader.py +300 -0
  50. agidmgen-0.1.0/src/py/AGIDMGen/tools/VersionTools.py +108 -0
  51. agidmgen-0.1.0/src/py/AGIDMGen/tools/__init__.py +13 -0
  52. agidmgen-0.1.0/src/py/AGIDMGen/tools/gimi/GIMIDownloadFolderBuilder.py +187 -0
  53. agidmgen-0.1.0/src/py/AGIDMGen/tools/gimi/GIMIIdentityModGenerator.py +553 -0
  54. agidmgen-0.1.0/src/py/AGIDMGen/tools/gimi/GIMIIniBuilder.py +153 -0
  55. agidmgen-0.1.0/src/py/AGIDMGen/tools/gimi/__init__.py +13 -0
  56. agidmgen-0.1.0/src/py/AGIDMGen/tools/wwmi/WWMIDownloadFolderBuilder.py +113 -0
  57. agidmgen-0.1.0/src/py/AGIDMGen/tools/wwmi/WWMIIdentityModGenerator.py +853 -0
  58. agidmgen-0.1.0/src/py/AGIDMGen/tools/wwmi/WWMIIniBuilder.py +284 -0
  59. agidmgen-0.1.0/src/py/AGIDMGen/tools/wwmi/__init__.py +13 -0
  60. agidmgen-0.1.0/src/py/AGIDMGen.egg-info/PKG-INFO +259 -0
  61. agidmgen-0.1.0/src/py/AGIDMGen.egg-info/SOURCES.txt +62 -0
  62. agidmgen-0.1.0/src/py/AGIDMGen.egg-info/dependency_links.txt +1 -0
  63. agidmgen-0.1.0/src/py/AGIDMGen.egg-info/requires.txt +2 -0
  64. agidmgen-0.1.0/src/py/AGIDMGen.egg-info/top_level.txt +1 -0
agidmgen-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Albert Gold
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,259 @@
1
+ Metadata-Version: 2.4
2
+ Name: AGIDMGen
3
+ Version: 0.1.0
4
+ Summary: Generates identity mods (a character's own model, written out as a mod) for 3DMigoto-based anime game mod loaders
5
+ Author-email: Albert Gold <AlexXianZhenYuAu@gmail.com>
6
+ Project-URL: Homepage, https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator
7
+ Project-URL: Repository, https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: numpy>=1.26.4
15
+ Requires-Dist: FixRaidenBoss2>=5.0.0
16
+ Dynamic: license-file
17
+
18
+ # Anime Game Identity Mod Generator (AGIDMGen)
19
+ [![Static Badge](https://img.shields.io/badge/3.9%2B-3776AB?style=for-the-badge&label=Python)](https://www.python.org/downloads/)
20
+ [![Static Badge](https://img.shields.io/badge/GIMI%20%7C%20WWMI-6E4FA3?style=for-the-badge&label=Mod%20Loaders)](#supported-games)
21
+ [![Static Badge](https://img.shields.io/badge/MIT-green?style=for-the-badge&label=License)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/AGIDMGen/api/LICENSE)
22
+ [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Alex-Au1/Anime-Game-Identity-Mod-Generator/tests.yml?branch=main&label=Unit%2FIntegration%20Tests&style=for-the-badge)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/actions/workflows/tests.yml)
23
+
24
+ <br>
25
+
26
+ Makes ***identity mods***: a mod of a character that looks **exactly like the character already does in the game**.
27
+
28
+ <br>
29
+
30
+ An identity mod changes nothing you can see. It is the character's own model, textures and colours, written out as a mod
31
+ folder. That makes it the perfect starting point for making your own mod, or for checking that a mod loader works.
32
+
33
+ A sub-project of [Anime Game Remap (AG Remap)](https://github.com/nhok0169/Anime-Game-Remap).
34
+
35
+ <br>
36
+
37
+ ## Contributors
38
+
39
+ | | |
40
+ |---|---|
41
+ | **[Albert Gold](https://github.com/Alex-Au1)** *(Active Lead Maintainer)* | [![@albertgold](https://dcbadge.limes.pink/api/shield/367087171154214914?theme=discord-inverted)](https://discord.com/users/367087171154214914) |
42
+ | [![The Council](https://raw.githubusercontent.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/main/Docs/src/_static/images/TheCouncilofClaudeAgentsBadgeMini.svg)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/AI%20Agent%20Help/README.md) *(Maintainer Team)* | [![The Council Badge](https://raw.githubusercontent.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/main/Docs/src/_static/images/TheCouncilofClaudeAgentsBadgeWithCount.svg)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/AI%20Agent%20Help/README.md) |
43
+
44
+ <br>
45
+
46
+ ## Requirements
47
+ - [Python (version 3.9 and up)](https://www.python.org/downloads/)
48
+ - *When installing Python, tick the box **"Add python.exe to PATH"** at the bottom of the first screen.*
49
+ - An internet connection (the character's files are downloaded for you)
50
+
51
+ <br>
52
+
53
+ ## Supported Games
54
+
55
+ | Game | Mod Loader | The word to type |
56
+ | --- | --- | --- |
57
+ | GI | GIMI | `gimi` |
58
+ | WuWa | WWMI | `wwmi` |
59
+
60
+ <br>
61
+
62
+ > [!TIP]
63
+ > **Just want the mod?** Every character's identity mod is already made for you in the
64
+ > [Mods](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/Mods/README.md) folder.
65
+ > That page also lists every character's name you can type below.
66
+
67
+ <br>
68
+
69
+ ## How to Run
70
+ - Choose your pick of which way to run it:
71
+
72
+ - **Choice A:** &nbsp; [Quickstart!](#choice-a-lets-start--) 🟢 &nbsp;&nbsp; (for beginners)
73
+ - **Choice B:** &nbsp; [CMD WITHOUT a Script](#choice-b-run-on-cmd-without-a-script-) 🟡 &nbsp;&nbsp; (recommended if you run by CMD)
74
+ - **Choice C:** &nbsp; [CMD with a Script](#choice-c-run-on-cmd-with-a-script-) 🟡 &nbsp;&nbsp; (the convention that other GIMI scripts follow)
75
+ - **Choice D:** &nbsp; [API](#choice-d-api-usage-) 🟠 &nbsp;&nbsp; (for expert coders)
76
+
77
+ <br>
78
+
79
+ ## Choice A: Let's Start ! 🟢
80
+ ### STEP 1:
81
+ - Right-click [AGIDMGen.py](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/raw/main/AGIDMGen/script%20build/src/AGIDMGen/AGIDMGen.py), choose **"Save link as..."**, and save the script into GIMI's or WWMI's `Mods` folder.
82
+
83
+ ### STEP 2:
84
+ - Double click on the script, and answer its two questions:
85
+ - **Which game?** Type `gimi` for GI or `wwmi` for WuWa, then enter
86
+ - **Which characters?** Type the character's name (eg. `Yelan`), then enter. For several characters, put a space between their names. For every character, type `all`.
87
+
88
+ - A new folder with the character's name (eg. `Yelan`) appears beside the script, holding the mod. When the script says `== Press ENTER to exit ==`, press enter.
89
+
90
+ > [!TIP]
91
+ > Copy the character's name as it is written in the [Mods list](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/Mods/README.md).
92
+ > The new folder is named exactly as you typed it.
93
+
94
+ > [!NOTE]
95
+ > The first run installs what the script needs (numpy, and [AG Remap's API](https://pypi.org/project/FixRaidenBoss2/)), so it
96
+ > takes a little longer. Later runs skip that.
97
+
98
+ ### STEP 3:
99
+ - Open the game and enjoy it
100
+
101
+ <br>
102
+
103
+ ## Choice B: Run on CMD Without a Script 🟡
104
+ ### STEP 1:
105
+ - Install the generator onto your computer by [opening cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd) and typing:
106
+ ```bash
107
+ python -m pip install -U AGIDMGen
108
+ ```
109
+ then enter
110
+
111
+ *( you can now run the program anywhere without copying a script! )*
112
+
113
+ ### STEP 2:
114
+ - [open cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd) in GIMI's or WWMI's `Mods` folder and type the game's word, the character's name, then `--download`:
115
+ ```bash
116
+ python -m AGIDMGen gimi Yelan --download
117
+ ```
118
+ then enter
119
+
120
+ *( or type only `python -m AGIDMGen`, and it asks you, as in [Choice A](#choice-a-lets-start--) )*
121
+
122
+ ### STEP 3:
123
+ - Open the game and enjoy it
124
+
125
+ <br>
126
+
127
+ ## Choice C: Run on CMD With a Script 🟡
128
+ ### STEP 1:
129
+ - Get the script, as in [Choice A's STEP 1](#choice-a-lets-start--)
130
+
131
+ ### STEP 2:
132
+ - [open cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd) in that `Mods` folder and type `python AGIDMGen.py`, the game's word, the character's name, then `--download`.
133
+
134
+ *eg. for Yelan in GI:*
135
+ ```bash
136
+ python AGIDMGen.py gimi Yelan --download
137
+ ```
138
+ then enter
139
+
140
+ *eg. for Sanhua in WuWa:*
141
+ ```bash
142
+ python AGIDMGen.py wwmi Sanhua --download
143
+ ```
144
+
145
+ > [!TIP]
146
+ > - Want several characters? Put a space between their names: `python AGIDMGen.py gimi Yelan YelanTranquil --download`
147
+ > - Want every character? Use `--all` instead of a name: `python AGIDMGen.py gimi --download --all`
148
+ > - Already have [GI-Model-Importer-Assets](https://github.com/SilentNightSound/GI-Model-Importer-Assets) or
149
+ > [WWMI-Assets](https://github.com/SpectrumQT/WWMI-Assets)? Give the **full** path to the character's folder instead of
150
+ > its name, without `--download`: `python AGIDMGen.py gimi "C:\path\to\GI-Model-Importer-Assets\PlayerCharacterData\Yelan"`
151
+
152
+ ### STEP 3:
153
+ - Open the game and enjoy it
154
+
155
+ <br>
156
+ <br>
157
+
158
+ ## Choice D: API Usage 🟠
159
+
160
+ Tool developers can make identity mods within their own code!
161
+
162
+ ### API Setup
163
+
164
+ *Make sure you first install the module by typing into [cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd):*
165
+ ```bash
166
+ python -m pip install -U AGIDMGen
167
+ ```
168
+ <br>
169
+
170
+ ### API Example
171
+
172
+ ```python
173
+ import AGIDMGen as IDMG
174
+ import FixRaidenBoss2 as FRB # AG Remap's API: its logger works for both libraries
175
+
176
+ service = IDMG.IDModGenService(IDMG.ModLoaders.GIMI, names = ["Yelan", "YelanTranquil"], outputFolder = "Mods", logger = FRB.Logger())
177
+ service.generate()
178
+
179
+ print("Made:", sorted(service.stats.generated))
180
+ ```
181
+
182
+ `IDModGenService` makes each mod into `<outputFolder>/<name>`, from download folders (`names = [...]`) or from asset
183
+ folders (`assetsFolders = [...]`). A character that fails does not stop the others: it is recorded in `service.stats`,
184
+ and nothing is printed unless you give it a logger.
185
+
186
+ <details>
187
+ <summary>More API examples</summary>
188
+ <br>
189
+
190
+ **In a server**, give each request its own logger, and either read what it wrote afterwards or forward each line as it
191
+ is written:
192
+
193
+ ```python
194
+ class ForwardingLogger(FRB.BaseLogger):
195
+ def write(self, message: str):
196
+ send_to_frontend(message) # eg. a websocket, a queue, a database row
197
+
198
+ def read(self, desc: str) -> str:
199
+ return "" # nothing interactive on a server
200
+
201
+ logger = FRB.Logger(logTxt = True, verbose = False) # or: ForwardingLogger()
202
+ service = IDMG.IDModGenService(IDMG.ModLoaders.GIMI, names = ["Yelan"], outputFolder = folder, logger = logger)
203
+ service.generate()
204
+ transcript = logger.loggedTxt
205
+ ```
206
+
207
+ **From asset folders:**
208
+
209
+ ```python
210
+ service = IDMG.IDModGenService(IDMG.ModLoaders.WWMI, assetsFolders = ["WWMI-Assets/PlayerCharacterData/Sanhua"], outputFolder = "Mods")
211
+ service.generate()
212
+ ```
213
+
214
+ **One character, directly.** Unlike the service, the generators raise an error when they fail:
215
+
216
+ ```python
217
+ mod = IDMG.GIMIIdentityModGenerator().generate("GI-Model-Importer-Assets/PlayerCharacterData/Yelan", "Mods/Yelan")
218
+ mod = IDMG.WWMIIdentityModGenerator().generateFromRepo("Sanhua", "Mods/Sanhua", version = "2.5")
219
+ print("\n".join(mod.getSummary()))
220
+ ```
221
+
222
+ **Every character with a download folder:** `IDMG.ModDownloader.getCharacters(IDMG.ModLoaders.GIMI)`
223
+
224
+ </details>
225
+
226
+ <br>
227
+ <br>
228
+
229
+ ## Command Options
230
+ Add these after the character's name. The **Game** column says which game has the option.
231
+
232
+ | Options | Game | Description |
233
+ | --- | --- | --- |
234
+ | -h, --help | All | show the help message and exit |
235
+ | --download | All | the names typed are characters' names: download their files and make their mods from them |
236
+ | --all | All | with `--download`: make the mod of every character |
237
+ | --out folder | All | the folder the mods are made in, as `<folder>/<name>`. If this option is not specified, then the mods are made in the current folder. |
238
+ | --version str | All | with `--download`: the game version wanted, eg. `4.0`. If this option is not specified, then the newest version is used. |
239
+ | --name str | All | the character's name inside the mod (one character only) |
240
+ | --log folder | All | also write everything printed into `<folder>/IDModGenLog.txt` |
241
+ | --quiet | All | print only errors |
242
+ | --proxy str | All | with `--download`: the link to the proxy server, for those whose internet access must go through a proxy |
243
+ | --downloadFolder folder | All | with `--download`: keep the downloaded files in `<folder>/<name>`. If this option is not specified, then they are deleted afterwards. |
244
+ | --localData REPO=folder | All | with `--download`: copy the files of `AGRemap` or `AGIDMGen` from a copy of its `Data/Mod Downloads` folder on your computer, instead of downloading them (can be given more than once) |
245
+ | --noFix | GI | leave the `ORFix` / `NNFix` lines out of the mod |
246
+ | --faceRegister str | GI | the slot the face texture is bound to. If this option is not specified, then `ps-t0` is used (some 6.x skins need `ps-t1`). |
247
+ | --assetPrefix str | GI | what the asset folder's files start with, when that is not the folder's name (one asset folder only) |
248
+ | --textureFrom B=C:O[:plain\|normalMap] | GI | part `B`, which has no textures of its own, uses object `O` of part `C`'s textures, eg. `Bang=Body:A` (can be given more than once) |
249
+ | --author str | WuWa | the mod author WWMI shows. If this option is not specified, then `Anime Game Remap` is used. |
250
+ | --noTextures | WuWa | leave the textures out |
251
+ | --rawBones | WuWa | write bone indices as `vg_offset` + local index, instead of through the `vg_map` |
252
+
253
+ <br>
254
+
255
+ > [!NOTE]
256
+ > The command ends with exit code **0** when every mod was made, **1** when one could not be (or the options are not
257
+ > valid), and **2** when a WWMI mod's shape keys do not match its `Metadata.json`.
258
+
259
+ <br>
@@ -0,0 +1,242 @@
1
+ # Anime Game Identity Mod Generator (AGIDMGen)
2
+ [![Static Badge](https://img.shields.io/badge/3.9%2B-3776AB?style=for-the-badge&label=Python)](https://www.python.org/downloads/)
3
+ [![Static Badge](https://img.shields.io/badge/GIMI%20%7C%20WWMI-6E4FA3?style=for-the-badge&label=Mod%20Loaders)](#supported-games)
4
+ [![Static Badge](https://img.shields.io/badge/MIT-green?style=for-the-badge&label=License)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/AGIDMGen/api/LICENSE)
5
+ [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Alex-Au1/Anime-Game-Identity-Mod-Generator/tests.yml?branch=main&label=Unit%2FIntegration%20Tests&style=for-the-badge)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/actions/workflows/tests.yml)
6
+
7
+ <br>
8
+
9
+ Makes ***identity mods***: a mod of a character that looks **exactly like the character already does in the game**.
10
+
11
+ <br>
12
+
13
+ An identity mod changes nothing you can see. It is the character's own model, textures and colours, written out as a mod
14
+ folder. That makes it the perfect starting point for making your own mod, or for checking that a mod loader works.
15
+
16
+ A sub-project of [Anime Game Remap (AG Remap)](https://github.com/nhok0169/Anime-Game-Remap).
17
+
18
+ <br>
19
+
20
+ ## Contributors
21
+
22
+ | | |
23
+ |---|---|
24
+ | **[Albert Gold](https://github.com/Alex-Au1)** *(Active Lead Maintainer)* | [![@albertgold](https://dcbadge.limes.pink/api/shield/367087171154214914?theme=discord-inverted)](https://discord.com/users/367087171154214914) |
25
+ | [![The Council](https://raw.githubusercontent.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/main/Docs/src/_static/images/TheCouncilofClaudeAgentsBadgeMini.svg)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/AI%20Agent%20Help/README.md) *(Maintainer Team)* | [![The Council Badge](https://raw.githubusercontent.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/main/Docs/src/_static/images/TheCouncilofClaudeAgentsBadgeWithCount.svg)](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/AI%20Agent%20Help/README.md) |
26
+
27
+ <br>
28
+
29
+ ## Requirements
30
+ - [Python (version 3.9 and up)](https://www.python.org/downloads/)
31
+ - *When installing Python, tick the box **"Add python.exe to PATH"** at the bottom of the first screen.*
32
+ - An internet connection (the character's files are downloaded for you)
33
+
34
+ <br>
35
+
36
+ ## Supported Games
37
+
38
+ | Game | Mod Loader | The word to type |
39
+ | --- | --- | --- |
40
+ | GI | GIMI | `gimi` |
41
+ | WuWa | WWMI | `wwmi` |
42
+
43
+ <br>
44
+
45
+ > [!TIP]
46
+ > **Just want the mod?** Every character's identity mod is already made for you in the
47
+ > [Mods](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/Mods/README.md) folder.
48
+ > That page also lists every character's name you can type below.
49
+
50
+ <br>
51
+
52
+ ## How to Run
53
+ - Choose your pick of which way to run it:
54
+
55
+ - **Choice A:** &nbsp; [Quickstart!](#choice-a-lets-start--) 🟢 &nbsp;&nbsp; (for beginners)
56
+ - **Choice B:** &nbsp; [CMD WITHOUT a Script](#choice-b-run-on-cmd-without-a-script-) 🟡 &nbsp;&nbsp; (recommended if you run by CMD)
57
+ - **Choice C:** &nbsp; [CMD with a Script](#choice-c-run-on-cmd-with-a-script-) 🟡 &nbsp;&nbsp; (the convention that other GIMI scripts follow)
58
+ - **Choice D:** &nbsp; [API](#choice-d-api-usage-) 🟠 &nbsp;&nbsp; (for expert coders)
59
+
60
+ <br>
61
+
62
+ ## Choice A: Let's Start ! 🟢
63
+ ### STEP 1:
64
+ - Right-click [AGIDMGen.py](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/raw/main/AGIDMGen/script%20build/src/AGIDMGen/AGIDMGen.py), choose **"Save link as..."**, and save the script into GIMI's or WWMI's `Mods` folder.
65
+
66
+ ### STEP 2:
67
+ - Double click on the script, and answer its two questions:
68
+ - **Which game?** Type `gimi` for GI or `wwmi` for WuWa, then enter
69
+ - **Which characters?** Type the character's name (eg. `Yelan`), then enter. For several characters, put a space between their names. For every character, type `all`.
70
+
71
+ - A new folder with the character's name (eg. `Yelan`) appears beside the script, holding the mod. When the script says `== Press ENTER to exit ==`, press enter.
72
+
73
+ > [!TIP]
74
+ > Copy the character's name as it is written in the [Mods list](https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator/blob/main/Mods/README.md).
75
+ > The new folder is named exactly as you typed it.
76
+
77
+ > [!NOTE]
78
+ > The first run installs what the script needs (numpy, and [AG Remap's API](https://pypi.org/project/FixRaidenBoss2/)), so it
79
+ > takes a little longer. Later runs skip that.
80
+
81
+ ### STEP 3:
82
+ - Open the game and enjoy it
83
+
84
+ <br>
85
+
86
+ ## Choice B: Run on CMD Without a Script 🟡
87
+ ### STEP 1:
88
+ - Install the generator onto your computer by [opening cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd) and typing:
89
+ ```bash
90
+ python -m pip install -U AGIDMGen
91
+ ```
92
+ then enter
93
+
94
+ *( you can now run the program anywhere without copying a script! )*
95
+
96
+ ### STEP 2:
97
+ - [open cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd) in GIMI's or WWMI's `Mods` folder and type the game's word, the character's name, then `--download`:
98
+ ```bash
99
+ python -m AGIDMGen gimi Yelan --download
100
+ ```
101
+ then enter
102
+
103
+ *( or type only `python -m AGIDMGen`, and it asks you, as in [Choice A](#choice-a-lets-start--) )*
104
+
105
+ ### STEP 3:
106
+ - Open the game and enjoy it
107
+
108
+ <br>
109
+
110
+ ## Choice C: Run on CMD With a Script 🟡
111
+ ### STEP 1:
112
+ - Get the script, as in [Choice A's STEP 1](#choice-a-lets-start--)
113
+
114
+ ### STEP 2:
115
+ - [open cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd) in that `Mods` folder and type `python AGIDMGen.py`, the game's word, the character's name, then `--download`.
116
+
117
+ *eg. for Yelan in GI:*
118
+ ```bash
119
+ python AGIDMGen.py gimi Yelan --download
120
+ ```
121
+ then enter
122
+
123
+ *eg. for Sanhua in WuWa:*
124
+ ```bash
125
+ python AGIDMGen.py wwmi Sanhua --download
126
+ ```
127
+
128
+ > [!TIP]
129
+ > - Want several characters? Put a space between their names: `python AGIDMGen.py gimi Yelan YelanTranquil --download`
130
+ > - Want every character? Use `--all` instead of a name: `python AGIDMGen.py gimi --download --all`
131
+ > - Already have [GI-Model-Importer-Assets](https://github.com/SilentNightSound/GI-Model-Importer-Assets) or
132
+ > [WWMI-Assets](https://github.com/SpectrumQT/WWMI-Assets)? Give the **full** path to the character's folder instead of
133
+ > its name, without `--download`: `python AGIDMGen.py gimi "C:\path\to\GI-Model-Importer-Assets\PlayerCharacterData\Yelan"`
134
+
135
+ ### STEP 3:
136
+ - Open the game and enjoy it
137
+
138
+ <br>
139
+ <br>
140
+
141
+ ## Choice D: API Usage 🟠
142
+
143
+ Tool developers can make identity mods within their own code!
144
+
145
+ ### API Setup
146
+
147
+ *Make sure you first install the module by typing into [cmd](https://www.google.com/search?q=how+to+open+cmd+in+a+folder&oq=how+to+open+cmd):*
148
+ ```bash
149
+ python -m pip install -U AGIDMGen
150
+ ```
151
+ <br>
152
+
153
+ ### API Example
154
+
155
+ ```python
156
+ import AGIDMGen as IDMG
157
+ import FixRaidenBoss2 as FRB # AG Remap's API: its logger works for both libraries
158
+
159
+ service = IDMG.IDModGenService(IDMG.ModLoaders.GIMI, names = ["Yelan", "YelanTranquil"], outputFolder = "Mods", logger = FRB.Logger())
160
+ service.generate()
161
+
162
+ print("Made:", sorted(service.stats.generated))
163
+ ```
164
+
165
+ `IDModGenService` makes each mod into `<outputFolder>/<name>`, from download folders (`names = [...]`) or from asset
166
+ folders (`assetsFolders = [...]`). A character that fails does not stop the others: it is recorded in `service.stats`,
167
+ and nothing is printed unless you give it a logger.
168
+
169
+ <details>
170
+ <summary>More API examples</summary>
171
+ <br>
172
+
173
+ **In a server**, give each request its own logger, and either read what it wrote afterwards or forward each line as it
174
+ is written:
175
+
176
+ ```python
177
+ class ForwardingLogger(FRB.BaseLogger):
178
+ def write(self, message: str):
179
+ send_to_frontend(message) # eg. a websocket, a queue, a database row
180
+
181
+ def read(self, desc: str) -> str:
182
+ return "" # nothing interactive on a server
183
+
184
+ logger = FRB.Logger(logTxt = True, verbose = False) # or: ForwardingLogger()
185
+ service = IDMG.IDModGenService(IDMG.ModLoaders.GIMI, names = ["Yelan"], outputFolder = folder, logger = logger)
186
+ service.generate()
187
+ transcript = logger.loggedTxt
188
+ ```
189
+
190
+ **From asset folders:**
191
+
192
+ ```python
193
+ service = IDMG.IDModGenService(IDMG.ModLoaders.WWMI, assetsFolders = ["WWMI-Assets/PlayerCharacterData/Sanhua"], outputFolder = "Mods")
194
+ service.generate()
195
+ ```
196
+
197
+ **One character, directly.** Unlike the service, the generators raise an error when they fail:
198
+
199
+ ```python
200
+ mod = IDMG.GIMIIdentityModGenerator().generate("GI-Model-Importer-Assets/PlayerCharacterData/Yelan", "Mods/Yelan")
201
+ mod = IDMG.WWMIIdentityModGenerator().generateFromRepo("Sanhua", "Mods/Sanhua", version = "2.5")
202
+ print("\n".join(mod.getSummary()))
203
+ ```
204
+
205
+ **Every character with a download folder:** `IDMG.ModDownloader.getCharacters(IDMG.ModLoaders.GIMI)`
206
+
207
+ </details>
208
+
209
+ <br>
210
+ <br>
211
+
212
+ ## Command Options
213
+ Add these after the character's name. The **Game** column says which game has the option.
214
+
215
+ | Options | Game | Description |
216
+ | --- | --- | --- |
217
+ | -h, --help | All | show the help message and exit |
218
+ | --download | All | the names typed are characters' names: download their files and make their mods from them |
219
+ | --all | All | with `--download`: make the mod of every character |
220
+ | --out folder | All | the folder the mods are made in, as `<folder>/<name>`. If this option is not specified, then the mods are made in the current folder. |
221
+ | --version str | All | with `--download`: the game version wanted, eg. `4.0`. If this option is not specified, then the newest version is used. |
222
+ | --name str | All | the character's name inside the mod (one character only) |
223
+ | --log folder | All | also write everything printed into `<folder>/IDModGenLog.txt` |
224
+ | --quiet | All | print only errors |
225
+ | --proxy str | All | with `--download`: the link to the proxy server, for those whose internet access must go through a proxy |
226
+ | --downloadFolder folder | All | with `--download`: keep the downloaded files in `<folder>/<name>`. If this option is not specified, then they are deleted afterwards. |
227
+ | --localData REPO=folder | All | with `--download`: copy the files of `AGRemap` or `AGIDMGen` from a copy of its `Data/Mod Downloads` folder on your computer, instead of downloading them (can be given more than once) |
228
+ | --noFix | GI | leave the `ORFix` / `NNFix` lines out of the mod |
229
+ | --faceRegister str | GI | the slot the face texture is bound to. If this option is not specified, then `ps-t0` is used (some 6.x skins need `ps-t1`). |
230
+ | --assetPrefix str | GI | what the asset folder's files start with, when that is not the folder's name (one asset folder only) |
231
+ | --textureFrom B=C:O[:plain\|normalMap] | GI | part `B`, which has no textures of its own, uses object `O` of part `C`'s textures, eg. `Bang=Body:A` (can be given more than once) |
232
+ | --author str | WuWa | the mod author WWMI shows. If this option is not specified, then `Anime Game Remap` is used. |
233
+ | --noTextures | WuWa | leave the textures out |
234
+ | --rawBones | WuWa | write bone indices as `vg_offset` + local index, instead of through the `vg_map` |
235
+
236
+ <br>
237
+
238
+ > [!NOTE]
239
+ > The command ends with exit code **0** when every mod was made, **1** when one could not be (or the options are not
240
+ > valid), and **2** when a WWMI mod's shape keys do not match its `Metadata.json`.
241
+
242
+ <br>
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "AGIDMGen"
7
+ version = "0.1.0"
8
+ authors = [
9
+ { name="Albert Gold", email="AlexXianZhenYuAu@gmail.com" },
10
+ ]
11
+ description = "Generates identity mods (a character's own model, written out as a mod) for 3DMigoto-based anime game mod loaders"
12
+ readme = "README.md"
13
+ requires-python = ">=3.9"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+ dependencies = ["numpy>=1.26.4", "FixRaidenBoss2>=5.0.0"]
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator"
23
+ Repository = "https://github.com/Alex-Au1/Anime-Game-Identity-Mod-Generator"
24
+
25
+ # the package sits under 'src/py' so a 'src/cpp' / 'src/cy' layer can sit beside it later, as in AG Remap
26
+ [tool.setuptools.packages.find]
27
+ where = ["src/py"]
28
+
29
+ [tool.setuptools.package-data]
30
+ AGIDMGen = ["py.typed"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+