An "Asset Pre-Processor" for GUI Images [Obsolete]

This is the place to post add-on scripts you have written that use EZ GUI. Please remember only to post your add-on content and not the original EZ GUI scripts.
Forum rules
Only post your own add-on content and not any of the original EZ GUI scripts.

An "Asset Pre-Processor" for GUI Images [Obsolete]

Postby Little Angel » Fri Oct 08, 2010 3:24 pm

This is another editor script, so should go in you Assets/Editor folder:

This script looks at any asset being imported with the string "GUIImages" in it's path and processes them to Uncompressed AutoTrueColor Non-PowerOf2, etc.. You'll be able to read the script to see the settings in detail.

Put this script in your Assets/Editor folder/directory. Then create a folder/directory with GUIImages as the name.

I just have my folder/directory set up like this: Assets/Images/GUIImages... (and this can include Assets/Images/GUIImages/Buttons... Assets/Images/GUIImages/PanelsBGs... etc.) and on import, the import settings are modified by this script to be what you want. This script is NOT looking at a folder/directory, it's looking to see if ANY text in the path includes "GUIImages".

If you want to modify this script, then all you need to do is look up TextureImporter:
http://unity3d.com/support/documentatio ... orter.html
... and modify the properties as you desire.

You could if you wanted to, clone this, and have one for "GUIImages" and another for "TextureImages", etc..

Code: Select all
// PRE-processes all textures that are placed in a folder GUIImages to be set as an uncompressed unchanged GUI Image.

class MakeGUIImage extends AssetPostprocessor
{
    function OnPreprocessTexture () {
        // Automatically convert any texture file with "GUIImages" in its file name into an uncompressed unchanged GUI Image.
        if (assetPath.Contains("GUIImages")) {
            var myTextureImporter : TextureImporter = assetImporter;
            myTextureImporter.textureType = TextureImporterType.Advanced;
            myTextureImporter.textureFormat = TextureImporterFormat.ARGB32;
            myTextureImporter.convertToNormalmap = false;
            myTextureImporter.maxTextureSize = 1024;
            myTextureImporter.grayscaleToAlpha = false;
            myTextureImporter.generateCubemap = TextureImporterGenerateCubemap.None;
            myTextureImporter.npotScale = TextureImporterNPOTScale.None;
            myTextureImporter.isReadable = true;
            myTextureImporter.mipmapEnabled = false;
//            myTextureImporter.borderMipmap = false;
//            myTextureImporter.correctGamma = false;
            myTextureImporter.mipmapFilter = TextureImporterMipFilter.BoxFilter;
            myTextureImporter.fadeout = false;
//            myTextureImporter.mipmapFadeDistanceStart;
//            myTextureImporter.mipmapFadeDistanceEnd;
            myTextureImporter.convertToNormalmap = false;
//            myTextureImporter.normalmap;
//            myTextureImporter.normalmapFilter;
//            myTextureImporter.heightmapScale;
            myTextureImporter.lightmap = false;
           
        }
    }
}
Last edited by Little Angel on Fri Oct 08, 2010 4:29 pm, edited 1 time in total.
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: An "Asset Pre-Processor" for GUI Images

Postby MadMac » Fri Oct 08, 2010 3:43 pm

perfect !!!!
now i only need to set the generated SpriteAtlas to uncompressed RGBA32bit...
thank you very much !
MAd
MadMac
 
Posts: 47
Joined: Tue Sep 28, 2010 11:03 am

Re: An "Asset Pre-Processor" for GUI Images

Postby Little Angel » Fri Oct 08, 2010 3:46 pm

Also - if you have a pile of images already imported - move them into the path somewhere under "GUIImages" (or whatever you edit that string to) and pick the FOLDER that the images are in and click on:
Assets->Reimport
... and it will reprocess all of the items in that folder. If you want, you can remove them after that point, and replace them in your project as you see fit.
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: An "Asset Pre-Processor" for GUI Images

Postby Little Angel » Fri Oct 08, 2010 4:34 pm

I've updated this code.

It seems that:
Code: Select all
myTextureImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;

... seemed to create a file that "Build Atlas" didn't like, even tho' when I choose "Automatic Truecolor" from the dropdown menu it seemed to work.

I have changed this line of code to:
Code: Select all
myTextureImporter.textureFormat = TextureImporterFormat.ARGB32;

... and it seems to work just fine.
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: An "Asset Pre-Processor" for GUI Images

Postby Little Angel » Mon Oct 11, 2010 11:35 am

I have included this script in a unity package hosted on the first post in this thread:
viewtopic.php?f=9&t=224
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: An "Asset Pre-Processor" for GUI Images

Postby jrricky » Sun Oct 24, 2010 6:44 pm

Hey LittleAngel, Ive been constantly getting this error and i dont know why:

