This commit is contained in:
2026-04-24 19:39:58 +08:00
parent 01fdc0ee37
commit c992660011
4 changed files with 43 additions and 17 deletions

View File

@ -277,6 +277,7 @@
<button class="option-btn" data-option="louver-2">百叶2</button>
<button class="option-btn" data-option="louver-3">百叶3</button>
<button class="option-btn" data-option="louver-4">百叶4</button>
<button class="option-btn" data-option="louver-4">卷帘小</button>
</div>
</div>
</div>
@ -418,7 +419,7 @@
const modelUrl = `https://sdk.zguiy.com/resurces/model/${currentText}.glb`;
console.log('替换百叶模型:', modelUrl);
try {
await kernel.model.replace('百叶', modelUrl);
await kernel.model.replace('卷帘小', modelUrl);
console.log(`百叶模型已替换为 ${currentText}`);
} catch (error) {
console.error(`百叶模型替换失败:`, error);
@ -512,7 +513,8 @@
document.getElementById('remove-model-btn').addEventListener('click', () => {
const pickedMesh = window.getCurrentPickedMesh();
if (pickedMesh) {
const success = kernel.model.remove(pickedMesh);
const meshName = pickedMesh.name;
const success = kernel.model.remove(meshName);
if (success) {
console.log('模型已移除');
// 关闭信息框