Forráskód Böngészése

Small update to max2babylon exporter: adding includedOnlyMesh

David Catuhe 11 éve
szülő
commit
b799478878

+ 3 - 0
Exporters/3ds Max/BabylonExport.Entities/BabylonLight.cs

@@ -45,6 +45,9 @@ namespace BabylonExport.Entities
         public string[] excludedMeshesIds { get; set; }
 
         [DataMember]
+        public string[] includedOnlyMeshesIds { get; set; }
+
+        [DataMember]
         public bool autoAnimate { get; set; }
 
         [DataMember]

+ 3 - 0
Exporters/3ds Max/BabylonExport.Entities/BabylonShadowGenerator.cs

@@ -15,6 +15,9 @@ namespace BabylonExport.Entities
         public bool useVarianceShadowMap { get; set; }
 
         [DataMember]
+        public bool usePoissonSampling { get; set; }
+
+        [DataMember]
         public string[] renderList { get; set; }
 
     }

BIN
Exporters/3ds Max/Max2Babylon-0.7.6.zip


BIN
Exporters/3ds Max/Max2Babylon-0.7.7.zip


+ 13 - 4
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.Light.cs

@@ -104,7 +104,8 @@ namespace Max2Babylon
 
             if (checkExclusionList)
             {
-                var list = new List<string>();
+                var excllist = new List<string>();
+                var incllist = new List<string>();
 
                 foreach (var meshNode in maxScene.NodesListBySuperClass(SClass_ID.Geomobject))
                 {
@@ -112,14 +113,22 @@ namespace Max2Babylon
                     {
                         var inList = maxLight.ExclList.FindNode(meshNode) != -1;
 
-                        if ((!inList && inclusion) || (inList && !inclusion))
+                        if (inList)
                         {
-                            list.Add(meshNode.GetGuid().ToString());
+                            if (inclusion)
+                            {
+                                incllist.Add(meshNode.GetGuid().ToString());
+                            }
+                            else
+                            {
+                                excllist.Add(meshNode.GetGuid().ToString());
+                            }
                         }
                     }
                 }
 
-                babylonLight.excludedMeshesIds = list.ToArray();
+                babylonLight.includedOnlyMeshesIds = incllist.ToArray();
+                babylonLight.excludedMeshesIds = excllist.ToArray();
             }
 
             // Other fields

+ 1 - 1
Exporters/3ds Max/Max2Babylon/Exporter/BabylonExporter.cs

@@ -230,7 +230,7 @@ namespace Max2Babylon
             // Output
             RaiseMessage("Saving to output file");
             babylonScene.Prepare(false);
-            var jsonSerializer = JsonSerializer.Create();
+            var jsonSerializer = JsonSerializer.Create(new JsonSerializerSettings());
             var sb = new StringBuilder();
             var sw = new StringWriter(sb, CultureInfo.InvariantCulture);