dsh-live2dwaifu 0.1.0 → 0.1.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/README.md CHANGED
@@ -1,74 +1,98 @@
1
- # dsh-live2d
1
+ # dsh-live2dwaifu
2
2
 
3
- 把 **Live2D(Cubism 3 / 4)** 模型接进 DSH Web 界面右下角。她/他会眨眼、呼吸、被风吹头发,说话时嘴动,情绪换表情。
3
+ 把 **Live2D(Cubism 3 / 4)** 模型请进 DSH 网页的右下角。她会眨眼、会呼吸、头发会被风吹,说话时嘴一张一合,心情变了眉毛跟着动。
4
4
 
5
- 模型不是内置的——**谁装谁放自己的**。点插件卡片上的 ⚙,选一个 Live2D 文件夹(里面有 `.model3.json` 的那一层),导进去就能用。模型存在本机 `~/.dsh/dsh-live2d/models/`,不上传。
5
+ 模型**不是内置的**——谁装谁放自己的。点卡片上的 ⚙,把模型文件夹整个选进去就行,文件留在这台机器上(`~/.dsh/dsh-live2d/models/`),一根网线都没往外走。
6
6
 
7
- ## 安装
7
+ > 给它一个模型,它给你一个会呼吸的角落。
8
8
 
9
- ```bash
10
- dsh plugin --profile desktop add dsh-live2d
11
- ```
9
+ ![两种状态](docs/preview.png)
10
+
11
+ | 样子 | 说明 |
12
+ |---|---|
13
+ | 展开 | 一张小卡片,上半身,底下一条气泡装台词 |
14
+ | 收起 | 缩成一条,只剩名字和一个 ⌃ |
12
15
 
13
- 或者本地开发:
16
+ ## 三十秒上手
14
17
 
15
18
  ```bash
16
- dsh plugin --profile desktop add link:<这个目录>
19
+ dsh plugin --profile desktop add dsh-live2dwaifu
17
20
  ```
18
21
 
19
- 装完重启 DSH。
22
+ 重启 DSH,右下角出现一张小卡片 → 点 ⚙ → 点「导入模型」→ 选那个装着 `.model3.json` 的文件夹 → 完事。
23
+
24
+ 导入的时候浏览器会一个一个把文件搬进去,模型大点就多等几秒,进度在底下会说话。
20
25
 
21
26
  ## 放自己的模型
22
27
 
23
28
  1. 卡片右上角 ⚙ → 「导入模型」
24
- 2. 选整个模型文件夹(要含 `.model3.json`、`.moc3`、贴图、`.physics3.json`)
25
- 3. 读完会自己挑出 model3 并选中
29
+ 2. 选**整个文件夹**(里面要有 `.model3.json`、`.moc3`、贴图,最好还有 `.physics3.json`)
30
+ 3. 读完它会自己认出哪个是模型,并切过去
31
+
32
+ 想放好几个也行,列表里点「用这个」换人,「删」送走。
26
33
 
27
- 导多个也行,「用这个」切换。
34
+ **能吃什么**:Cubism 3 / 4(`.model3.json` + `.moc3`)。
35
+ **吃不了什么**:Cubism 2 的老格式(`.model.json` + `.moc`)。
28
36
 
29
- **格式要求**:Cubism 3 / 4(`.model3.json` + `.moc3`)。Cubism 2 的老格式(`.model.json`)不支持。
30
- **没有动作文件也能用**:眨眼走 EyeBlink 参数组,嘴动走 LipSync / ParamMouthOpenY,头发靠 physics3.json 自带物理;表情由本插件用标准参数(`ParamEyeLSmile`、`ParamMouthForm`、`ParamBrow*`、`ParamAngle*`)现摆。
37
+ **没有动作文件也能活**:眨眼靠 EyeBlink 参数组,嘴动靠 `ParamMouthOpenY`,头发晃动是 `physics3.json` 自带的物理;表情是本插件拿标准参数(`ParamEyeLSmile`、`ParamMouthForm`、`ParamBrow*`、`ParamAngle*`)现摆的,一共七种:平静、开心、委屈、生气、害羞、无语、困。
31
38
 
32
- ## 给别的插件/脚本用的接口
39
+ ## 让它说点什么
33
40
 
34
- 卡片是个 iframe,页面地址 `/dsh-live2d/viewer`。父窗口 `postMessage` 就能控:
41
+ 卡片里是个 iframe(`/dsh-live2d/viewer`)。别的插件、脚本、控制台都能指挥它:
35
42
 
36
43
  ```js
37
44
  const frame = document.querySelector('iframe.dsh-l2d-body');
38
45
 
39
- // 说话(会逐字显示 + 嘴动)
46
+ // 说话:逐字蹦出来,嘴跟着动
40
47
  frame.contentWindow.postMessage({ type: 'dsh-live2d/say', text: '窗台那盆番茄红了。', mood: '开心' }, '*');
41
48
 
42
- // 只换表情:平静 / 开心 / 委屈 / 生气 / 害羞 / 无语 / 困
49
+ // 只换脸
43
50
  frame.contentWindow.postMessage({ type: 'dsh-live2d/mood', mood: '委屈' }, '*');
44
51
 
45
52
  // 打开模型管理
46
53
  frame.contentWindow.postMessage({ type: 'dsh-live2d/manage' }, '*');
47
54
  ```
