babylonjs.serializers.min.js 18 KB

1
  1. var globalObject="undefined"!=typeof global?global:"undefined"!=typeof window?window:this,babylonDependency=globalObject&&globalObject.BABYLON||BABYLON||"undefined"!=typeof require&&require("babylonjs"),BABYLON=babylonDependency,__decorate=this&&this.__decorate||function(e,t,r,i){var s,a=arguments.length,n=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a<3?s(n):a>3?s(t,r,n):s(t,r))||n);return a>3&&n&&Object.defineProperty(t,r,n),n},__extends=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}})(),BABYLON;!(function(e){var t=(function(){function t(){}return t.OBJ=function(t,r,i,s){var a=[],n=1;r&&(i||(i="mat"),a.push("mtllib "+i+".mtl"));for(var o=0;o<t.length;o++){a.push("g object"+o),a.push("o object_"+o);var u=null;if(s){var l=e.Matrix.Translation(t[o].position.x,t[o].position.y,t[o].position.z);u=e.Matrix.Translation(-t[o].position.x,-t[o].position.y,-t[o].position.z),t[o].bakeTransformIntoVertices(l)}if(r){var h=t[o].material;h&&a.push("usemtl "+h.id)}var c=t[o].geometry;if(c){var f=c.getVerticesData("position"),p=c.getVerticesData("normal"),d=c.getVerticesData("uv"),g=c.getIndices(),m=0;if(f&&p&&d&&g){for(var v=0;v<f.length;v+=3)a.push("v "+f[v]+" "+f[v+1]+" "+f[v+2]),m++;for(v=0;v<p.length;v+=3)a.push("vn "+p[v]+" "+p[v+1]+" "+p[v+2]);for(v=0;v<d.length;v+=2)a.push("vt "+d[v]+" "+d[v+1]);for(v=0;v<g.length;v+=3)a.push("f "+(g[v+2]+n)+"/"+(g[v+2]+n)+"/"+(g[v+2]+n)+" "+(g[v+1]+n)+"/"+(g[v+1]+n)+"/"+(g[v+1]+n)+" "+(g[v]+n)+"/"+(g[v]+n)+"/"+(g[v]+n));s&&u&&t[o].bakeTransformIntoVertices(u),n+=m}}}return a.join("\n")},t.MTL=function(e){var t=[],r=e.material;t.push("newmtl mat1"),t.push(" Ns "+r.specularPower.toFixed(4)),t.push(" Ni 1.5000"),t.push(" d "+r.alpha.toFixed(4)),t.push(" Tr 0.0000"),t.push(" Tf 1.0000 1.0000 1.0000"),t.push(" illum 2"),t.push(" Ka "+r.ambientColor.r.toFixed(4)+" "+r.ambientColor.g.toFixed(4)+" "+r.ambientColor.b.toFixed(4)),t.push(" Kd "+r.diffuseColor.r.toFixed(4)+" "+r.diffuseColor.g.toFixed(4)+" "+r.diffuseColor.b.toFixed(4)),t.push(" Ks "+r.specularColor.r.toFixed(4)+" "+r.specularColor.g.toFixed(4)+" "+r.specularColor.b.toFixed(4)),t.push(" Ke "+r.emissiveColor.r.toFixed(4)+" "+r.emissiveColor.g.toFixed(4)+" "+r.emissiveColor.b.toFixed(4));return r.ambientTexture&&t.push(" map_Ka "+r.ambientTexture.name),r.diffuseTexture&&t.push(" map_Kd "+r.diffuseTexture.name),r.specularTexture&&t.push(" map_Ks "+r.specularTexture.name),r.bumpTexture&&t.push(" map_bump -imfchan z "+r.bumpTexture.name),r.opacityTexture&&t.push(" map_d "+r.opacityTexture.name),t.join("\n")},t})();e.OBJExport=t})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){var t=(function(){function t(){}return t.GLTF=function(t,r,i){var s=r.replace(/\.[^\/.]+$/,""),a=new e._GLTF2Exporter(t,i);if(t.isReady)return a._generateGLTF(s);throw new Error("glTF Serializer: Scene is not ready!")},t.GLB=function(t,r,i){var s=r.replace(/\.[^\/.]+$/,""),a=new e._GLTF2Exporter(t,i);if(t.isReady)return a._generateGLB(s);throw new Error("glTF Serializer: Scene is not ready!")},t})();e.GLTF2Export=t})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){var t;!(function(e){e.PNG="image/png",e.JPG="image/jpeg"})(t||(t={}));var r;!(function(e){e.OPAQUE="OPAQUE",e.MASK="MASK",e.BLEND="BLEND"})(r=e._EGLTFAlphaModeEnum||(e._EGLTFAlphaModeEnum={}));var i=(function(){function i(e,t){this.asset={generator:"BabylonJS",version:"2.0"},this.babylonScene=e,this.bufferViews=new Array,this.accessors=new Array,this.meshes=new Array,this.scenes=new Array,this.nodes=new Array,this.images=new Array,this.materials=new Array,this.imageData={},void 0!==t&&(this.options=t);var r=0;r=this.createScene(this.babylonScene,r),this.totalByteLength=r}return i.prototype.createBufferView=function(e,t,r,i){var s={buffer:e,byteLength:r};return t>0&&(s.byteOffset=t),i&&(s.name=i),s},i.prototype.createAccessor=function(e,t,r,i,s,a,n){var o={name:t,bufferView:e,componentType:i,count:s,type:r};return a&&(o.min=a),n&&(o.max=n),o},i.prototype.calculateMinMax=function(e,t,r,i,s){var a=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0],o=t+r;if(r>0)for(var u=t;u<o;++u)for(var l=s*u,h=0;h<s;++h)e[l]<a[h]&&(a[h]=e[l]),e[l]>n[h]&&(n[h]=e[l]),++l;return{min:a,max:n}},i.prototype.writeAttributeData=function(t,r,i,s,a,n,o){var u=a,l=r.verticesStart+r.verticesCount,h=0;switch(t){case e.VertexBuffer.PositionKind:case e.VertexBuffer.NormalKind:for(var c=r.verticesStart;c<l;++c){var f=c*s;n.setFloat32(u,i[f],!0),u+=4,n.setFloat32(u,i[f+1],!0),u+=4,o?n.setFloat32(u,i[f+2],!0):n.setFloat32(u,-i[f+2],!0),u+=4}h=12*r.verticesCount;break;case e.VertexBuffer.TangentKind:for(var c=r.indexStart;c<l;++c){var f=c*s;n.setFloat32(u,i[f],!0),u+=4,n.setFloat32(u,i[f+1],!0),u+=4,o?n.setFloat32(u,i[f+2],!0):n.setFloat32(u,-i[f+2],!0),u+=4,n.setFloat32(u,i[f+3],!0),u+=4}h=16*r.verticesCount;break;case e.VertexBuffer.ColorKind:for(var c=r.verticesStart;c<l;++c){var f=c*s;n.setFloat32(u,i[f],!0),u+=4,n.setFloat32(u,i[f+1],!0),u+=4,n.setFloat32(u,i[f+2],!0),u+=4,n.setFloat32(u,i[f+3],!0),u+=4}h=16*r.verticesCount;break;case e.VertexBuffer.UVKind:case e.VertexBuffer.UV2Kind:for(var c=r.verticesStart;c<l;++c){var f=c*s;n.setFloat32(u,i[f],!0),u+=4,n.setFloat32(u,i[f+1],!0),u+=4}h=8*r.verticesCount;break;default:throw new Error("Unsupported vertex buffer type: "+t)}return h},i.prototype.generateJSON=function(e,t,r){var i={byteLength:this.totalByteLength},s={asset:this.asset};if(i.byteLength>0&&(s.buffers=[i]),this.nodes&&0!==this.nodes.length&&(s.nodes=this.nodes),this.meshes&&0!==this.meshes.length&&(s.meshes=this.meshes),this.scenes&&0!==this.scenes.length&&(s.scenes=this.scenes,s.scene=0),this.bufferViews&&0!==this.bufferViews.length&&(s.bufferViews=this.bufferViews),this.accessors&&0!==this.accessors.length&&(s.accessors=this.accessors),this.materials&&0!==this.materials.length&&(s.materials=this.materials),this.textures&&0!==this.textures.length&&(s.textures=this.textures),this.images&&0!==this.images.length)if(e){s.images=[];for(var a=this.images.length,n=this.totalByteLength,o=0;o<a;++o){var u=this.images[o];if(void 0!==u.uri){var l=this.imageData[u.uri],h=u.uri.split(".")[0]+" image",c=this.createBufferView(0,n,l.data.length,h);n+=l.data.buffer.byteLength,this.bufferViews.push(c),u.bufferView=this.bufferViews.length-1,u.name=h,u.mimeType=l.mimeType,u.uri=void 0,s.images.push(u)}}i.byteLength=n}else s.images=this.images;return e||(i.uri=t+".bin"),r?JSON.stringify(s,null,2):JSON.stringify(s)},i.prototype._generateGLTF=function(t){var r=this.generateJSON(!1,t,!0),i=this.generateBinary(),s=new Blob([i],{type:"application/octet-stream"}),a=t+".gltf",n=t+".bin",o=new e._GLTFData;if(o.glTFFiles[a]=r,o.glTFFiles[n]=s,null!==this.imageData)for(var u in this.imageData)o.glTFFiles[u]=new Blob([this.imageData[u].data],{type:this.imageData[u].mimeType});return o},i.prototype.generateBinary=function(){var e=0,t=new ArrayBuffer(this.totalByteLength),r=new DataView(t);return e=this.createScene(this.babylonScene,e,r),t},i.prototype._getPadding=function(e){var t=e%4;return 0===t?t:4-t},i.prototype._generateGLB=function(t){var r=this.generateJSON(!0),i=this.generateBinary(),s=t+".glb",a=r.length,n=0;for(var o in this.imageData)n+=this.imageData[o].data.byteLength;var u=this._getPadding(a),l=this._getPadding(i.byteLength),h=28+a+u+i.byteLength+l+n,c=new ArrayBuffer(12),f=new DataView(c);f.setUint32(0,1179937895,!0),f.setUint32(4,2,!0),f.setUint32(8,h,!0);var p=new ArrayBuffer(8+a+u),d=new DataView(p);d.setUint32(0,a+u,!0),d.setUint32(4,1313821514,!0);for(var g=new Uint8Array(p,8),m=0;m<a;++m)g[m]=r.charCodeAt(m);for(var v=new Uint8Array(p,8+a),m=0;m<u;++m)v[m]=32;var b=new ArrayBuffer(8),x=new DataView(b);x.setUint32(0,i.byteLength+n,!0),x.setUint32(4,5130562,!0);for(var B=new ArrayBuffer(l),y=new Uint8Array(B),m=0;m<l;++m)y[m]=0;var T=[c,p,b,i];for(var o in this.imageData)T.push(this.imageData[o].data.buffer);T.push(B);var w=new Blob(T,{type:"application/octet-stream"}),A=new e._GLTFData;return A.glTFFiles[s]=w,A},i.prototype.setNodeTransformation=function(t,r,i){0===r.position.x&&0===r.position.y&&0===r.position.z||(t.translation=i?r.position.asArray():[r.position.x,r.position.y,-r.position.z]),1===r.scaling.x&&1===r.scaling.y&&1===r.scaling.z||(t.scale=i?r.scaling.asArray():[r.scaling.x,r.scaling.y,-r.scaling.z]);var s=e.Quaternion.RotationYawPitchRoll(r.rotation.y,r.rotation.x,r.rotation.z);r.rotationQuaternion&&(s=s.multiply(r.rotationQuaternion)),0===s.x&&0===s.y&&0===s.z&&1===s.w||(t.rotation=i?s.asArray():[-s.x,-s.y,s.z,s.w])},i.prototype.exportTexture=function(e,r){void 0===r&&(r=t.JPG);var i,s=null;i={source:this.images.length};var a=e.getInternalTexture().url;if(-1!==a.search("/")){var n=a.split("/");a=n[n.length-1];var o=a.split(".")[0],u=a.split(".")[1];if(r===t.JPG)u=".jpg";else{if(r!==t.PNG)throw new Error("Unsupported mime type "+r);u=".png"}a=o+u}var l=e.readPixels(),h=document.createElement("canvas");h.id="ImageCanvas";var c=h.getContext("2d"),f=e.getSize();h.width=f.width,h.height=f.height;var p=c.createImageData(f.width,f.height);p.data.set(l),c.putImageData(p,0,0);for(var d=h.toDataURL(r),g=atob(d.split(",")[1]),m=new Uint8Array(g.length),v=0;v<g.length;++v)m[v]=g.charCodeAt(v);var b={data:m,mimeType:r};if(this.imageData[a]=b,r===t.JPG){for(var x={uri:a},B=-1,v=0;v<this.images.length;++v)if(this.images[v].uri===a){B=v;break}-1===B?(this.images.push(x),i.source=this.images.length-1,this.textures.push({source:this.images.length-1}),s={index:this.images.length-1}):(i.source=B,s={index:B})}return s},i.prototype.setPrimitiveAttributes=function(t,i,s,a,n){for(var o=0;o<i.subMeshes.length;++o){var u=null,l=i.subMeshes[o],h={attributes:{}};if(i instanceof e.Mesh?u=i:i instanceof e.InstancedMesh&&(u=i.sourceMesh),u.isVerticesDataPresent(e.VertexBuffer.PositionKind)){var c=u.getVertexBuffer(e.VertexBuffer.PositionKind),f=c.getOffset(),p=c.getData(),d=c.getStrideSize();if(n)s+=this.writeAttributeData(e.VertexBuffer.PositionKind,l,p,d,s,n,a);else{var g=12*l.verticesCount,m=this.createBufferView(0,s,g,"Positions");s+=g,this.bufferViews.push(m);var v=this.calculateMinMax(p,l.verticesStart,l.verticesCount,f,d),b=this.createAccessor(this.bufferViews.length-1,"Position","VEC3",5126,l.verticesCount,v.min,v.max);this.accessors.push(b),h.attributes.POSITION=this.accessors.length-1}}if(u.isVerticesDataPresent(e.VertexBuffer.NormalKind)){var x=u.getVertexBuffer(e.VertexBuffer.NormalKind),B=x.getData(),y=x.getStrideSize();if(n)s+=this.writeAttributeData(e.VertexBuffer.NormalKind,l,B,y,s,n,a);else{var g=12*l.verticesCount,m=this.createBufferView(0,s,g,"Normals");s+=g,this.bufferViews.push(m);var b=this.createAccessor(this.bufferViews.length-1,"Normal","VEC3",5126,l.verticesCount);this.accessors.push(b),h.attributes.NORMAL=this.accessors.length-1}}if(u.isVerticesDataPresent(e.VertexBuffer.TangentKind)){var T=u.getVertexBuffer(e.VertexBuffer.TangentKind),w=T.getData(),A=T.getStrideSize();if(n)s+=this.writeAttributeData(e.VertexBuffer.TangentKind,l,w,A,s,n,a);else{var g=16*l.verticesCount,m=this.createBufferView(0,s,g,"Tangents");s+=g,this.bufferViews.push(m);var b=this.createAccessor(this.bufferViews.length-1,"Tangent","VEC4",5126,l.verticesCount);this.accessors.push(b),h.attributes.TANGENT=this.accessors.length-1}}if(u.isVerticesDataPresent(e.VertexBuffer.ColorKind)){var V=u.getVertexBuffer(e.VertexBuffer.ColorKind),C=V.getData(),L=V.getStrideSize();if(n)s+=this.writeAttributeData(e.VertexBuffer.ColorKind,l,C,L,s,n,a);else{var g=16*l.verticesCount,m=this.createBufferView(0,s,g,"Colors");s+=g,this.bufferViews.push(m);var b=this.createAccessor(this.bufferViews.length-1,"Color","VEC4",5126,l.verticesCount);this.accessors.push(b),h.attributes.COLOR_0=this.accessors.length-1}}if(u.isVerticesDataPresent(e.VertexBuffer.UVKind)){var F=u.getVertexBuffer(e.VertexBuffer.UVKind),S=F.getData(),E=F.getStrideSize();if(n)s+=this.writeAttributeData(e.VertexBuffer.UVKind,l,S,E,s,n,a);else{var g=8*l.verticesCount,m=this.createBufferView(0,s,g,"Texture Coords0");s+=g,this.bufferViews.push(m);var b=this.createAccessor(this.bufferViews.length-1,"Texture Coords","VEC2",5126,l.verticesCount);this.accessors.push(b),h.attributes.TEXCOORD_0=this.accessors.length-1}}if(u.isVerticesDataPresent(e.VertexBuffer.UV2Kind)){var M=u.getVertexBuffer(e.VertexBuffer.UV2Kind),O=M.getData(),D=M.getStrideSize();if(n)s+=this.writeAttributeData(e.VertexBuffer.UV2Kind,l,O,D,s,n,a);else{var g=8*l.verticesCount,m=this.createBufferView(0,s,g,"Texture Coords 1");s+=g,this.bufferViews.push(m);var b=this.createAccessor(this.bufferViews.length-1,"Texture Coords","VEC2",5126,l.verticesCount);this.accessors.push(b),h.attributes.TEXCOORD_1=this.accessors.length-1}}if(u.getTotalIndices()>0)if(n){for(var P=u.getIndices(),_=l.indexStart,N=l.indexCount+_,R=s,U=_;U<N;U+=3)n.setUint32(R,P[U],!0),R+=4,n.setUint32(R,P[U+1],!0),R+=4,n.setUint32(R,P[U+2],!0),R+=4;var g=4*l.indexCount;s+=g}else{var G=l.indexCount,g=4*G,m=this.createBufferView(0,s,g,"Indices");s+=g,this.bufferViews.push(m);var b=this.createAccessor(this.bufferViews.length-1,"Indices","SCALAR",5125,G);this.accessors.push(b),h.indices=this.accessors.length-1}if(u.material)if(u.material instanceof e.StandardMaterial){var K=u.material,Y={name:K.name};if(K.backFaceCulling||(Y.doubleSided=!0),K.bumpTexture){var z=this.exportTexture(K.bumpTexture);z&&(Y.normalTexture=z)}if(K.emissiveTexture){var j=this.exportTexture(K.emissiveTexture);j&&(Y.emissiveTexture=j),Y.emissiveFactor=[1,1,1]}if(K.ambientTexture){var I=this.exportTexture(K.ambientTexture);I&&(Y.occlusionTexture=I)}var J={diffuse:K.diffuseColor,opacity:K.alpha,specular:K.specularColor||e.Color3.Black(),glossiness:K.specularPower/256};K.specularTexture;var k=e._GLTFMaterial.ConvertToMetallicRoughness(J),Q={baseColorFactor:[k.baseColor.r,k.baseColor.g,k.baseColor.b,k.opacity],metallicFactor:k.metallic,roughnessFactor:k.roughness};Y.pbrMetallicRoughness=Q,this.materials.push(Y),h.material=this.materials.length-1}else if(u.material instanceof e.PBRMetallicRoughnessMaterial){this.textures||(this.textures=new Array);var q=u.material,Q={};if(q.baseColor&&(Q.baseColorFactor=[q.baseColor.r,q.baseColor.g,q.baseColor.b,q.alpha]),void 0!==q.baseTexture){var z=this.exportTexture(q.baseTexture);null!==z&&(Q.baseColorTexture=z),Q.baseColorTexture}void 0!==q.metallic&&(Q.metallicFactor=q.metallic),void 0!==q.roughness&&(Q.roughnessFactor=q.roughness);var Y={name:q.name};if(q.doubleSided&&(Y.doubleSided=q.doubleSided),q.normalTexture){var z=this.exportTexture(q.normalTexture);z&&(Y.normalTexture=z)}if(q.occlusionTexture){var z=this.exportTexture(q.occlusionTexture);z&&(Y.occlusionTexture=z,void 0!==q.occlusionStrength&&(Y.occlusionTexture.strength=q.occlusionStrength))}if(q.emissiveTexture){var z=this.exportTexture(q.emissiveTexture);null!==z&&(Y.emissiveTexture=z)}if(q.emissiveColor.equals(new e.Color3(0,0,0))||(Y.emissiveFactor=q.emissiveColor.asArray()),q.transparencyMode){var H=e._GLTFMaterial.GetAlphaMode(q);H!==r.OPAQUE&&(Y.alphaMode=H,H===r.BLEND&&(Y.alphaCutoff=q.alphaCutOff))}Y.pbrMetallicRoughness=Q,this.materials.push(Y),h.material=this.materials.length-1}t.primitives.push(h)}return s},i.prototype.createScene=function(e,t,r){if(e.meshes.length>0){for(var i=e.meshes,s={nodes:new Array},a=0;a<i.length;++a)if(!this.options||void 0===this.options.shouldExportMesh||this.options.shouldExportMesh(i[a])){var n={mesh:-1},o=i[a],u=o.getScene().useRightHandedSystem;this.setNodeTransformation(n,o,u);var l={primitives:new Array};l.primitives=[],t=this.setPrimitiveAttributes(l,o,t,u,r),this.meshes.push(l),n.mesh=this.meshes.length-1,o.name&&(n.name=o.name),this.nodes.push(n),s.nodes.push(this.nodes.length-1)}this.scenes.push(s)}return t},i})();e._GLTF2Exporter=i})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){var t=(function(){function e(){this.glTFFiles={}}return e.prototype.downloadFiles=function(){function e(e,t){return-1!==e.indexOf(t,e.length-t.length)}for(var t in this.glTFFiles){var r=document.createElement("a");document.body.appendChild(r),r.setAttribute("type","hidden"),r.download=t;var i=this.glTFFiles[t],s=void 0;e(t,".glb")?s={type:"model/gltf-binary"}:e(t,".bin")?s={type:"application/octet-stream"}:e(t,".gltf")&&(s={type:"model/gltf+json"}),r.href=window.URL.createObjectURL(new Blob([i],s)),r.click()}},e})();e._GLTFData=t})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){var t=(function(){function t(){}return t.ConvertToMetallicRoughness=function(r){var i=r.diffuse,s=r.opacity,a=r.specular,n=r.glossiness,o=1-Math.max(a.r,Math.max(a.g,a.b)),u=t.PerceivedBrightness(i),l=t.PerceivedBrightness(a),h=t.SolveMetallic(u,l,o),c=o/(1-this.dielectricSpecular.r)/Math.max(1-h,this.epsilon),f=i.scale(c),p=a.subtract(this.dielectricSpecular.scale(1-h)).scale(1/Math.max(h,this.epsilon)),d=e.Color3.Lerp(f,p,h*h),g=new e.Color3;return d.clampToRef(0,1,g),{baseColor:g,opacity:s,metallic:h,roughness:1-n}},t.PerceivedBrightness=function(e){return Math.sqrt(.299*e.r*e.r+.587*e.g*e.g+.114*e.b*e.b)},t.SolveMetallic=function(t,r,i){if(r<this.dielectricSpecular.r)return 0;var s=this.dielectricSpecular.r,a=t*i/(1-this.dielectricSpecular.r)+r-2*this.dielectricSpecular.r,n=this.dielectricSpecular.r-r,o=a*a-4*s*n;return e.Scalar.Clamp((-a+Math.sqrt(o))/(2*s))},t.GetAlphaMode=function(t){if(t instanceof e.StandardMaterial){var r=t;return 1!=r.alpha||null!=r.diffuseTexture&&r.diffuseTexture.hasAlpha||null!=r.opacityTexture?e._EGLTFAlphaModeEnum.BLEND:e._EGLTFAlphaModeEnum.OPAQUE}if(!(t instanceof e.PBRMetallicRoughnessMaterial))throw new Error("Unsupported Babylon material type");var i=t;switch(i.transparencyMode){case e.PBRMaterial.PBRMATERIAL_OPAQUE:return e._EGLTFAlphaModeEnum.OPAQUE;case e.PBRMaterial.PBRMATERIAL_ALPHABLEND:return e._EGLTFAlphaModeEnum.BLEND;case e.PBRMaterial.PBRMATERIAL_ALPHATEST:return e._EGLTFAlphaModeEnum.MASK;case e.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND:return console.warn("GLTF Exporter | Alpha test and blend mode not supported in glTF. Alpha blend used instead."),e._EGLTFAlphaModeEnum.BLEND;default:throw new Error("Unsupported alpha mode "+i.transparencyMode)}},t.dielectricSpecular=new e.Color3(.04,.04,.04),t.epsilon=1e-6,t})();e._GLTFMaterial=t})(BABYLON||(BABYLON={})),(function(e,t){var r=t();e&&e.BABYLON||("object"==typeof exports&&"object"==typeof module?module.exports=r:"function"==typeof define&&define.amd?define(["BJSSerializers"],t):"object"==typeof exports?exports.BJSSerializers=r:e.BABYLON=r)})(this,(function(){return BABYLON}));