[Mesh] Unity 4 to Unity 5 Mesh Export
Hi, i'm having issues with exporting mesh data from Unity 4 to Unity 5 by collecting the MeshFilter.sharedMesh.vertices, MeshFilter.sharedMesh.uv etc.
In editor mode i'm setting arrays in Unity4 for every GO with a MeshFilter (see below). The arrays contains its needed mesh data, the same array is applied to the MeshFilter.sharedMesh in Unity 5 using:
MeshFilter mf;
if (mf = GetComponent<MeshFilter>())
{
mf.sharedMesh.Clear();
mf.sharedMesh.vertices = m_Verts;
mf.sharedMesh.uv = m_UV2;
mf.sharedMesh.triangles = m_Triangles;
mf.sharedMesh.normals = m_Normals;
}
The mesh itself is re-created fine, however the UVs are always offset incorrectly - as if unity 5's Mesh class expects them in a different order or space?
Does anyone have any insight into this they can share, or been able to successfully copy mesh data from unity4 to 5? Has the Unity 5 Mesh class changed the way it handles UVs that might be the cause?
The reason i'm doing all this is to use the lightmap data and the Auto-Generated UV2's from the Unity4 scenes in Unity5.
Many thanks
Your answer
Follow this Question
Related Questions
Is it possible to change a vertex (height) after combining meshes? 1 Answer
5.6.2 lightmapping HELP!! 1 Answer
Code generated mesh not visible 1 Answer
How to combine meshes for trees 0 Answers