From 696e8b294e4106b209e303a5cec7eb787c676645 Mon Sep 17 00:00:00 2001 From: "2817212736@qq.com" <2817212736@qq.com> Date: Fri, 30 May 2025 11:58:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BC=96=E8=BE=91=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=9D=90=E8=B4=A8=E5=90=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/common/MaterialEditor.ts | 8 -------- src/components/MaterialAdjuster.vue | 8 ++++---- src/components/MaterialView.vue | 9 +++++---- src/lib/libOutputConfig.ts | 9 +++++++-- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 07752d3..838fcb9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "material-editor", "private": true, - "version": "1.0.11", + "version": "1.0.12", "type": "module", "scripts": { "dev": "vite", diff --git a/src/common/MaterialEditor.ts b/src/common/MaterialEditor.ts index 45a2e56..c8fc891 100644 --- a/src/common/MaterialEditor.ts +++ b/src/common/MaterialEditor.ts @@ -168,14 +168,7 @@ export class MaterialEditor setMaterial(mat: PhysicalMaterialRecord) { this.Material = mat; - // for (const child of this.ShowObject.children) { - // if (child instanceof Mesh) { - // child.material = mat.Material; - // } - // } - console.log(mat.Material); - this._MeshMaterial.copy(mat.Material); let mtl = this._MeshMaterial; if (mtl.metalness > 0.8) @@ -216,7 +209,6 @@ 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 7c5b652..f98a00d 100644 --- a/src/components/MaterialAdjuster.vue +++ b/src/components/MaterialAdjuster.vue @@ -127,7 +127,8 @@ export interface MaterialRequest { const scene = useScene(); const props = defineProps<{ - readonly textureSrcList?: string[]; + name?: string; + textureSrcList?: string[]; }>(); const emits = defineEmits<{ (e: 'cancel'): void; @@ -138,7 +139,7 @@ const Material = computed(() => scene.Material); const CurrGeometry = computed(() => scene.CurrGeometry); const Geometries = computed(() => scene.Geometries); -const debugMode = ref(false); +const debugMode = ref(true); const _textureSrc = ref(props.textureSrcList); const debugTextureSrc = ref(""); const textureAdjustment = ref({ @@ -159,7 +160,7 @@ const uploading = ref(false); // }); const materialInfo = reactive({ dirId: DirectoryId.MaterialDir, // 正常来说是2 - materialName: '材质', + materialName: props.name || '材质', inputText:'', }); @@ -178,7 +179,6 @@ watch(textureAdjustment, async (val) => { // 监听纹理更新 watch(() => scene.CurrTexture, (val) => { - console.log('watch-CurrTexture') textureAdjustment.value = { wrapS: val.wrapS, wrapT: val.wrapT, diff --git a/src/components/MaterialView.vue b/src/components/MaterialView.vue index 0161ec9..a6272bb 100644 --- a/src/components/MaterialView.vue +++ b/src/components/MaterialView.vue @@ -1,7 +1,7 @@