From 127100d27bdad67c16dad3aeb77e6b5e6629b8b6 Mon Sep 17 00:00:00 2001
From: zguiy <1415466602@qq.com>
Date: Tue, 19 May 2026 15:08:02 +0800
Subject: [PATCH] 1
---
index.html | 15 +++++++++---
src/babylonjs/AppModel.ts | 49 ++++++++++++++++++---------------------
src/kernel/Adapter.ts | 4 ++--
3 files changed, 36 insertions(+), 32 deletions(-)
diff --git a/index.html b/index.html
index 5448067..5313ae9 100644
--- a/index.html
+++ b/index.html
@@ -352,10 +352,15 @@
-
-
+ 13
+
+
+
+ 10
+
+
-
+
@@ -749,9 +754,13 @@
// 移除按钮事件
document.getElementById('remove-model-btn').addEventListener('click', () => {
const pickedMesh = window.getCurrentPickedMesh();
+ console.log(pickedMesh);
+
if (pickedMesh) {
const meshName = pickedMesh.name;
const modelName = kernel.model.findModelNameByMesh(pickedMesh);
+ console.log(modelName);
+
const success = kernel.model.removeByName(modelName);
if (success) {
console.log('模型已移除');
diff --git a/src/babylonjs/AppModel.ts b/src/babylonjs/AppModel.ts
index 5131763..4a591ca 100644
--- a/src/babylonjs/AppModel.ts
+++ b/src/babylonjs/AppModel.ts
@@ -169,7 +169,7 @@ export class AppModel extends Monobehiver {
const newName = `${originalName}_${modelId}`;
const clonedMaterial = originalMaterial.clone(newName);
clonedMaterials.set(originalName, clonedMaterial);
-
+
}
// 应用克隆的材质
@@ -177,7 +177,7 @@ export class AppModel extends Monobehiver {
}
});
-
+
}
/** 为网格设置阴影(投射和接收) */
@@ -268,9 +268,9 @@ export class AppModel extends Monobehiver {
*/
private async addSingle(modelName: string, modelId: string, modelUrl: string, modelControlType?: ModelControlType, drag?: DragConfig, transform?: ModelTransform): Promise