diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..87e97b8 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "mcp__ide__getDiagnostics" + ] + } +} diff --git a/package.json b/package.json index 4859fa7..d6609e0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "material-editor", "private": true, - "version": "1.0.34", + "version": "1.0.35", "type": "module", "scripts": { "dev": "vite", diff --git a/src/components/MaterialAdjuster.vue b/src/components/MaterialAdjuster.vue index 51ff935..832651c 100644 --- a/src/components/MaterialAdjuster.vue +++ b/src/components/MaterialAdjuster.vue @@ -214,7 +214,7 @@ watch(() => props.name, () => { }); watch(textureAdjustment, async (val) => { - scene.UpdateTexture(); + scene.UpdateTexture(val); }, { deep: true }); // 监听纹理更新 diff --git a/src/stores/sceneStore.ts b/src/stores/sceneStore.ts index b6ac2f1..5dcb77d 100644 --- a/src/stores/sceneStore.ts +++ b/src/stores/sceneStore.ts @@ -85,15 +85,15 @@ const sceneSetup = () => { /** 这是自定义材质更新方法,WebCAD库中的TextureTableRecord.TextureUpdate方法在导出的时候被删除了,所以需要自己实现 */ - function UpdateTexture() { + function UpdateTexture(adjustment?: Partial) { const record = _currTexture.value; const texture = record['texture'] as Texture; - texture.wrapS = record.WrapS; - texture.wrapT = record.WrapT; + texture.wrapS = adjustment?.wrapS ?? record.WrapS; + texture.wrapT = adjustment?.wrapT ?? record.WrapT; texture.anisotropy = 16; - texture.rotation = record.rotation; - texture.repeat.set(record.repeatX, record.repeatY); - texture.offset.set(record.moveX, record.moveY); + texture.rotation = adjustment?.rotation ?? record.rotation; + texture.repeat.set(adjustment?.repeatX ?? record.repeatX, adjustment?.repeatY ?? record.repeatY); + texture.offset.set(adjustment?.moveX ?? record.moveX, adjustment?.moveY ?? record.moveY); texture.needsUpdate = true; Update(); }