diff --git a/engine/src/blender/com/jme3/asset/BlenderKey.java b/engine/src/blender/com/jme3/asset/BlenderKey.java index cf0a4c736..be449e7f4 100644 --- a/engine/src/blender/com/jme3/asset/BlenderKey.java +++ b/engine/src/blender/com/jme3/asset/BlenderKey.java @@ -104,6 +104,8 @@ public class BlenderKey extends ModelKey { protected int maxTextureSize = -1; /** Allows to toggle generated textures loading. Disabled by default because it very often takes too much memory and needs to be used wisely. */ protected boolean loadGeneratedTextures; + /** Tells if the mipmaps will be generated by jme or not. By default generation is dependant on the blender settings. */ + protected MipmapGenerationMethod mipmapGenerationMethod = MipmapGenerationMethod.GENERATE_WHEN_NEEDED; /** * Constructor used by serialization mechanisms. @@ -334,6 +336,21 @@ public class BlenderKey extends ModelKey { return generatedTexturePPU; } + /** + * @return mipmaps generation method + */ + public MipmapGenerationMethod getMipmapGenerationMethod() { + return mipmapGenerationMethod; + } + + /** + * @param mipmapGenerationMethod + * mipmaps generation method + */ + public void setMipmapGenerationMethod(MipmapGenerationMethod mipmapGenerationMethod) { + this.mipmapGenerationMethod = mipmapGenerationMethod; + } + /** * This mehtod sets the name of the WORLD data block taht should be used during file loading. By default the name is * not set. If no name is set or the given name does not occur in the file - the first WORLD data block will be used @@ -384,6 +401,7 @@ public class BlenderKey extends ModelKey { oc.write(defaultMaterial, "default-material", null); oc.write(faceCullMode, "face-cull-mode", FaceCullMode.Off); oc.write(layersToLoad, "layers-to-load", -1); + oc.write(mipmapGenerationMethod , "mipmap-generation-method", MipmapGenerationMethod.GENERATE_WHEN_NEEDED); } @Override @@ -400,6 +418,7 @@ public class BlenderKey extends ModelKey { defaultMaterial = (Material) ic.readSavable("default-material", null); faceCullMode = ic.readEnum("face-cull-mode", FaceCullMode.class, FaceCullMode.Off); layersToLoad = ic.readInt("layers-to=load", -1); + mipmapGenerationMethod = ic.readEnum("mipmap-generation-method", MipmapGenerationMethod.class, MipmapGenerationMethod.GENERATE_WHEN_NEEDED); } @Override @@ -476,7 +495,18 @@ public class BlenderKey extends ModelKey { return true; } - + /** + * This enum tells the importer if the mipmaps for textures will be generated by jme. + *