- Home /
Editor class "Texture Importer" question (applying settings to multiple texture assets).
Hi, Is there a way to apply settings to multiple texture assets? For example set the mipmap parameters for a selection of textures in a directory?
If you have multiple textures selected, changing settings only affects the first texture.
I have looked into writing an editor script, but the problem I ran into there was the function:
http://unity3d.com/support/documentation/ScriptReference/Selection.html
only returns selections inside of the scene. It will not return a selection of project assets.
Any suggestions for batch applying "texture settings" through the editor or through editor scripts?
Answer by Eric5h5 · Jan 27, 2010 at 05:06 AM
Have a look at this script on the wiki.
Thats exactly what I was looking for. Thanks. This script uses selection function's optional parameter, called "Selection$$anonymous$$ode.DeepAssets", that is the real trick for selecting objects in the file folder.
Link is not existed anymore. Someone please answer the question? I need the solution as well. Thank you.
Would love to see the same... the documentation is pretty obtuse as to how to make TextureImporter work. Would be great to see a tutorial, video, or example
Answer by dreasgrech · Jan 09, 2016 at 04:01 PM
Since I have don't have enough reputation to post a comment on Eric5h5's answer, I have to post this as an answer instead.
Here is a mirror for the link in his answer since people have requested it: http://wiki.unity3d.com/index.php?title=TextureImportSettings
This is the method which fetches the currently selected textures:
static Object[] GetSelectedTextures()
{
return Selection.GetFiltered(typeof(Texture2D), SelectionMode.DeepAssets);
}