|
@@ -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.
|
|
|
+ * <li> NEVER_GENERATE and ALWAYS_GENERATE are quite understandable
|
|
|
+ * <li> GENERATE_WHEN_NEEDED is an option that checks if the texture had 'Generate mipmaps' option set
|
|
|
+ * in blender, mipmaps are generated only when the option is set
|
|
|
+ * @author Marcin Roguski (Kaelthas)
|
|
|
+ */
|
|
|
+ public static enum MipmapGenerationMethod {
|
|
|
+ NEVER_GENERATE,
|
|
|
+ ALWAYS_GENERATE,
|
|
|
+ GENERATE_WHEN_NEEDED;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* This interface describes the features of the scene that are to be loaded.
|