diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java index 8913f5864..8bd1a2503 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TextureHelper.java @@ -614,8 +614,15 @@ public class TextureHelper extends AbstractBlenderHelper { int texflag = ((Number) textureData.mtex.getFieldValue("texflag")).intValue(); boolean negateTexture = (texflag & 0x04) != 0; + boolean colorSet = false; for (int i = 0; i < mappings.length; ++i) { if ((mappings[i] & mapto.intValue()) != 0) { + if(mappings[i] == MaterialContext.MTEX_COL) { + colorSet = true; + } else if(colorSet && mappings[i] == MaterialContext.MTEX_ALPHA) { + continue; + } + CombinedTexture combinedTexture = new CombinedTexture(mappings[i], !skyTexture); int blendType = ((Number) textureData.mtex.getFieldValue("blendtype")).intValue(); float[] color = new float[] { ((Number) textureData.mtex.getFieldValue("r")).floatValue(), ((Number) textureData.mtex.getFieldValue("g")).floatValue(), ((Number) textureData.mtex.getFieldValue("b")).floatValue() }; @@ -646,8 +653,16 @@ public class TextureHelper extends AbstractBlenderHelper { Map> result = new HashMap>(); for (TextureData data : textures) { Number mapto = (Number) data.mtex.getFieldValue("mapto"); + + boolean colorSet = false; for (int i = 0; i < mappings.length; ++i) { if ((mappings[i] & mapto.intValue()) != 0) { + if(mappings[i] == MaterialContext.MTEX_COL) { + colorSet = true; + } else if(colorSet && mappings[i] == MaterialContext.MTEX_ALPHA) { + continue; + } + List datas = result.get(mappings[i]); if (datas == null) { datas = new ArrayList(); @@ -668,4 +683,4 @@ public class TextureHelper extends AbstractBlenderHelper { /** The name of the user's UV coordinates that are used for this texture. */ public String uvCoordinatesName; } -} \ No newline at end of file +}