Sfoglia il codice sorgente

Merge pull request #4911 from kcoley/glTFSerializerFixTextureName

glTFSerializer: remove dots and slashes from texture names
sebavan 7 anni fa
parent
commit
2efdba9c8a

+ 1 - 1
serializers/src/glTF/2.0/babylon.glTFMaterialExporter.ts

@@ -1172,7 +1172,7 @@ module BABYLON.GLTF2 {
                     const size = babylonTexture.getSize();
 
                     return this._createBase64FromCanvasAsync(pixels, size.width, size.height, mimeType).then(base64Data => {
-                        const textureInfo = this._getTextureInfoFromBase64(base64Data, babylonTexture.name, mimeType, babylonTexture.coordinatesIndex, samplerIndex);
+                        const textureInfo = this._getTextureInfoFromBase64(base64Data, babylonTexture.name.replace(/\.\/|\/|\.\\|\\/g , "_"), mimeType, babylonTexture.coordinatesIndex, samplerIndex);
                         if (textureInfo) {
                             this._textureMap[textureUid] = textureInfo;
                         }