Hi,
What may cause mesh topologyvertex change order?
Here I duplicate meshes and set their vertices to a new position.
When I output vertex list it is the same as original. I also see mesh faces correctly.
But vertextopolgy is not the same and it shifts from frame to frame. I see all mesh faces correctly too.
Or is it possible to change the vertex typology order of the mesh?
Mesh[] tempMeshes = new Mesh[meshes.Length];
int loop = 0;
for (int k = 0; k < meshes.Length; k++)
{
Mesh tempMesh = meshes[k].DuplicateMesh();
var tp = meshes[k].TopologyVertices;
for (int i = 0; i < tp.Count; i++)
{
int index = tp.TopologyVertexIndex(i);
tempMesh.Vertices.SetVertex(i, PS.GetPosition(loop + index));
}
loop += meshes[k].Vertices.Count;
tempMeshes[k]=tempMesh;
}
DA.SetDataList(0, tempMeshes[0].TopologyVertices);//Order that changes from frame to frame
DA.SetDataList(1, meshes[0].TopologyVertices); //Original order
DA.SetDataList(2, tempMeshes[0].Vertices); //Same order
DA.SetDataList(3, meshes[0].Vertices); //Original order
David Rutten
Topological vertices are sorted along X (then Y, then Z). This speeds up the building of the topology, but it does mean you cannot rely on the order of topological vertices to be the same as the regular vertices. You must look at the index mapping on each topological vertex to see which regular vertices are associated with it.
Nov 7, 2016