@xeokit/xeokit-sdk 2.6.57 → 2.6.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.6.57",
3
+ "version": "2.6.58",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -232,6 +232,7 @@ class MetaModel {
232
232
  this.rootMetaObjects.push(metaObject);
233
233
  metaScene.rootMetaObjects[id] = metaObject;
234
234
  }
235
+ metaObject.metaModels.push(this);
235
236
  }
236
237
  }
237
238
  }
@@ -1,7 +1,6 @@
1
1
  import {MetaModel} from "./MetaModel.js";
2
2
  import {MetaObject} from "./MetaObject.js";
3
3
  import {PropertySet} from "./PropertySet.js";
4
- import {math} from "../scene/math/math.js";
5
4
 
6
5
  /**
7
6
  * @desc Metadata corresponding to a {@link Scene}.
@@ -188,13 +187,14 @@ class MetaScene {
188
187
  if (metaModel.metaObjects) {
189
188
  for (let i = 0, len = metaModel.metaObjects.length; i < len; i++) {
190
189
  const metaObject = metaModel.metaObjects[i];
191
- const type = metaObject.type;
192
190
  const id = metaObject.id;
193
- if (metaObject.metaModels.length === 1&& metaObject.metaModels[0].id === metaModelId) { // MetaObject owned only by this model, delete
191
+ if (metaObject.metaModels.length === 1 && metaObject.metaModels[0].id === metaModelId) { // MetaObject owned only by this model, delete
194
192
  delete this.metaObjects[id];
195
193
  if (!metaObject.parent) {
196
194
  delete this.rootMetaObjects[id];
197
195
  }
196
+ } else {
197
+ metaObject.metaModels = metaObject.metaModels.filter(metaModel => metaModel.id !== metaModelId);
198
198
  }
199
199
  }
200
200
  }