I am trying to automatically create a texture atlas from a set of generated png files in an Editor script. The problem is that I can't seem to be able to load a png into a Texture3D without it being inaccessible by the
PackTextures method. I have tried a few different ways to load the PNGs, such as
AssetDatabase.LoadAssetAtPath(...) and a few more.
Since all of this is done in
OnPostprocessAllAssets, I don't want to have to do any manual editing of the textures. I just want to be able to drop a PNG into a certain folder and get an updated atlas. Answers such as this seem to suggest manual editing.
The actual error message is
"Texture atlas needs textures to have Readable flag set!".
So the question is, is it possible to do this kind of post processing in Unity3D? Is there any way to import a PNG into a Texture2D with the Readable flag set, without having to manually change it?