diff --git a/src/UI/Store/MaterialStore.ts b/src/UI/Store/MaterialStore.ts
index 683e881dc..87559f6f4 100644
--- a/src/UI/Store/MaterialStore.ts
+++ b/src/UI/Store/MaterialStore.ts
@@ -9,6 +9,9 @@ import { MaterialEditor } from "../../Editor/MaterialEditor";
import { IDirectoryProps } from "../Components/SourceManage/CommonPanel";
import { AppToaster } from "../Components/Toaster";
import { TextureStore } from "./TextureStore";
+import { UpdateDraw } from "../../Common/Status";
+
+let oldFullStatus = false;
export class MaterialStore extends Singleton
{
@@ -37,7 +40,7 @@ export class MaterialStore extends Singleton
currentEditorStore: TextureStore;
currentTextureTable: TextureTableRecord;
currentDir: IDirectoryProps;
-
+ @observable isFull = false;
constructor()
{
super();
@@ -79,6 +82,7 @@ export class MaterialStore extends Singleton
this.textureMaping.startObserver();
this.bumpMaping.startObserver();
this.roughnessMaping.startObserver();
+ oldFullStatus = this.isFull;
}
Destroy()
{
@@ -86,6 +90,18 @@ export class MaterialStore extends Singleton
this.textureMaping.dispose();
this.bumpMaping.dispose();
this.roughnessMaping.dispose();
+
+ if (oldFullStatus !== this.isFull)
+ {
+ for (let en of app.Database.ModelSpace.Entitys)
+ {
+ if (en.Material === this.Material.Id || app.Database.DefaultMaterial.Id === this.Material.Id)
+ {
+ en.Update(UpdateDraw.Geometry);
+ }
+ }
+ app.Viewer.UpdateRender();
+ }
}
Material: PhysicalMaterialRecord;
BindMaterial(material: PhysicalMaterialRecord)
@@ -132,6 +148,7 @@ export class MaterialStore extends Singleton
this.Material.useMap = this.textureMaping.use.get();
this.Material.useBumpMap = this.bumpMaping.use.get();
this.Material.useRoughnessMap = this.roughnessMaping.use.get();
+ this.Material.IsFull = this.isFull;
this.Material.GoodsInfo = toJS(this.goodsInfo);
@@ -139,7 +156,7 @@ export class MaterialStore extends Singleton
this.bumpMaping.UpdateStore(this.bumpMaping.textureId);
this.roughnessMaping.UpdateStore(this.roughnessMaping.textureId);
- this.Material.Update();
+ await this.Material.Update();
await (MaterialEditor.GetInstance() as MaterialEditor).Update();
}
};
@@ -155,6 +172,7 @@ export class MaterialStore extends Singleton
this.transparent.set(parseFloat((1 - this.Material.opacity).toFixed(2)));
this.bumpScale.set(this.Material.bumpScale);
this.roughness.set(this.Material.roughness);
+ this.isFull = this.Material.IsFull;
Object.assign(this.goodsInfo, this.Material.GoodsInfo);
}
diff --git a/src/UI/Store/TextureStore.ts b/src/UI/Store/TextureStore.ts
index 856d1e27f..a0984900c 100644
--- a/src/UI/Store/TextureStore.ts
+++ b/src/UI/Store/TextureStore.ts
@@ -75,8 +75,8 @@ export class TextureStore
this.updateing = true;
- this.repeatX.set(texture.repeatX);
- this.repeatY.set(texture.repeatY);
+ this.repeatX.set(1 / texture.repeatX);
+ this.repeatY.set(1 / texture.repeatY);
this.warpS.set(texture.WrapS);
this.wrapT.set(texture.WrapT);
let deg = MathUtils.radToDeg(texture.rotation);
@@ -99,7 +99,7 @@ export class TextureStore
this.repeatX.set(1);
}
else
- texture.repeatX = this.repeatX.get();
+ texture.repeatX = 1 / this.repeatX.get();
if (texture.WrapT === ClampToEdgeWrapping)
{
@@ -107,7 +107,7 @@ export class TextureStore
this.repeatY.set(1);
}
else
- texture.repeatY = this.repeatY.get();
+ texture.repeatY = 1 / this.repeatY.get();
}
}