diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialContext.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialContext.java index c8dedcd40..1995da0af 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialContext.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialContext.java @@ -46,6 +46,8 @@ public final class MaterialContext implements Savable { public static final int MTEX_ALPHA = 0x80; public static final int MTEX_AMB = 0x800; + public static final int FLAG_TRANSPARENT = 0x10000; + /* package */final String name; /* package */final List loadedTextures; @@ -96,20 +98,25 @@ public final class MaterialContext implements Savable { TextureHelper textureHelper = blenderContext.getHelper(TextureHelper.class); loadedTextures = textureHelper.readTextureData(structure, new float[] { diffuseColor.r, diffuseColor.g, diffuseColor.b, diffuseColor.a }, false); - // veryfying if the transparency is present - // (in blender transparent mask is 0x10000 but its better to verify it because blender can indicate transparency when - // it is not required - boolean transparent = false; - if (diffuseColor != null) { - transparent = diffuseColor.a < 1.0f; - if (loadedTextures.size() > 0) {// texutre covers the material color - diffuseColor.set(1, 1, 1, 1); + long flag = ((Number)structure.getFieldValue("flag")).longValue(); + if((flag & FLAG_TRANSPARENT) != 0) { + // veryfying if the transparency is present + // (in blender transparent mask is 0x10000 but its better to verify it because blender can indicate transparency when + // it is not required + boolean transparent = false; + if (diffuseColor != null) { + transparent = diffuseColor.a < 1.0f; + if (loadedTextures.size() > 0) {// texutre covers the material color + diffuseColor.set(1, 1, 1, 1); + } } + if (specularColor != null) { + transparent = transparent || specularColor.a < 1.0f; + } + this.transparent = transparent; + } else { + transparent = false; } - if (specularColor != null) { - transparent = transparent || specularColor.a < 1.0f; - } - this.transparent = transparent; } /** diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/SubdivisionSurfaceModifier.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/SubdivisionSurfaceModifier.java index 2945b3413..748f2c7f2 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/SubdivisionSurfaceModifier.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/modifiers/SubdivisionSurfaceModifier.java @@ -209,7 +209,6 @@ public class SubdivisionSurfaceModifier extends Modifier { * @param temporalMesh * the mesh to be subdivided */ - @SuppressWarnings("unchecked") private void subdivideSimple(TemporalMesh temporalMesh) { Map edgePoints = new HashMap(); Map facePoints = new HashMap();