Search Unity

Texture Import Settings Editor Window

Discussion in 'Scripting' started by cyb3rmaniak, Aug 24, 2009.

  1. cyb3rmaniak

    cyb3rmaniak

    Joined:
    Dec 10, 2007
    Posts:
    162
    This was very helpfull in the last couple of days since I was importing thoulsands of textures for animation sequences, so I thought I'll post it, in case anyone else needs something like this...

    It's basically a Unity Editor window that controls texture import settings for the project using the AssetPostprocessor's OnPreprocessTexture() and OnPostProcessTexture(). (So obviously it goes in the "Editor" folder under your "Assets" folder).

    Even if the window isn't open, it will use the last settings you entered, or the default ones I put in if you just started unity.
    So you can open the window, change the settings, close it and continue working with the new settings taking effect.

    When "override default settings" is checked, every time you import a texture file into Unity, it will use the import settings you fill in the window. If unchecked, it will let Unity do it's default thing.

    Additionaly - If you have many textures in your project you want to change the settings for, simply change the value in the window, select the parent folder and/or texture files and just right click -> Reimport them :)

    When "compress textures on import" is checked - after each import, it will compress the texture, so you won't need to build the project just to compress them...
    I've read somewhere around the forum that the quality when compressing using Texture2D.Compress() will not be the same as when building the project, even with the highQuality parameter set to true.
    Personaly I didn't see any difference, but I added the option to disable this anyway. Sometimes it's handy.

    The red labels on top are handy if you set the window to the smallest size possible - They are red when the relevant setting is active and black if not. A single glance will let you know in which state you're in.

    I usually just use the default values when working on a project, even if I don't need any specific setting. It puts a stop to the many many 1024x1024 DXT5 textures with mipmaps that you usually don't have the time and energy to later hunt down and compress...
    I work with low settings, and if I come across a texture which needs something else (If the texture looks bad, I need the alpha channel etc.) I'll change it on the desired texture(s).

    Maybe later I'll add other settings for MovieTextures and other assets when I'll have some time on my hands...
     

    Attached Files:

  2. thienhaflash

    thienhaflash

    Joined:
    Jun 16, 2012
    Posts:
    513
    Thanks man for sharing this.
     
  3. Iamdain

    Iamdain

    Joined:
    Feb 3, 2010
    Posts:
    90
    Nice one, thanks man!
     
  4. dilly123

    dilly123

    Joined:
    Nov 1, 2009
    Posts:
    23
    thanks man!
     
  5. gulfam131

    gulfam131

    Joined:
    Aug 1, 2013
    Posts:
    10
    thanks man.