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

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-beta4",
3
+ "version": "12.4.1",
4
4
  "description": "Combeenation 3D Viewer",
5
5
  "homepage": "https://github.com/Combeenation/3d-viewer#readme",
6
6
  "bugs": {
@@ -701,29 +701,6 @@ The inspector can only be used in development builds.`);
701
701
  };
702
702
  }
703
703
 
704
- // textures based CBN image assets are hard to analyse in the inspector, since the asset url is set as name
705
- // with this functionality we try to find these CBN image assets and crop the name accordingly
706
- scene.onNewTextureAddedObservable.add(async texture => {
707
- // name is only available after the texture is "ready"
708
- // since there is no "wait for texture ready" functionality we can use it on scene level
709
- await scene.whenReadyAsync();
710
-
711
- const cbnServerString = 'https://cbnpeuwstassets.blob.core.windows.net/public/';
712
- const textureQueryString = '?name=';
713
- const texture3dFolderString = 'Textures3d/';
714
- const isFromCbnServer = texture.name.startsWith(cbnServerString);
715
- const indexOfTextureQueryParam = texture.name.lastIndexOf(textureQueryString);
716
-
717
- if (isFromCbnServer && indexOfTextureQueryParam > -1) {
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}`;
724
- }
725
- });
726
-
727
704
  this._sceneManager = await SceneManager.create(scene);
728
705
  this._animationManager = await AnimationManager.create(scene);
729
706
  if (sceneJson.cloneMaterialsOnMutation !== undefined) {
@@ -80,6 +80,17 @@ export class TextureLoadManager extends EventBroadcaster {
80
80
  // More details: https://forum.babylonjs.com/t/basetexture-whenallready-returns-too-early/34501/4
81
81
  await sleep(0);
82
82
 
83
+ // textures based CBN image assets are hard to analyse in the inspector, since the asset url is set as name
84
+ // with this functionality we try to find these CBN image assets and crop the name accordingly
85
+ // => see CB-9558
86
+ const isUrl = texture.name.startsWith('https://');
87
+ const textureQueryString = '?name=';
88
+ const indexOfTextureQueryParam = texture.name.lastIndexOf(textureQueryString);
89
+
90
+ if (isUrl && indexOfTextureQueryParam > -1) {
91
+ texture.name = texture.name.substring(indexOfTextureQueryParam + textureQueryString.length);
92
+ }
93
+
83
94
  // Some textures are already in "ready state" after the sleep -> We don't care for them anymore as well as for
84
95
  // textures which don't come with an `onLoadObservable` (i.e. not of class {@link Texture}) or do not have an URL to
85
96
  // load (i.e. RawTexture2DArray texture type for morph target data storage).