9 Commits
1.8.0 ... 1.8.4

Author SHA1 Message Date
max
05b4ea9f80 Update MA_TextureAtlasserProInspectorView.cs
Fix 2020.2+ mesh input fields.
2021-04-08 23:51:05 +02:00
max
0933abdace Update MA_TextureAtlasserProInspectorView.cs 2021-04-03 17:09:27 +02:00
max
5d112a2ced Update MA_TextureAtlasserProInspectorView.cs
Dirty fix for 2020.2+ versions with reordable list.
2021-04-02 17:31:24 +02:00
max
650600fac3 Delete launch.json 2021-03-26 11:42:54 +01:00
max
b2ccdb2273 Copy over all UV channels.
The duplicate function now copies all 8 UV channels. So your lightmap UV's don't get lost!
2021-03-26 11:41:19 +01:00
max
df16ba6c05 Merge branch 'master' of https://github.com/maxartz15/MA_TextureAtlasser 2020-05-16 19:29:09 +02:00
max
a3c002cb17 Update MA_TextureUtils.cs
Bugfix: 2 pixel Y offset when combining textures.
2020-05-16 19:29:01 +02:00
max
0907259aa8 Update README.md 2020-04-21 02:28:41 +02:00
max
fa40b918d0 Update README.md 2020-04-20 22:43:13 +02:00
4 changed files with 50 additions and 41 deletions

View File

@ -94,51 +94,54 @@ namespace MA_TextureAtlasserPro
{ {
SerializedProperty modelGroupsSP = serializedObject.FindProperty("modelGroups"); SerializedProperty modelGroupsSP = serializedObject.FindProperty("modelGroups");
for (int i = 0; i < curWindow.textureAtlas.selectedTextureQuad.modelGroups.Count; i++) for (int i = 0; i < curWindow.textureAtlas.selectedTextureQuad.modelGroups.Count; i++)
{ {
using (new GUILayout.VerticalScope(EditorStyles.helpBox)) using (new GUILayout.VerticalScope(EditorStyles.helpBox))
{ {
using (new GUILayout.HorizontalScope()) using (new GUILayout.HorizontalScope())
{ {
curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].name = EditorGUILayout.TextField(curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].name); curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].name = EditorGUILayout.TextField(curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].name);
if (GUILayout.Button("-", EditorStyles.miniButton, GUILayout.ExpandWidth(true))) if (GUILayout.Button("-", EditorStyles.miniButton, GUILayout.ExpandWidth(true)))
{ {
curWindow.textureAtlas.selectedTextureQuad.modelGroups.RemoveAt(i); curWindow.textureAtlas.selectedTextureQuad.modelGroups.RemoveAt(i);
break; break;
} }
} }
SerializedProperty meshesSP = modelGroupsSP.GetArrayElementAtIndex(i).FindPropertyRelative("meshes"); SerializedProperty meshesSP = modelGroupsSP.GetArrayElementAtIndex(i).FindPropertyRelative("meshes");
EditorGUILayout.PropertyField(meshesSP, false, GUILayout.ExpandWidth(false), GUILayout.MaxWidth(editorViewRect.width * 0.5f)); #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++)
{
using (new GUILayout.HorizontalScope())
{
curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes[j] = (Mesh)EditorGUILayout.ObjectField(curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes[j], typeof(Mesh), false);
if (GUILayout.Button("-", EditorStyles.miniButton, GUILayout.ExpandWidth(true)))
{
curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes.RemoveAt(j);
break;
}
}
}
}
if (meshesSP.isExpanded) if (GUILayout.Button("+", EditorStyles.miniButton))
{ {
for (int j = 0; j < curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes.Count; j++) curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes.Add(null);
{ }
using (new GUILayout.HorizontalScope()) }
{ }
curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes[j] = (Mesh)EditorGUILayout.ObjectField(curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes[j], typeof(Mesh), false);
if (GUILayout.Button("-", EditorStyles.miniButton, GUILayout.ExpandWidth(true)))
{
curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes.RemoveAt(j);
break;
}
}
}
}
if (GUILayout.Button("+", EditorStyles.miniButton)) if (GUILayout.Button("+", EditorStyles.miniButton, GUILayout.ExpandWidth(true)))
{ {
curWindow.textureAtlas.selectedTextureQuad.modelGroups[i].meshes.Add(null); curWindow.textureAtlas.selectedTextureQuad.modelGroups.Add(new MA_ModelGroup() { name = MA_StringUtils.RandomAlphabetString(6) });
} }
} }
}
if (GUILayout.Button("+", EditorStyles.miniButton, GUILayout.ExpandWidth(true)))
{
curWindow.textureAtlas.selectedTextureQuad.modelGroups.Add(new MA_ModelGroup() { name = MA_StringUtils.RandomAlphabetString(6) });
}
}
else else
{ {
curWindow.textureAtlas.selectedTextureQuad.modelGroups = new List<MA_ModelGroup>(); curWindow.textureAtlas.selectedTextureQuad.modelGroups = new List<MA_ModelGroup>();

View File

@ -84,7 +84,12 @@ namespace MA_Mesh
newMesh.SetTriangles(mesh.GetTriangles(i), i); newMesh.SetTriangles(mesh.GetTriangles(i), i);
} }
newMesh.SetNormals(new List<Vector3>(mesh.normals)); 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.SetTangents(new List<Vector4>(mesh.tangents));
newMesh.SetColors(new List<Color>(mesh.colors)); newMesh.SetColors(new List<Color>(mesh.colors));

View File

@ -199,7 +199,7 @@ namespace MA_Texture
if(flipY) if(flipY)
{ {
//Y is 'flipped' because textures are made from left to right, bottom to top. We want to draw from left to right and top to bottom. //Y is 'flipped' because textures are made from left to right, bottom to top. We want to draw from left to right and top to bottom.
for (int y = combineTexture.height; y > 0; y--) for (int y = combineTexture.height - 1; y >= 0; y--)
{ {
texture.SetPixel(x + offsetX, y + (texture.height - offsetY - combineTexture.height), combineTexture.GetPixel(x, y)); texture.SetPixel(x + offsetX, y + (texture.height - offsetY - combineTexture.height), combineTexture.GetPixel(x, y));
} }

View File

@ -11,6 +11,7 @@ Texture atlas creator tool for Unity. <br> This tool is made to combine textures
### Unity versions ### Unity versions
- Latest release requires Unity 2018.3 or higher. - Latest release requires Unity 2018.3 or higher.
- Releases before 1.8 should work with older Unity versions. - Releases before 1.8 should work with older Unity versions.
- Upgrading to 1.8+ will break existing atlasses.
## Export options ## Export options
### Meshes ### Meshes
@ -23,4 +24,4 @@ Texture atlas creator tool for Unity. <br> This tool is made to combine textures
## Resources ## Resources
[Youtube video](https://youtu.be/PBRKlopkZP0) <br> [Youtube video](https://youtu.be/PBRKlopkZP0) <br>
[Website](https://maxartz15.com/ma-textureatlasser/) [Website](https://maxartz15.com/ma_textureatlas/)