@combeenation/3d-viewer 12.4.1-beta2 → 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-beta2",
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,6 +700,30 @@ The inspector can only be used in development builds.`);
700
700
  }
701
701
  };
702
702
  }
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
+
703
727
  this._sceneManager = await SceneManager.create(scene);
704
728
  this._animationManager = await AnimationManager.create(scene);
705
729
  if (sceneJson.cloneMaterialsOnMutation !== undefined) {
@@ -708,6 +732,7 @@ The inspector can only be used in development builds.`);
708
732
  // register observers for tag manager
709
733
  this.tagManager.registerNewObjectObservers(scene);
710
734
  this.broadcastEvent(Event.SCENE_PROCESSING_END, scene);
735
+
711
736
  return scene;
712
737
  }
713
738
 
@@ -300,9 +300,6 @@ export class GltfExportManager {
300
300
  * - Render target textures: Disposing the clone will leave the scene in a "not ready" state
301
301
  * => this scenario is not fully analyzed yet, but it's not really worth the effort right now, since this kind of
302
302
  * of texture is not really used ATM
303
- *
304
- * dynamic textures (paintables) or render
305
- * target textures, as there are speci
306
303
  */
307
304
  protected static _exchangeMaterial(material: Material) {
308
305
  const baseTextures = material.getActiveTextures();