@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/README.md +1 -1
- package/dist/lib-cjs/api/classes/event.d.ts +1 -1
- package/dist/lib-cjs/api/classes/event.js +1 -1
- package/dist/lib-cjs/api/classes/viewer.d.ts +4 -3
- package/dist/lib-cjs/api/classes/viewer.js +4 -3
- package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
- package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +2 -1
- package/dist/lib-cjs/api/manager/variantInstanceManager.js +2 -1
- package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +1 -1
- package/dist/lib-cjs/api/util/babylonHelper.js +5 -0
- package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/globalTypes.d.ts +4 -0
- package/dist/lib-cjs/buildinfo.json +1 -1
- package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/api/classes/event.ts +1 -1
- package/src/api/classes/viewer.ts +5 -4
- package/src/api/manager/variantInstanceManager.ts +2 -1
- package/src/api/util/babylonHelper.ts +5 -0
- package/src/api/util/globalTypes.ts +4 -0
package/package.json
CHANGED
package/src/api/classes/event.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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);
|