Bläddra i källkod

Fixing issue with DDS exportation in Max2Babylon

David Catuhe 11 år sedan
förälder
incheckning
c7ba2d0163

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


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

@@ -106,7 +106,10 @@ namespace Max2Babylon
                 if (File.Exists(texture.MapName))
                 {
                     File.Copy(texture.MapName, Path.Combine(babylonScene.OutputPath, babylonTexture.name), true);
-                    babylonTexture.isCube = Tools.IsTextureCube(texture.MapName);
+                    if (Path.GetExtension(texture.MapName).ToLower() == ".dds")
+                    {
+                        babylonTexture.isCube = Tools.IsTextureCube(texture.MapName);
+                    }
                 }
                 else
                 {
@@ -114,7 +117,10 @@ namespace Max2Babylon
                     if (File.Exists(texturepath))
                     {
                         File.Copy(texturepath, Path.Combine(babylonScene.OutputPath, babylonTexture.name), true);
-                        babylonTexture.isCube = Tools.IsTextureCube(texturepath);
+                        if (Path.GetExtension(texture.MapName).ToLower() == ".dds")
+                        {
+                            babylonTexture.isCube = Tools.IsTextureCube(texturepath);
+                        }
                     }
                     else
                     {
@@ -127,7 +133,7 @@ namespace Max2Babylon
                 // silently fails
             }
 
-            if (babylonTexture.isCube != allowCube)
+            if (babylonTexture.isCube && !allowCube)
             {
                 RaiseWarning(string.Format("Cube texture are only supported for reflection channel"), true);
             }