@combeenation/3d-viewer 12.4.1-beta3 → 12.4.1-beta4

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.4.1-beta3",
3
+ "version": "12.4.1-beta4",
4
4
  "description": "Combeenation 3D Viewer",
5
5
  "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
6
  "bugs": {
@@ -700,14 +700,6 @@ The inspector can only be used in development builds.`);
700
700
  }
701
701
  };
702
702
  }
703
- this._sceneManager = await SceneManager.create(scene);
704
- this._animationManager = await AnimationManager.create(scene);
705
- if (sceneJson.cloneMaterialsOnMutation !== undefined) {
706
- this._cloneMaterialsOnMutation = sceneJson.cloneMaterialsOnMutation;
707
- }
708
- // register observers for tag manager
709
- this.tagManager.registerNewObjectObservers(scene);
710
- this.broadcastEvent(Event.SCENE_PROCESSING_END, scene);
711
703
 
712
704
  // textures based CBN image assets are hard to analyse in the inspector, since the asset url is set as name
713
705
  // with this functionality we try to find these CBN image assets and crop the name accordingly
@@ -717,15 +709,30 @@ The inspector can only be used in development builds.`);
717
709
  await scene.whenReadyAsync();
718
710
 
719
711
  const cbnServerString = 'https://cbnpeuwstassets.blob.core.windows.net/public/';
720
- const textureQueryString = '?name=Textures3d/';
712
+ const textureQueryString = '?name=';
713
+ const texture3dFolderString = 'Textures3d/';
721
714
  const isFromCbnServer = texture.name.startsWith(cbnServerString);
722
715
  const indexOfTextureQueryParam = texture.name.lastIndexOf(textureQueryString);
723
716
 
724
717
  if (isFromCbnServer && indexOfTextureQueryParam > -1) {
725
- texture.name = texture.name.substring(indexOfTextureQueryParam + textureQueryString.length);
718
+ let texturePath = texture.name.substring(indexOfTextureQueryParam + textureQueryString.length);
719
+ if (texturePath.startsWith(texture3dFolderString)) {
720
+ texturePath = texturePath.substring(texturePath.length - texture3dFolderString.length);
721
+ }
722
+
723
+ texture.name = `CBN asset: ${texturePath}`;
726
724
  }
727
725
  });
728
726
 
727
+ this._sceneManager = await SceneManager.create(scene);
728
+ this._animationManager = await AnimationManager.create(scene);
729
+ if (sceneJson.cloneMaterialsOnMutation !== undefined) {
730
+ this._cloneMaterialsOnMutation = sceneJson.cloneMaterialsOnMutation;
731
+ }
732
+ // register observers for tag manager
733
+ this.tagManager.registerNewObjectObservers(scene);
734
+ this.broadcastEvent(Event.SCENE_PROCESSING_END, scene);
735
+
729
736
  return scene;
730
737
  }
731
738