Well I appear to have upgraded a massive project from Unity 2 to 3 during the time that Unity wasn’t correctly marking textures as normal maps, and as a result have literally hundreds of textures with the “This texture is not marked as a normal map” warning and the “Fix Now” button. Is there a way to fix all these textures automatically without having to search through every object in every scene?
I imagine an editor script could be written to do it. I’m kinda surprised one doesn’t exist actually, or maybe it does. Perhaps on the wiki, or in a forum thread? Seems there should be one somewhere.
I can’t find one and don’t have any experience coding Editor stuff. Any guru out there feel like a challenge? Anyone from Unity have any thoughts given that it was a Unity bug that caused this problem in the first place?
but it’s an editor class, which means you can’t put it’s scripts onto objects in the hiearchy and run them, so I don’t understand how you would get functions in that class to operate on things in the project pane
I could be wrong but I don’t think that is capable of fixing this issue. I’ve selected “Reimport All” from the assets menu so I’m hoping that will fix it - will find out when I get back to work tomorrow and will post the result on here.
Write something to go through various textures, perhaps all those in a specific directory or using a specific prefix or something
Create some kind of loop that checks each texture, the first link TextureImporter.normalmap, is it a normal map? true or false, if it is, move on to the next, if it isn’t, then run the third link, TextureImporterType.Bump (or TextureImporterType.Advanced) to convert said image into a normal map, then move onto the next.
I’m not writing it for you, because I’m not a coder, so I can’t. But that would be the general method you’d probably want to use to do it.
After chatting to Unity support they said that reimporting the materials should popup a dialog box asking if I wanted to fix the incorrect normal maps. Didn’t work the first time but did the second.