- Home /
Why isn't the TextureImporter mipmap bias exposed in the editor?
TextureImporter.mipMapBias was added in Unity 3.2. I'm using 4.1.5 and I'm surprised that it still isn't available in the editor. For some reason, you still have to access it through code by writing an editor script like in this answer: http://answers.unity3d.com/questions/49826/mipmapbias-in-the-texture-importer.html
But... why? Why is literally every other property of TextureImporter exposed in the editor except this one?
Answer by blake_seow · May 20, 2017 at 09:20 AM
I know this is a old topic, but I ran into same problem today, haven't been able to find a solution, so I try wrote a editor script to do that, turns out it works. In case someone have same problem in future, I decided to post it here, this script can work for mutiple selections too, means you can select bunch of textures and click the button to change mipmap bias for them all. I also added settings for filter mode, in case someone need.
if (GUILayout.Button("MipBias")) { //settings float mipBias=-1F; FilterMode filter= FilterMode.Trilinear; int aniso=5;
foreach (Object obj in Selection.objects) {
string path = AssetDatabase.GetAssetPath(obj);
TextureImporter texImporter = AssetImporter.GetAtPath(path) as TextureImporter;
if (texImporter != null)
{
texImporter.mipmapEnabled = true;
texImporter.filterMode =filter;
texImporter.anisoLevel = aniso;
texImporter.mipMapBias = mipBias;
AssetDatabase.ImportAsset(path);
}
}
}
Answer by steven3Dim · Nov 21, 2017 at 08:18 AM
In this thread https://answers.unity.com/questions/49826/mipmapbias-in-the-texture-importer.html somebody made a nice script to set the MipMap Bias. When you set it, it is saved in the texture-asset, so available after restart. You can set of any selection of textures the setting by right-clicking.
I derived the following script for my own needs:
Note that I could go all the way to bias -4 to get the sharpest images.
Answer by liszto · Aug 06, 2013 at 09:56 AM
I don't think it's the place to expose this missing property. Post that in Unity Support forum or in others related sub-forums. Thanks.
I don't have enough rigth to do this. Sorry.
Just post this on Unity Forum and it will be fine :)
Your answer
Follow this Question
Related Questions
Mipmap view not working in editor. 0 Answers
Texture importer, changing original file size 0 Answers
Texture Fails in Mobile 1 Answer
Editor Script Texture Import Settings, Asset Store 1 Answer
MipMapping NVidia Problem 0 Answers