mirror of
https://github.com/maxartz15/MA_TextureAtlasser.git
synced 2026-11-04 08:25:47 +01:00
Compare commits
10
Commits
1.8.1
...
41e78763bf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41e78763bf | ||
|
|
df397717a4 | ||
|
|
6598d8243b | ||
|
|
3ad2a3cf67 | ||
|
|
b2a005356d | ||
|
|
05b4ea9f80 | ||
|
|
0933abdace | ||
|
|
5d112a2ced | ||
|
|
650600fac3 | ||
|
|
b2ccdb2273 |
No files matched your search
+7
@@ -521,6 +521,13 @@ namespace MA_TextureAtlasserPro
|
||||
name = atlas.name + "_" + atlas.textureGroupRegistration[i].name
|
||||
};
|
||||
|
||||
//A new Texture2D is uninitialised, and MA_Combine2D only writes inside each quad's
|
||||
//guiRect, so every texel no quad covers keeps whatever was left in the buffer. That
|
||||
//garbage is opaque enough to survive an alpha cutoff and bleeds into the quads
|
||||
//through the mip chain, so clear the atlas to transparent black before combining.
|
||||
newTexture.SetPixels32(new Color32[newTexture.width * newTexture.height]);
|
||||
newTexture.Apply();
|
||||
|
||||
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
||||
{
|
||||
if (q.textureGroups != null && q.textureGroups[i].texture != null)
|
||||
|
||||
+11
-2
@@ -13,6 +13,7 @@ namespace MA_TextureAtlasserPro
|
||||
private MA_TextureAtlasserProQuad lastSelectedQuad;
|
||||
private bool isEditing = false;
|
||||
private GUIStyle labelStyle = new GUIStyle(GUI.skin.label);
|
||||
private Vector2 scrollPos = Vector2.zero;
|
||||
|
||||
public MA_TextureAtlasserProInspectorView(MA_TextureAtlasserProWindow currentEditorWindow, string title) : base(currentEditorWindow, title)
|
||||
{
|
||||
@@ -37,6 +38,10 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
|
||||
GUILayout.BeginArea(editorViewRect, EditorStyles.helpBox);
|
||||
using (var scrollViewScope = new EditorGUILayout.ScrollViewScope(scrollPos, false, false))
|
||||
{
|
||||
scrollPos = scrollViewScope.scrollPosition;
|
||||
|
||||
GUILayout.BeginVertical(GUILayout.ExpandWidth(true));
|
||||
|
||||
GUILayout.Label("Quad Name");
|
||||
@@ -90,6 +95,7 @@ namespace MA_TextureAtlasserPro
|
||||
SerializedObject serializedObject = new SerializedObject(curWindow.textureAtlas.selectedTextureQuad);
|
||||
serializedObject.Update();
|
||||
|
||||
|
||||
if (curWindow.textureAtlas.selectedTextureQuad.modelGroups != null)
|
||||
{
|
||||
SerializedProperty modelGroupsSP = serializedObject.FindProperty("modelGroups");
|
||||
@@ -109,8 +115,11 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
|
||||
SerializedProperty meshesSP = modelGroupsSP.GetArrayElementAtIndex(i).FindPropertyRelative("meshes");
|
||||
#if UNITY_2020_2_OR_NEWER
|
||||
meshesSP.isExpanded = EditorGUILayout.Foldout(meshesSP.isExpanded, "Meshes", true);
|
||||
#else
|
||||
EditorGUILayout.PropertyField(meshesSP, false, GUILayout.ExpandWidth(false), GUILayout.MaxWidth(editorViewRect.width * 0.5f));
|
||||
|
||||
#endif
|
||||
if (meshesSP.isExpanded)
|
||||
{
|
||||
for (int j = 0; j < curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes.Count; j++)
|
||||
@@ -161,7 +170,7 @@ namespace MA_TextureAtlasserPro
|
||||
|
||||
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(), labelStyle);
|
||||
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.EndArea();
|
||||
}
|
||||
|
||||
@@ -84,7 +84,12 @@ namespace MA_Mesh
|
||||
newMesh.SetTriangles(mesh.GetTriangles(i), i);
|
||||
}
|
||||
newMesh.SetNormals(new List<Vector3>(mesh.normals));
|
||||
newMesh.SetUVs(0, new List<Vector2>(mesh.uv));
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
List<Vector2> uvs = new List<Vector2>();
|
||||
mesh.GetUVs(i, uvs);
|
||||
newMesh.SetUVs(i, uvs);
|
||||
}
|
||||
newMesh.SetTangents(new List<Vector4>(mesh.tangents));
|
||||
newMesh.SetColors(new List<Color>(mesh.colors));
|
||||
|
||||
|
||||
@@ -122,7 +122,11 @@ namespace MA_Texture
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
texture.Reinitialize(newWidth, newHeight);
|
||||
#else
|
||||
texture.Resize(newWidth, newHeight);
|
||||
#endif
|
||||
texture.SetPixels(newColors);
|
||||
texture.Apply();
|
||||
|
||||
|
||||
Reference in new issue
Block a user