@combeenation/3d-viewer 12.4.1-beta1 → 12.4.1-beta3
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/dist/lib-cjs/api/classes/viewer.js +14 -0
- package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
- package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +1 -3
- package/dist/lib-cjs/api/manager/gltfExportManager.js +1 -3
- package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
- 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/viewer.ts +18 -0
- package/src/api/manager/gltfExportManager.ts +1 -3
package/package.json
CHANGED
|
@@ -708,6 +708,24 @@ The inspector can only be used in development builds.`);
|
|
|
708
708
|
// register observers for tag manager
|
|
709
709
|
this.tagManager.registerNewObjectObservers(scene);
|
|
710
710
|
this.broadcastEvent(Event.SCENE_PROCESSING_END, scene);
|
|
711
|
+
|
|
712
|
+
// textures based CBN image assets are hard to analyse in the inspector, since the asset url is set as name
|
|
713
|
+
// with this functionality we try to find these CBN image assets and crop the name accordingly
|
|
714
|
+
scene.onNewTextureAddedObservable.add(async texture => {
|
|
715
|
+
// name is only available after the texture is "ready"
|
|
716
|
+
// since there is no "wait for texture ready" functionality we can use it on scene level
|
|
717
|
+
await scene.whenReadyAsync();
|
|
718
|
+
|
|
719
|
+
const cbnServerString = 'https://cbnpeuwstassets.blob.core.windows.net/public/';
|
|
720
|
+
const textureQueryString = '?name=Textures3d/';
|
|
721
|
+
const isFromCbnServer = texture.name.startsWith(cbnServerString);
|
|
722
|
+
const indexOfTextureQueryParam = texture.name.lastIndexOf(textureQueryString);
|
|
723
|
+
|
|
724
|
+
if (isFromCbnServer && indexOfTextureQueryParam > -1) {
|
|
725
|
+
texture.name = texture.name.substring(indexOfTextureQueryParam + textureQueryString.length);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
|
|
711
729
|
return scene;
|
|
712
730
|
}
|
|
713
731
|
|
|
@@ -11,6 +11,7 @@ import { InstancedMesh } from '@babylonjs/core/Meshes/instancedMesh';
|
|
|
11
11
|
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
12
12
|
import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
|
|
13
13
|
import { Node as BjsNode } from '@babylonjs/core/node';
|
|
14
|
+
import '@babylonjs/serializers/glTF/2.0/Extensions/KHR_texture_transform';
|
|
14
15
|
import { GLTF2Export } from '@babylonjs/serializers/glTF/2.0/glTFSerializer';
|
|
15
16
|
|
|
16
17
|
export class GltfExportManager {
|
|
@@ -299,9 +300,6 @@ export class GltfExportManager {
|
|
|
299
300
|
* - Render target textures: Disposing the clone will leave the scene in a "not ready" state
|
|
300
301
|
* => this scenario is not fully analyzed yet, but it's not really worth the effort right now, since this kind of
|
|
301
302
|
* of texture is not really used ATM
|
|
302
|
-
*
|
|
303
|
-
* dynamic textures (paintables) or render
|
|
304
|
-
* target textures, as there are speci
|
|
305
303
|
*/
|
|
306
304
|
protected static _exchangeMaterial(material: Material) {
|
|
307
305
|
const baseTextures = material.getActiveTextures();
|