mirror of
https://github.com/maxartz15/MA_TextureAtlasser.git
synced 2025-06-23 19:16:04 +02:00
Fixed importing.
This commit is contained in:
@ -97,14 +97,14 @@ namespace MA_Mesh
|
||||
{
|
||||
if(flipY)
|
||||
{
|
||||
//Debug.Log("01" + uvs[i].x);
|
||||
uvs[i] = new Vector2((uvs[i].x / atlasSize.x * textureRect.width) + (1 / atlasSize.x * textureRect.x), (uvs[i].y / atlasSize.y * textureRect.height) + (1 / atlasSize.y * (atlasSize.y - textureRect.height - textureRect.y)));
|
||||
//Debug.Log("02" + uvs[i].x);
|
||||
uvs[i] = new Vector2((uvs[i].x / atlasSize.x * textureRect.width) + (1 / atlasSize.x * textureRect.x),
|
||||
(uvs[i].y / atlasSize.y * textureRect.height) + (1 / atlasSize.y * (atlasSize.y - textureRect.height - textureRect.y)));
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug.Log("01" + uvs[i].x);
|
||||
uvs[i] = new Vector2((uvs[i].x / atlasSize.x * textureRect.width) + (1 / atlasSize.x * textureRect.x), (uvs[i].y / atlasSize.y * textureRect.height) + (1 / atlasSize.y * textureRect.y));
|
||||
uvs[i] = new Vector2((uvs[i].x / atlasSize.x * textureRect.width) + (1 / atlasSize.x * textureRect.x),
|
||||
(uvs[i].y / atlasSize.y * textureRect.height) + (1 / atlasSize.y * textureRect.y));
|
||||
//Debug.Log("02" + uvs[i].x);
|
||||
}
|
||||
}
|
||||
@ -181,7 +181,6 @@ namespace MA_Mesh
|
||||
using (StreamWriter sw = new StreamWriter(savePath + filename + ".obj"))
|
||||
{
|
||||
sw.Write(MeshToString(mesh));
|
||||
Debug.Log(savePath + filename);
|
||||
}
|
||||
}
|
||||
//End
|
||||
|
@ -191,7 +191,7 @@ namespace MA_Texture
|
||||
//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--)
|
||||
{
|
||||
texture.SetPixel(x + offsetX, texture.height - y - offsetY, combineTexture.GetPixel(x, texture.height - y));
|
||||
texture.SetPixel(x + offsetX, y + (texture.height - offsetY - combineTexture.height), combineTexture.GetPixel(x, y));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user