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:
2015-04-12 15:21:40 +10:00
parent 6d2c3a2456
commit 690b90f1e2
14 changed files with 161 additions and 41 deletions

View File

@@ -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;