Fixed gray texture on export.

Fixed gray texture on export bug, it was caused by the texture scale function (during upscaling), right now it's required to have the texture dimensions be a power of 2 width/height.
Optional OBJ/PNG/sprite export options.
Chanaged readme.
TODO: Cleanup export code. Make proper scale options (bilinear & point).
This commit is contained in:
max
2019-07-16 14:12:32 +02:00
parent 09f7c488b9
commit 7f17793af0
5 changed files with 185 additions and 20 deletions

View File

@ -13,6 +13,8 @@ namespace MA_TextureAtlasserPro
private bool isEditing = false;
private GUIStyle labelStyle = new GUIStyle(GUI.skin.label);
public MA_TextureAtlasserProInspectorView(MA_TextureAtlasserProWindow currentEditorWindow, string title) : base(currentEditorWindow, title)
{
@ -115,8 +117,17 @@ namespace MA_TextureAtlasserPro
}
GUILayout.FlexibleSpace();
if(!MA_TextureAtlasserProUtils.IsPowerOfTwo((int)curWindow.textureAtlas.selectedTextureQuad.guiRect.width) || !MA_TextureAtlasserProUtils.IsPowerOfTwo((int)curWindow.textureAtlas.selectedTextureQuad.guiRect.height))
{
labelStyle.normal.textColor = Color.red;
}
else
{
labelStyle.normal.textColor = Color.black;
}
GUILayout.Label("x " + curWindow.textureAtlas.selectedTextureQuad.guiRect.x.ToString() + ", y " + curWindow.textureAtlas.selectedTextureQuad.guiRect.y.ToString());
GUILayout.Label("w " + curWindow.textureAtlas.selectedTextureQuad.guiRect.width.ToString() + ", h " + curWindow.textureAtlas.selectedTextureQuad.guiRect.height.ToString());
GUILayout.Label("w " + curWindow.textureAtlas.selectedTextureQuad.guiRect.width.ToString() + ", h " + curWindow.textureAtlas.selectedTextureQuad.guiRect.height.ToString(), labelStyle);
GUILayout.EndVertical();
GUILayout.EndArea();