Closed transcendtient closed 3 years ago
Line 690 MecanimToTexture
List<Vector2> resultUV = new List<Vector2>(); mesh.GetUVs((int)uvLayer, resultUV); ... for (int i = 0; i < resultUV.Count; i++)
List<Vector2> resultUV = new List<Vector2>();
mesh.GetUVs((int)uvLayer, resultUV);
for (int i = 0; i < resultUV.Count; i++)
resultUV.Count will always be 0 for uninitialized UVs. E.G. writing to a new UV channel will be unsuccessful always.
Since UV0 is the default channel for most applications I hardcoded this: List<Vector2> resultUV = new List<Vector2>(); mesh.GetUVs(0, resultUV);
List<Vector2> resultUV = new List<Vector2>(); mesh.GetUVs(0, resultUV);
Thanks! I've pushed a fix on the dev branch, with an extra failsafe just in case every UV channel is empty. I'll be merging it into the main branch sometime in the near future with your other request ( #2 )
Line 690 MecanimToTexture
List<Vector2> resultUV = new List<Vector2>();
mesh.GetUVs((int)uvLayer, resultUV);
...for (int i = 0; i < resultUV.Count; i++)
resultUV.Count will always be 0 for uninitialized UVs. E.G. writing to a new UV channel will be unsuccessful always.
Since UV0 is the default channel for most applications I hardcoded this:
List<Vector2> resultUV = new List<Vector2>(); mesh.GetUVs(0, resultUV);