Fix #646
Ignoring the alpha influencer (mapping) if the color one was found first.
This commit is contained in:
parent
ab8ddd5ab5
commit
a9cf6a348f
@ -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<Number, List<TextureData>> result = new HashMap<Number, List<TextureData>>();
|
||||
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<TextureData> datas = result.get(mappings[i]);
|
||||
if (datas == null) {
|
||||
datas = new ArrayList<TextureData>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user