Pārlūkot izejas kodu

3dsmax exporter: Fixing issue with mesh with no material

David Catuhe 10 gadi atpakaļ
vecāks
revīzija
75d4ec2500

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


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

@@ -233,12 +233,7 @@ namespace Max2Babylon
 
                 for (int i = 0; i < multiMatsCount; ++i)
                 {
-                    if (meshNode.NodeMaterial == null)
-                    {
-                        continue;
-                    }
-
-                    int materialId = meshNode.NodeMaterial.GetMaterialID(i);
+                    int materialId = meshNode.NodeMaterial == null ? 0 : meshNode.NodeMaterial.GetMaterialID(i);
                     var indexCount = 0;
                     var minVertexIndex = int.MaxValue;
                     var maxVertexIndex = int.MinValue;