BMesh: minor optimization counting adjacent data
add BM_***_count_is_over(), _count_is_equal() Useful if we only want to know if the count is a smaller value.
This commit is contained in:
@@ -84,7 +84,7 @@ static PyObject *bpy_bm_utils_vert_collapse_edge(PyObject *UNUSED(self), PyObjec
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (BM_vert_edge_count(py_vert->v) > 2) {
|
||||
if (BM_vert_edge_count_is_over(py_vert->v, 2)) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"vert_collapse_edge(vert, edge): vert has more than 2 connected edges");
|
||||
return NULL;
|
||||
@@ -150,7 +150,7 @@ static PyObject *bpy_bm_utils_vert_collapse_faces(PyObject *UNUSED(self), PyObje
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (BM_vert_edge_count(py_vert->v) > 2) {
|
||||
if (BM_vert_edge_count_is_over(py_vert->v, 2)) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"vert_collapse_faces(vert, edge): vert has more than 2 connected edges");
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user