From 99613dbc83dd9d06136142f23d05a33ca05d2ba4 Mon Sep 17 00:00:00 2001 From: "2817212736@qq.com" <2817212736@qq.com> Date: Thu, 29 May 2025 19:00:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9D=90=E8=B4=A8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/common/MaterialEditor.ts | 15 ++++++----- src/components/MaterialAdjuster.vue | 42 +++++++++++++---------------- src/stores/sceneStore.ts | 19 +++++++------ 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 63ea726..b21e113 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "material-editor", "private": true, - "version": "1.0.7", + "version": "1.0.8", "type": "module", "scripts": { "dev": "vite", diff --git a/src/common/MaterialEditor.ts b/src/common/MaterialEditor.ts index bd3a2ec..45a2e56 100644 --- a/src/common/MaterialEditor.ts +++ b/src/common/MaterialEditor.ts @@ -167,15 +167,17 @@ export class MaterialEditor private Material: PhysicalMaterialRecord; setMaterial(mat: PhysicalMaterialRecord) { - console.log("set", mat.Material); this.Material = mat; - this._MeshMaterial.copy(mat.Material); + // for (const child of this.ShowObject.children) { + // if (child instanceof Mesh) { + // child.material = mat.Material; + // } + // } - let mtl = this._MeshMaterial; - console.log("set2", this._MeshMaterial) + console.log(mat.Material); - this.ShowMesh.material = mtl; - + this._MeshMaterial.copy(mat.Material); + let mtl = this._MeshMaterial; if (mtl.metalness > 0.8) this.LoadMetalEnv().then(env => { @@ -214,6 +216,7 @@ export class MaterialEditor async Update() { + console.log("copy:", this.Material.Material.metalness); let mat = this.ShowMesh.material as MeshPhysicalMaterial; mat.needsUpdate = true; diff --git a/src/components/MaterialAdjuster.vue b/src/components/MaterialAdjuster.vue index 72c916f..5d67846 100644 --- a/src/components/MaterialAdjuster.vue +++ b/src/components/MaterialAdjuster.vue @@ -38,25 +38,25 @@ - + {{ Material.matalness }} - + {{ Material.roughness }} - + {{ Material.bumpScale }} - + {{ Material.specular }} @@ -64,9 +64,9 @@

纹理调节

- + - + @@ -108,9 +108,8 @@