Fix to textures loading (material color should now not interfere with the texture).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9179 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 13 years ago
parent 3d22756dfc
commit c23c7e1378
  1. 6
      engine/src/blender/com/jme3/scene/plugins/blender/materials/MaterialContext.java
  2. 2
      engine/src/blender/com/jme3/scene/plugins/blender/materials/MaterialHelper.java

@ -95,8 +95,6 @@ public final class MaterialContext {
this.shininess = shininess > 0.0f ? shininess : MaterialHelper.DEFAULT_SHININESS; this.shininess = shininess > 0.0f ? shininess : MaterialHelper.DEFAULT_SHININESS;
} }
float[] diffuseColorArray = new float[] {diffuseColor.r, diffuseColor.g, diffuseColor.b, diffuseColor.a};//TODO: czy trzeba wstawiac te dane?
mTexs = new ArrayList<Structure>(); mTexs = new ArrayList<Structure>();
textures = new ArrayList<Structure>(); textures = new ArrayList<Structure>();
@ -142,6 +140,10 @@ public final class MaterialContext {
Map<Number, List<Structure[]>> sortedTextures = this.sortAndFilterTextures(); Map<Number, List<Structure[]>> sortedTextures = this.sortAndFilterTextures();
loadedTextures = new HashMap<Number, Texture>(sortedTextures.size()); loadedTextures = new HashMap<Number, Texture>(sortedTextures.size());
textureToMTexMap = new HashMap<Texture, Structure>(); textureToMTexMap = new HashMap<Texture, Structure>();
if(sortedTextures.size() > 0) {//texutre covers the material color
diffuseColor.set(1, 1, 1, 1);
}
float[] diffuseColorArray = new float[] {diffuseColor.r, diffuseColor.g, diffuseColor.b, diffuseColor.a};
TextureHelper textureHelper = blenderContext.getHelper(TextureHelper.class); TextureHelper textureHelper = blenderContext.getHelper(TextureHelper.class);
for(Entry<Number, List<Structure[]>> entry : sortedTextures.entrySet()) { for(Entry<Number, List<Structure[]>> entry : sortedTextures.entrySet()) {
if(entry.getValue().size()>0) { if(entry.getValue().size()>0) {

@ -198,7 +198,7 @@ public class MaterialHelper extends AbstractBlenderHelper {
MaterialContext materialContext = new MaterialContext(structure, blenderContext); MaterialContext materialContext = new MaterialContext(structure, blenderContext);
LOGGER.log(Level.INFO, "Material's name: {0}", materialContext.name); LOGGER.log(Level.INFO, "Material's name: {0}", materialContext.name);
if(materialContext.textures.size() > 0) { if(materialContext.textures.size() > 1) {
LOGGER.log(Level.WARNING, "Attetion! Many textures found for material: {0}. Only the first of each supported mapping types will be used!", materialContext.name); LOGGER.log(Level.WARNING, "Attetion! Many textures found for material: {0}. Only the first of each supported mapping types will be used!", materialContext.name);
} }

Loading…
Cancel
Save