Cleanup: Make mesh validation functions static
These functions used internal values and only really make sense in the context of the mesh validation process where they're used to remove invalid elements from the mesh.
This commit is contained in:
@@ -871,15 +871,6 @@ bool BKE_mesh_validate_all_customdata(struct CustomData *vdata,
|
||||
bool *r_change);
|
||||
|
||||
void BKE_mesh_strip_loose_faces(struct Mesh *me);
|
||||
/**
|
||||
* Works on both loops and polys!
|
||||
*
|
||||
* \note It won't try to guess which loops of an invalid poly to remove!
|
||||
* this is the work of the caller, to mark those loops.
|
||||
* See e.g. #BKE_mesh_validate_arrays().
|
||||
*/
|
||||
void BKE_mesh_strip_loose_polysloops(struct Mesh *me);
|
||||
void BKE_mesh_strip_loose_edges(struct Mesh *me);
|
||||
|
||||
/**
|
||||
* Calculate edges from polygons.
|
||||
@@ -921,7 +912,7 @@ void BKE_mesh_debug_print(const struct Mesh *me) ATTR_NONNULL(1);
|
||||
|
||||
/**
|
||||
* \return The material index for each polygon. May be null.
|
||||
* \note In C++ code, prefer using the attribute API (#MutableAttributeAccessor)/
|
||||
* \note In C++ code, prefer using the attribute API (#AttributeAccessor).
|
||||
*/
|
||||
BLI_INLINE const int *BKE_mesh_material_indices(const Mesh *mesh)
|
||||
{
|
||||
@@ -930,7 +921,7 @@ BLI_INLINE const int *BKE_mesh_material_indices(const Mesh *mesh)
|
||||
|
||||
/**
|
||||
* \return The material index for each polygon. Create the layer if it doesn't exist.
|
||||
* \note In C++ code, prefer using the attribute API (#MutableAttributeAccessor)/
|
||||
* \note In C++ code, prefer using the attribute API (#MutableAttributeAccessor).
|
||||
*/
|
||||
BLI_INLINE int *BKE_mesh_material_indices_for_write(Mesh *mesh)
|
||||
{
|
||||
|
||||
@@ -42,6 +42,9 @@ using blender::Span;
|
||||
|
||||
static CLG_LogRef LOG = {"bke.mesh"};
|
||||
|
||||
void mesh_strip_polysloops(Mesh *me);
|
||||
void mesh_strip_edges(Mesh *me);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Internal functions
|
||||
* \{ */
|
||||
@@ -862,11 +865,11 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
|
||||
}
|
||||
|
||||
if (free_flag.polyloops) {
|
||||
BKE_mesh_strip_loose_polysloops(mesh);
|
||||
mesh_strip_polysloops(mesh);
|
||||
}
|
||||
|
||||
if (free_flag.edges) {
|
||||
BKE_mesh_strip_loose_edges(mesh);
|
||||
mesh_strip_edges(mesh);
|
||||
}
|
||||
|
||||
if (recalc_flag.edges) {
|
||||
@@ -1205,7 +1208,7 @@ void BKE_mesh_strip_loose_faces(Mesh *me)
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_mesh_strip_loose_polysloops(Mesh *me)
|
||||
void mesh_strip_polysloops(Mesh *me)
|
||||
{
|
||||
MutableSpan<MPoly> polys = me->polys_for_write();
|
||||
MutableSpan<MLoop> loops = me->loops_for_write();
|
||||
@@ -1279,7 +1282,7 @@ void BKE_mesh_strip_loose_polysloops(Mesh *me)
|
||||
MEM_freeN(new_idx);
|
||||
}
|
||||
|
||||
void BKE_mesh_strip_loose_edges(Mesh *me)
|
||||
void mesh_strip_edges(Mesh *me)
|
||||
{
|
||||
MEdge *e;
|
||||
int a, b;
|
||||
|
||||
Reference in New Issue
Block a user