|
|
@ -126,23 +126,24 @@ public final class MaterialContext { |
|
|
|
TextureHelper textureHelper = blenderContext.getHelper(TextureHelper.class); |
|
|
|
TextureHelper textureHelper = blenderContext.getHelper(TextureHelper.class); |
|
|
|
for(Entry<Number, List<TextureData>> entry : textureDataMap.entrySet()) { |
|
|
|
for(Entry<Number, List<TextureData>> entry : textureDataMap.entrySet()) { |
|
|
|
if(entry.getValue().size()>0) { |
|
|
|
if(entry.getValue().size()>0) { |
|
|
|
CombinedTexture combinedTexture = loadedTextures.get(entry.getKey()); |
|
|
|
CombinedTexture combinedTexture = new CombinedTexture(); |
|
|
|
if(combinedTexture == null) { |
|
|
|
|
|
|
|
combinedTexture = new CombinedTexture(); |
|
|
|
|
|
|
|
loadedTextures.put(entry.getKey(), combinedTexture); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for(TextureData textureData : entry.getValue()) { |
|
|
|
for(TextureData textureData : entry.getValue()) { |
|
|
|
int texflag = ((Number) textureData.mtex.getFieldValue("texflag")).intValue(); |
|
|
|
int texflag = ((Number) textureData.mtex.getFieldValue("texflag")).intValue(); |
|
|
|
boolean negateTexture = (texflag & 0x04) != 0; |
|
|
|
boolean negateTexture = (texflag & 0x04) != 0; |
|
|
|
Texture texture = textureHelper.getTexture(textureData.textureStructure, textureData.mtex, blenderContext); |
|
|
|
Texture texture = textureHelper.getTexture(textureData.textureStructure, textureData.mtex, blenderContext); |
|
|
|
int blendType = ((Number) textureData.mtex.getFieldValue("blendtype")).intValue(); |
|
|
|
if(texture != null) { |
|
|
|
float[] color = new float[] { ((Number) textureData.mtex.getFieldValue("r")).floatValue(), |
|
|
|
int blendType = ((Number) textureData.mtex.getFieldValue("blendtype")).intValue(); |
|
|
|
((Number) textureData.mtex.getFieldValue("g")).floatValue(), |
|
|
|
float[] color = new float[] { ((Number) textureData.mtex.getFieldValue("r")).floatValue(), |
|
|
|
((Number) textureData.mtex.getFieldValue("b")).floatValue() }; |
|
|
|
((Number) textureData.mtex.getFieldValue("g")).floatValue(), |
|
|
|
float colfac = ((Number) textureData.mtex.getFieldValue("colfac")).floatValue(); |
|
|
|
((Number) textureData.mtex.getFieldValue("b")).floatValue() }; |
|
|
|
TextureBlender textureBlender = TextureBlenderFactory.createTextureBlender(texture.getImage().getFormat(), |
|
|
|
float colfac = ((Number) textureData.mtex.getFieldValue("colfac")).floatValue(); |
|
|
|
texflag, negateTexture, blendType, diffuseColorArray, color, colfac); |
|
|
|
TextureBlender textureBlender = TextureBlenderFactory.createTextureBlender(texture.getImage().getFormat(), |
|
|
|
combinedTexture.add(texture, textureBlender, textureData.uvCoordinatesType, textureData.projectionType, textureData.textureStructure, blenderContext); |
|
|
|
texflag, negateTexture, blendType, diffuseColorArray, color, colfac); |
|
|
|
|
|
|
|
combinedTexture.add(texture, textureBlender, textureData.uvCoordinatesType, textureData.projectionType, textureData.textureStructure, blenderContext); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(combinedTexture.getTexturesCount() > 0) { |
|
|
|
|
|
|
|
loadedTextures.put(entry.getKey(), combinedTexture); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|