node-asset-studio-mod 1.0.1 → 1.0.2
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.
- package/package.json +4 -2
- package/readme_CN.md +111 -0
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-asset-studio-mod",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Node.js adapter for AssetStudioMod CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
-
"scripts"
|
|
10
|
+
"scripts",
|
|
11
|
+
"readme.md",
|
|
12
|
+
"readme_CN.md"
|
|
11
13
|
],
|
|
12
14
|
"exports": {
|
|
13
15
|
".": {
|
package/readme_CN.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# node-asset-studio-mod
|
|
2
|
+
|
|
3
|
+
Node.js 封装的 [AssetStudioMod](https://github.com/aelurum/AssetStudio) CLI。
|
|
4
|
+
|
|
5
|
+
## 环境要求
|
|
6
|
+
|
|
7
|
+
**需要 .NET 9 Runtime**
|
|
8
|
+
|
|
9
|
+
- **Windows**: [.NET Desktop Runtime 9.0](https://dotnet.microsoft.com/download/dotnet/9.0)
|
|
10
|
+
- **Linux / Mac**: [.NET Runtime 9.0](https://dotnet.microsoft.com/download/dotnet/9.0)
|
|
11
|
+
|
|
12
|
+
确保在使用此库之前已安装运行时。
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
# 使用 pnpm
|
|
20
|
+
pnpm install node-asset-studio-mod
|
|
21
|
+
|
|
22
|
+
# 或 npm
|
|
23
|
+
npm install node-asset-studio-mod
|
|
24
|
+
|
|
25
|
+
# 或 yarn
|
|
26
|
+
yarn add node-asset-studio-mod
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
> 安装过程中,CLI 二进制文件会根据平台自动下载到 `bin/` 目录。
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 使用方法
|
|
34
|
+
|
|
35
|
+
### 1. 使用默认导出函数
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
import { exportAssets } from "node-asset-studio-mod";
|
|
39
|
+
|
|
40
|
+
const input = "path/to/assets/9.3.0.180";
|
|
41
|
+
const output = "path/to/analysing/9.3.0.180";
|
|
42
|
+
|
|
43
|
+
await exportAssets(input, output);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**默认选项:**
|
|
47
|
+
|
|
48
|
+
- `mode`: `"export"`
|
|
49
|
+
- `log`: `true`
|
|
50
|
+
- `group`: `"container"`
|
|
51
|
+
- `assetType`: `"all"`
|
|
52
|
+
- `cliPath`: 会自动从 `bin/` 检测
|
|
53
|
+
|
|
54
|
+
你可以通过传入配置对象覆盖默认选项:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
import { exportAssets } from "node-asset-studio-mod";
|
|
58
|
+
|
|
59
|
+
await exportAssets(input, output, {
|
|
60
|
+
assetType: ["tex2d", "sprite", "textasset"],
|
|
61
|
+
overwrite: true,
|
|
62
|
+
imageFormat: "png",
|
|
63
|
+
logLevel: "info",
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### 2. 使用类实例进行更灵活控制
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
import { AssetExporter } from "node-asset-studio-mod";
|
|
73
|
+
|
|
74
|
+
const exporter = new AssetExporter({
|
|
75
|
+
cliPath: "E:/myproject/bin/AssetStudioModCLI.exe", // 可选
|
|
76
|
+
mode: "export",
|
|
77
|
+
assetType: ["tex2d", "sprite"],
|
|
78
|
+
overwrite: true,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
await exporter.exportAssets(input, output);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
- 你可以创建多个实例来使用不同配置。
|
|
85
|
+
- `cliPath` 可选,库会自动检测 `bin/` 中的二进制文件。
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### 3. 资源类型
|
|
90
|
+
|
|
91
|
+
支持的资源类型(对应 TS `AssetTypes`):
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
"all", "tex2d", "tex2dArray", "sprite", "textasset", "monobehaviour",
|
|
95
|
+
"font", "shader", "movietexture", "audio", "video", "mesh", "animator"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**说明:**
|
|
99
|
+
|
|
100
|
+
- `"all"` 表示导出上面列出的所有类型。
|
|
101
|
+
- 你可以使用数组指定多个类型,例如 `["tex2d", "sprite"]`。
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### 4. 导出模式
|
|
106
|
+
|
|
107
|
+
支持的模式(对应 TS `ExportMode`):
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
"extract", "export", "exportRaw", "dump", "info", "live2d", "splitObjects", "animator"
|
|
111
|
+
```
|