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 @@