@combeenation/3d-viewer 7.0.0-beta2 → 7.0.0

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": "@combeenation/3d-viewer",
3
- "version": "7.0.0-beta2",
3
+ "version": "7.0.0",
4
4
  "description": "Combeenation 3D Viewer",
5
5
  "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
6
  "bugs": {
@@ -30,7 +30,7 @@ export const emitter = new EventEmitter();
30
30
  * viewer.on(Event.SCENE_PROCESSING_END, scene => {
31
31
  * scene.clearColor = new Color4(0, 0, 0, 0);
32
32
  * });
33
- * await viewer.bootstrap();
33
+ * await viewer.bootstrap([]);
34
34
  * ```
35
35
  */
36
36
  export class Event {
@@ -248,7 +248,8 @@ export class Viewer extends EventBroadcaster {
248
248
 
249
249
  /**
250
250
  * Sets the strategy handler for naming cloned nodes.\
251
- * Check the docs of the tag managers [renaming](https://3dviewer.docs.combeenation.com/pages/documentation/Tag-Manager.html#uniqueness-of-node-and-tag-names)
251
+ * Check the docs of the tag managers
252
+ * [renaming](./../pages/documentation/Tag-Manager.html#uniqueness-of-node-and-tag-names)
252
253
  * chapter for further details.
253
254
  */
254
255
  set nodeNamingStrategyHandler(value: NodeNamingStrategyHandler) {
@@ -270,7 +271,7 @@ export class Viewer extends EventBroadcaster {
270
271
  * @emits {@link Event.BOOTSTRAP_START}
271
272
  * @emits {@link Event.BOOTSTRAP_END}
272
273
  */
273
- public async bootstrap(tagManagerParameterValues?: TagManagerParameterValue[]): Promise<Viewer> {
274
+ public async bootstrap(tagManagerParameterValues: TagManagerParameterValue[]): Promise<Viewer> {
274
275
  this.broadcastEvent(Event.BOOTSTRAP_START, this);
275
276
  let indexJson;
276
277
  if (isString(this.structureJson)) {
@@ -565,9 +566,9 @@ export class Viewer extends EventBroadcaster {
565
566
  * Resets everything by calling {@link destroy} to clear all references and {@link bootstrap} to setup a clean
566
567
  * environment
567
568
  */
568
- public async reset(): Promise<Viewer> {
569
+ public async reset(tagManagerParameterValues: TagManagerParameterValue[]): Promise<Viewer> {
569
570
  await this.destroy();
570
- return this.bootstrap();
571
+ return this.bootstrap(tagManagerParameterValues);
571
572
  }
572
573
 
573
574
  /**
@@ -204,7 +204,8 @@ export class VariantInstanceManager extends EventBroadcaster {
204
204
  *
205
205
  * @param tagMapping Object for renaming tags on the clone, whereas the "key" is the tag name of orignal variant
206
206
  * instance and the "value" is the new tag name that should be created from it.\
207
- * Check the docs of the tag managers [renaming](https://3dviewer.docs.combeenation.com/pages/documentation/Tag-Manager.html#uniqueness-of-node-and-tag-names)
207
+ * Check the docs of the tag managers
208
+ * [renaming](./../pages/documentation/Tag-Manager.html#uniqueness-of-node-and-tag-names)
208
209
  * chapter for further details.
209
210
  *
210
211
  * @emits {@link Event.VARIANT_INSTANCE_CLONED}
@@ -110,6 +110,11 @@ const cloneTransformNode = function (
110
110
  if (node.constructor.name === 'InstancedMesh') {
111
111
  clone.setEnabled(node.isEnabled(false));
112
112
  }
113
+ // copying tags is a temporary workaround, as it doesn't work for TransformNodes ATM
114
+ // see https://forum.babylonjs.com/t/transformnode-clone-doesnt-contain-original-tags/38429/1
115
+ if (Tags?.HasTags(node)) {
116
+ Tags.AddTagsTo(clone, Tags.GetTags(node, true));
117
+ }
113
118
  }
114
119
  if (deep) {
115
120
  const children = node.getChildTransformNodes(true);
@@ -456,6 +456,10 @@ type SpecGenerationData = {
456
456
  url: string;
457
457
  };
458
458
 
459
+ /**
460
+ * Key = Old tag name\
461
+ * Value = New tag name
462
+ */
459
463
  type TagMapping = {
460
464
  [tagName: string]: string;
461
465
  };