Przeglądaj źródła

Merge pull request #1551 from julien-moreau/master

Fixing mesh and vertex data serialization
David Catuhe 8 lat temu
rodzic
commit
c99a0fb24e

+ 5 - 5
src/Mesh/babylon.geometry.ts

@@ -594,23 +594,23 @@
             }
 
             if (this.isVerticesDataPresent(VertexBuffer.UV2Kind)) {
-                serializationObject.uvs2 = this.getVerticesData(VertexBuffer.UV2Kind);
+                serializationObject.uv2s = this.getVerticesData(VertexBuffer.UV2Kind);
             }
 
             if (this.isVerticesDataPresent(VertexBuffer.UV3Kind)) {
-                serializationObject.uvs3 = this.getVerticesData(VertexBuffer.UV3Kind);
+                serializationObject.uv3s = this.getVerticesData(VertexBuffer.UV3Kind);
             }
 
             if (this.isVerticesDataPresent(VertexBuffer.UV4Kind)) {
-                serializationObject.uvs4 = this.getVerticesData(VertexBuffer.UV4Kind);
+                serializationObject.uv4s = this.getVerticesData(VertexBuffer.UV4Kind);
             }
 
             if (this.isVerticesDataPresent(VertexBuffer.UV5Kind)) {
-                serializationObject.uvs5 = this.getVerticesData(VertexBuffer.UV5Kind);
+                serializationObject.uv5s = this.getVerticesData(VertexBuffer.UV5Kind);
             }
 
             if (this.isVerticesDataPresent(VertexBuffer.UV6Kind)) {
-                serializationObject.uvs6 = this.getVerticesData(VertexBuffer.UV6Kind);
+                serializationObject.uv6s = this.getVerticesData(VertexBuffer.UV6Kind);
             }
 
             if (this.isVerticesDataPresent(VertexBuffer.ColorKind)) {

+ 8 - 0
src/Tools/babylon.sceneSerializer.ts

@@ -159,6 +159,14 @@
         // Layer mask
         serializationObject.layerMask = mesh.layerMask;
 
+        // Alpha
+        serializationObject.alphaIndex = mesh.alphaIndex;
+        serializationObject.hasVertexAlpha = mesh.hasVertexAlpha;
+        serializationObject.overlayAlpha = mesh.overlayAlpha;
+
+        // Fog
+        serializationObject.applyFog = mesh.applyFog;
+
         // Action Manager
         if (mesh.actionManager) {
             serializationObject.actions = mesh.actionManager.serialize(mesh.name);