diff --git a/src/DatabaseServices/Database.ts b/src/DatabaseServices/Database.ts index 333d327c5..dd2451b65 100644 --- a/src/DatabaseServices/Database.ts +++ b/src/DatabaseServices/Database.ts @@ -63,11 +63,10 @@ export class Database file.ReadObject(this, this.MaterialDict); file.ReadObject(this, this.TextureTableCol); - //TODO: 在对象关联情况下.更新可能出现 引用的问题. - this.MaterialDict.objectCol.forEach(m => + for (let mat of this.MaterialDict.objectCol) { - m.Update(); - }) + mat.Update(); + } this.hm.ReadFile(file); } @@ -107,4 +106,4 @@ export class Database console.warn("警告:尝试加入已经存在的id!"); this.idMap.set(index, id); } -} \ No newline at end of file +} diff --git a/src/GraphicsSystem/Viewer.ts b/src/GraphicsSystem/Viewer.ts index 13e540dd1..36cc7b0e3 100644 --- a/src/GraphicsSystem/Viewer.ts +++ b/src/GraphicsSystem/Viewer.ts @@ -279,7 +279,7 @@ export class Viewer en.GoodBye(); } }) - xaop.end(db.ModelSpace, db.ModelSpace.ReadFile, () => + xaop.end(db, db.FileRead, () => { renderEntitys(); })