Export normalmap error.

I am using the editor script here.

To try to export a normalmap from unity, but it is exporting corrupted files, and running a null reference and I can’t figure out why.

Can someone else test this script to see if they have the same problem?

Sorry to bump, but I am on a timeline, and I am still stuck on this.

Can anyone help?

Works fine here (or I wouldn’t have posted that :wink: ). Try setting the texture to isReadable manually first, before using it. I’m not really sure about that AssetDatabase.ForceUpdate thing; I got it from another script and it seems a bit hackish.

–Eric

Yeah I tried that.

hmm…

Is there some kind of set-up I am missing?

No, everything is explained on the wiki page. There’s very little to it; not sure what could go wrong.

–Eric

I was having the same problem, and noticed I was getting:

"Unsupported image format - the texture needs to be ARGB32 or RGB24
UnityEngine.Texture2D:EncodeToPNG()
UnityEngine.Texture2D:EncodeToPNG()
ExportNormalmap:ExportNormalmap() (at Assets\Editor\ExportNormalmap.js:19)

[…..\Runtime\Graphics\Texture2D.cpp line 1442]"

But changing to one of those 2 formats did work, which is cool.