Mesh: Replace MLoop struct with generic attributes #104424

Merged
Hans Goudey merged 261 commits from refactor-mesh-corners-generic into main 2023-03-20 15:55:25 +01:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 17fca6f30c - Show all commits

View File

@ -336,7 +336,7 @@ static bool dyntopo_supports_customdata_layers(const blender::Span<CustomDataLay
return BM_attribute_stored_in_bmesh_builtin(layer.name);
}
/* Some layers just encode #Mesh topology or are handled as special cases for dyntopo. */
return ELEM(layer.type, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MPOLY, CD_PAINT_MASK, CD_ORIGINDEX);
return ELEM(layer.type, CD_MEDGE, CD_MFACE, CD_MPOLY, CD_PAINT_MASK, CD_ORIGINDEX);
}
return true;

View File

@ -48,7 +48,8 @@ Mesh *convert_ply_to_mesh(PlyData &data, Mesh *mesh, const PLYImportParams &para
mesh->totloop += data.faces[i].size();
}
CustomData_add_layer(&mesh->pdata, CD_MPOLY, CD_SET_DEFAULT, nullptr, mesh->totpoly);
CustomData_add_layer(&mesh->ldata, CD_MLOOP, CD_SET_DEFAULT, nullptr, mesh->totloop);
CustomData_add_layer_named(
&mesh->ldata, CD_PROP_INT32, CD_CONSTRUCT, nullptr, mesh->totloop, ".corner_vert");
MutableSpan<MPoly> polys = mesh->polys_for_write();
MutableSpan<int> corner_verts = mesh->corner_verts_for_write();