public static void CopyBoneAssignments(SubMesh dst, SubMesh src, Dictionary<uint, uint> vertexIdMap)
{
foreach (KeyValuePair<uint, uint> vertexMapping in vertexIdMap) {
if (!src.BoneAssignmentList.ContainsKey((int)vertexMapping.Key))
continue;
List<VertexBoneAssignment> srcVbaList = src.BoneAssignmentList[(int)vertexMapping.Key];
foreach (VertexBoneAssignment srcVba in srcVbaList) {
Debug.Assert(srcVba.vertexIndex == (int)vertexMapping.Key);
VertexBoneAssignment dstVba = new VertexBoneAssignment();
dstVba.boneIndex = srcVba.boneIndex;
dstVba.vertexIndex = (int)vertexMapping.Value;
dstVba.weight = srcVba.weight;
dst.AddBoneAssignment(dstVba);
}
}
}