Code: Select all
Assets/Editor/G-Wiz Items/BatchCreateUIButton.cs(9,25): warning CS0649: Field `BatchCreateUIButton.spriteMaterial' is never assigned to, and will always have its default value `null'
jrricky
 
Posts: 45
Joined: Mon Sep 27, 2010 3:09 pm

Re: An "Asset Pre-Processor" for GUI Images

Postby Little Angel » Sun Oct 24, 2010 9:02 pm

Take a look here: viewtopic.php?f=9&t=242 and I talk about the null warnings and how to get rid of them. These are warnings not errors, so they can be safely ignored, regardless.
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: An "Asset Pre-Processor" for GUI Images

Postby Little Angel » Tue Oct 26, 2010 10:26 am

This thread is obsolete and this item has been incorporated into the "Custom Items for EZGui"
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: An "Asset Pre-Processor" for GUI Images

Postby malcolmr » Thu Dec 09, 2010 1:58 am

Little Angel wrote:This thread is obsolete and this item has been incorporated into the "Custom Items for EZGui"


viewtopic.php?f=16&t=242
malcolmr
 
Posts: 14
Joined: Thu Dec 09, 2010 1:33 am

Sjcg123

Postby Sjcg123 » Sun Oct 16, 2016 6:21 am

Coach Bags On Sale
Nike Zapatos
nike sb stefan janoski
moncler jacket sale
vans shoe store
Canada Goose Outlet
burberry outlet store online
adidas outlet stores online
fitflop online kopen
scarpe hogan outlet
nfl store
outlet zapatos online
chaussure basket homme
Air Jordan News
tienda online abercrombie españa
nike sportschuhe
cheap uggs for women
Ugg boots Sale
pandora bracelet charms
ray ban wayfarer eyeglasses
uggs outlet
chaussure Nike homme
tru religion jeans
Jordan Store
uggs for cheap
sac givenchy
michael kors handbags on sale
nike air
Chaussure Nike Pas Cher
abercrombie and fitch store
Nike Air Jordan 11
cheap uggs
toms shoes outlet
portafoglio michael kors
burberry schal
fitflops sale uk
Timberland skor
Air Jordan Release Date
adidas site officiel
polo ralph lauren pas cher
longchamp tote bag
zapatos de futbol nike
moncler outlet
new pandora charms
Cheap Michael Kors
nike tn pas cher
hogan rebel donna
Jordan Schoenen
ropa abercrombie
new yeezy shoes
adidas schuhe neu
nike skor outlet
nike mercurial soccer cleats
zapatillas nike baratas
nike sportschuhe damen
chaussures nike pas cher
adidas shoenen
christian louboutin outlet
louboutin heels
scarpe nike running
billige nike sko
scarpe adidas online
Lebron 13
Toms Outlet Online
Nike Online Store
bambas adidas baratas
sac a main michael kors
michael kors bags outlet
Soccer Boots Outlet nike
toms sale
mulberry väskor rea
pandora charm bracelet sale
pandora jewelry store
asics sko
zapatillas running
zapatilla adidas
Toms Shoes For Women
retro jordans for cheap
michael kors väska rea
ray ban sale
nike shoes
adidas schoenen
cheap burberry bags
nike air max running shoes
converse store
cheap christian louboutin
sac coach soldes
ugg clearance
moncler coats for women
Billiga Nike Air Max
religion store
ugg outlet online
hogan scontate
Miu Miu bags online
Adidas schuhe
abercrombie deutschland
outlet prada online
nike sneakers
Uomo Hogan
scarpe jordan
sandalias birkenstock
balenciaga borse
nike jordan shoes
nike free
scarpe nike
charms pandora pas cher
nike schuhe günstig
Moncler Sale
chaussure adidas pas cher
timberland outlet
Nike Store
cheap nike air max
ugg boots for women
fendi pas cher
coach factory outlet online
adidas outlet
prada outlet
adidas store
Moncler Outlet Online
botas de futbol
23 is back
adidas kläder
oakley sunglasses clearance
air max pas cher femme
cheap air max outlet
ugg factory outlet
pandora beads
official NHL jerseys
huarache sneakers
chaussures de foot pas cher
ugg store
Jordan Sneakers For Sale
adidas tienda online
ugg boots classic
air force one pas cher
newest lebron shoes
discount ray bans
ugg boots outlet online
moncler girls
burberry sac pas cher
coach sac à main
goedkope nike air max
burberry sac pas cher
reebok running shoes
nike air schuhe herren
Korting sportschoenen
scarpe adidas donna
hyperdunk 2014
longchamp kaufen
new jordan releases
womens nike air max
Air Max 90
cheap mbt shoes sale
longchamp bags on sale
nike chaussures
nike damenschuhe
Ray ban sale online
nike joggesko
1016Sjcg
Sjcg123
 
Posts: 326
Joined: Sun Oct 16, 2016 6:19 am

Next

Return to EZ GUI Add-ons

Who is online

Users browsing this forum: No registered users and 1 guest

cron