Skip to content

Commit fd3ce86

Browse files
committed
fix(avatar): 修复生产环境模型加载与扫描路径 (v0.8.64)
- 修复 scan3DModels 在生产环境扫描 resources/public/ (不存在) 的路径错误 改为从 app.asar/dist/assets/3d 扫描,支持 asar 透明读取 - 统一模型加载策略为 manifest.json 优先,.pero 容器作为后备 解决 asar 内 fetch 大二进制文件可能静默失败的问题
1 parent 7dadcc1 commit fd3ce86

10 files changed

Lines changed: 17 additions & 13 deletions

File tree

backend/nit_core/interpreter/rust_binding/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nit_rust_runtime"
3-
version = "0.8.63"
3+
version = "0.8.64"
44
edition = "2021"
55

66
[lib]

backend/nit_core/interpreter/rust_binding/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "nit_rust_runtime"
7-
version = "0.8.63"
7+
version = "0.8.64"
88
description = "NIT Rust Runtime"
99
requires-python = ">=3.8"
1010
dependencies = []

backend/nit_core/nit_terminal_auditor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nit_terminal_auditor"
3-
version = "0.8.63"
3+
version = "0.8.64"
44
edition = "2021"
55

66
[lib]

backend/nit_core/tools/work/CodeSearcher/src/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "CodeSearcher"
3-
version = "0.8.63"
3+
version = "0.8.64"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pero-backend"
3-
version = "0.8.63"
3+
version = "0.8.64"
44
description = "萌动链接:PeroperoChat! 后端服务"
55
requires-python = ">=3.10,<3.11"
66
dependencies = [

backend/vision_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pero_vision_core"
3-
version = "0.8.63"
3+
version = "0.8.64"
44
edition = "2021"
55

66
[lib]

backend/vision_core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "pero_vision_core"
7-
version = "0.8.63"
7+
version = "0.8.64"
88
description = "High-performance computer vision core for Pero using Rust"
99
license = { text = "Apache-2.0" }
1010
authors = [

electron/main/services/assets.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ export async function scan3DModels(): Promise<AssetInfo[]> {
3333
const models: AssetInfo[] = []
3434
const root = getRootPath()
3535

36-
// 1. 优先扫描 .pero 加密容器 (public/assets/3d/*.pero)
37-
const officialModelsDir = path.join(root, 'public/assets/3d')
36+
// 1. 优先扫描 .pero 加密容器
37+
// 开发环境: public/assets/3d (Vite 原始目录)
38+
// 生产环境: app.asar/dist/assets/3d (Vite 构建后的输出)
39+
const officialModelsDir = isDev
40+
? path.join(root, 'public/assets/3d')
41+
: path.join(paths.app, 'dist/assets/3d')
3842
const allFiles = await fs.readdir(officialModelsDir).catch(() => [] as string[])
3943
for (const file of allFiles) {
4044
if (file.endsWith('.pero')) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "peropero-chat",
33
"private": true,
4-
"version": "0.8.63",
4+
"version": "0.8.64",
55
"description": "萌动链接:PeroperoChat!- 一个充满活力的 3D 桌面宠物应用",
66
"author": "YoKONCy",
77
"license": "Apache-2.0",

src/components/avatar/BedrockAvatar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,9 @@ async function loadDefaultManifest() {
629629
await loadAvatar(manifest)
630630
}
631631
632-
// 开发模式:优先 manifest.json(因为改动能热重载),.pero 作为后备
633-
// 生产模式:优先 .pero 容器,没有再尝试 manifest
634-
const [primary, fallback] = isDev ? [loadManifest, loadContainer] : [loadContainer, loadManifest]
632+
// 始终优先 manifest.json(散文件夹):asar 环境对 JSON + 散文件支持最稳定
633+
// .pero 容器仅作为后备,适用于 Workshop 等外部模型场景
634+
const [primary, fallback] = [loadManifest, loadContainer]
635635
636636
try {
637637
await primary()

0 commit comments

Comments
 (0)