@combeenation/3d-viewer 12.1.1 → 12.1.2

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": "12.1.1",
3
+ "version": "12.1.2",
4
4
  "description": "Combeenation 3D Viewer",
5
5
  "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
6
  "bugs": {
@@ -34,6 +34,7 @@ import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial';
34
34
  import { Material } from '@babylonjs/core/Materials/material';
35
35
  import { Color3 } from '@babylonjs/core/Maths/math.color';
36
36
  import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
37
+ import { InstancedMesh } from '@babylonjs/core/Meshes/instancedMesh';
37
38
  import { Mesh } from '@babylonjs/core/Meshes/mesh';
38
39
  import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
39
40
  import { Tags } from '@babylonjs/core/Misc/tags';
@@ -78,7 +79,7 @@ export class Element extends VariantParameterizable {
78
79
  // this can only be done after the cloning process of the whole tree is finished, as we can't be sure if all
79
80
  // instanced meshes or all sources meshes are cloning prior
80
81
  const reassignSourceMesh = (node: TransformNode) => {
81
- if (node.constructor.name === 'InstancedMesh') {
82
+ if (node instanceof InstancedMesh) {
82
83
  // find the cloned instance and source mesh
83
84
  const clonedInstance = node as InstancedMesh;
84
85
  const originalInstance = clonedInstance.metadata.cloneSource as InstancedMesh;
@@ -114,7 +114,7 @@ const cloneTransformNode = function (
114
114
  // if the cloned node is of type InstancedMesh, due to a bug(?),
115
115
  // the InstancedMesh.isEnabled state may have changed after cloning.
116
116
  // in that case, set the clone's enabled state to the original's state
117
- if (node.constructor.name === 'InstancedMesh') {
117
+ if (node instanceof InstancedMesh) {
118
118
  clone.setEnabled(node.isEnabled(false));
119
119
 
120
120
  // tags are not cloned for instanced meshes by default