48
55
 
49
- HTTP 接口(同源):
56
+ 同源的 HTTP 接口,给不服 iframe 的人:
50
57
 
51
58
  | 方法 | 路径 | 作用 |
52
59
  |---|---|---|
53
- | GET | `/dsh-live2d/api/models` | 列出模型与当前选中 |
54
- | POST | `/dsh-live2d/api/select` | `{id}` 切换 |
55
- | POST | `/dsh-live2d/api/import?model=<id>&path=<相对路径>` | 请求体是文件字节 |
56
- | POST | `/dsh-live2d/api/commit` | `{id,name}` 扫 model3 并选中 |
60
+ | GET | `/dsh-live2d/api/models` | 列出模型和当前选中的那只 |
61
+ | POST | `/dsh-live2d/api/select` | `{id}` 换人 |
62
+ | POST | `/dsh-live2d/api/import?model=<id>&path=<相对路径>` | 请求体就是文件字节 |
63
+ | POST | `/dsh-live2d/api/commit` | `{id,name}` 扫一遍 model3 并选中 |
57
64
  | POST | `/dsh-live2d/api/delete` | `{id}` 删掉 |
58
65
 
59
- ## 目录
66
+ ## 东西都放哪了
60
67
 
61
68
  ```
62
69
  ~/.dsh/dsh-live2d/
63
- config.json # 当前选中的模型
64
- models/<id>/ # 模型文件(原样保留相对结构)
70
+ config.json # 现在轮到谁上场
71
+ models/<id>/ # 模型文件,相对结构原样保留
65
72
  meta.json # { name, model3 }
66
73
  ```
67
74
 
75
+ ## 一些常见的小脾气
76
+
77
+ **右下角什么都没有?**
78
+ 先重启一次 DSH;还不来就看 `cordis.patch.yml` 里有没有 `- id: dsh-live2dwaifu` 这一行。
79
+
80
+ **导入了却不认得?**
81
+ 多半是文件夹选得太靠上或太靠下,`.model3.json` 就在里面那一层,选它隔壁那层。
82
+
83
+ **她只有半张脸?**
84
+ 这个模型的画布比例跟面板不一样。面板是竖的,太宽或太扁的模型会被裁两边。
85
+
86
+ **能放动作吗?**
87
+ 暂时不能编排 `.motion3.json`,表情是固定的七种。想要更多情绪,给它发 `mood`,等以后的版本。
88
+
68
89
  ## 已知限制
69
90
 
70
- - 只支持 Cubism 3 / 4;不支持 `.motion3.json` 之外的自定义动作库编排(表情是内置 7 种)。
71
- - 面板是浮层(`shell.overlay`),不是聊天区里的分栏;会盖住页面右下角,可收起成一个小条。
72
- - 内置的 Cubism Core 是 Live2D Inc. 的 Redistributable Code,随包分发,许可见其 EULA。
91
+ - 只支持 Cubism 3 / 4
92
+ - 面板是浮层(`shell.overlay`),不是聊天区分栏;会盖住右下角,能收起
93
+ - 七种表情,暂不支持自定义表情文件(`.exp3.json`)
94
+ - 内置的 Cubism Core 是 Live2D Inc. 的 Redistributable Code,随包分发,使用受其 EULA 约束
95
+
96
+ ---
73
97
 
74
- MIT © LFR
98
+ MIT © LFR · npm: [`dsh-live2dwaifu`](https://www.npmjs.com/package/dsh-live2dwaifu)
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-live2dwaifu",
3
- "version": "0.1.0",
4
- "description": "把 Live2D 模型接进 DSH Web 界面右侧:会眨眼、会呼吸、说话时嘴动、情绪换表情;自带模型管理,导入自己的模型文件夹即可用。",
3
+ "version": "0.1.2",
4
+ "description": "给 DSH 网页右下角请一个 Live2D 角色:会眨眼、会呼吸、说话时嘴动、心情变了眉毛跟着动。模型不用内置——谁装谁放自己的文件夹,文件留在这台机器上。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -29,11 +29,20 @@
29
29
  "files": [
30
30
  "lib",
31
31
  "assets",
32
+ "docs",
32
33
  "icon.png",
33
34
  "cordis.patch.yml",
34
35
  "README.md",
35
36
  "LICENSE"
36
37
  ],
37
38
  "license": "MIT",
38
- "icon": "./icon.png"
39
+ "icon": "./icon.png",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/FujiwaraReisen/dsh-live2dwaifu.git"
43
+ },
44
+ "homepage": "https://github.com/FujiwaraReisen/dsh-live2dwaifu#readme",
45
+ "bugs": {
46
+ "url": "https://github.com/FujiwaraReisen/dsh-live2dwaifu/issues"
47
+ }
39
48
  }