forked from bartvdbraak/blender
Remove paranoid null checks for editmesh EDBM_vert_at_index and friends (use asserts instead).
temp set BM_OMP_LIMIT to zero for better testing before release.
This commit is contained in:
parent
06e1bc6178
commit
d54d00ef84
@ -290,6 +290,6 @@ extern void bpy_bm_generic_invalidate(struct BPy_BMGeneric *self);
|
||||
* but should not error on valid cases */
|
||||
#define BM_LOOP_RADIAL_MAX 10000
|
||||
#define BM_NGON_MAX 100000
|
||||
#define BM_OMP_LIMIT 10000 /* setting zero so we can catch bugs in OpenMP/BMesh */
|
||||
#define BM_OMP_LIMIT 0 /* 10000 */ /* setting zero so we can catch bugs in OpenMP/BMesh */
|
||||
|
||||
#endif /* __BMESH_CLASS_H__ */
|
||||
|
@ -498,6 +498,8 @@ static int bm_mesh_flag_count(BMesh *bm, const char htype, const char hflag,
|
||||
BMIter iter;
|
||||
int tot = 0;
|
||||
|
||||
BLI_assert((htype & ~BM_ALL_NOLOOP) == 0);
|
||||
|
||||
if (htype & BM_VERT) {
|
||||
for (ele = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); ele; ele = BM_iter_step(&iter)) {
|
||||
if (respecthide && BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) continue;
|
||||
@ -803,6 +805,8 @@ void BM_mesh_elem_hflag_disable_test(BMesh *bm, const char htype, const char hfl
|
||||
|
||||
int i;
|
||||
|
||||
BLI_assert((htype & ~BM_ALL_NOLOOP) == 0);
|
||||
|
||||
if (hflag & BM_ELEM_SELECT) {
|
||||
BM_select_history_clear(bm);
|
||||
}
|
||||
@ -872,6 +876,8 @@ void BM_mesh_elem_hflag_enable_test(BMesh *bm, const char htype, const char hfla
|
||||
BMElem *ele;
|
||||
int i;
|
||||
|
||||
BLI_assert((htype & ~BM_ALL_NOLOOP) == 0);
|
||||
|
||||
if (hflag & BM_ELEM_SELECT) {
|
||||
BM_select_history_clear(bm);
|
||||
}
|
||||
|
@ -628,6 +628,8 @@ void BM_mesh_elem_index_validate(BMesh *bm, const char *location, const char *fu
|
||||
*/
|
||||
int BM_mesh_elem_count(BMesh *bm, const char htype)
|
||||
{
|
||||
BLI_assert((htype & ~BM_ALL_NOLOOP) == 0);
|
||||
|
||||
switch (htype) {
|
||||
case BM_VERT: return bm->totvert;
|
||||
case BM_EDGE: return bm->totedge;
|
||||
|
@ -507,17 +507,20 @@ bool EDBM_index_arrays_check(BMEditMesh *em)
|
||||
|
||||
BMVert *EDBM_vert_at_index(BMEditMesh *em, int index)
|
||||
{
|
||||
return em->vert_index && index < em->bm->totvert ? em->vert_index[index] : NULL;
|
||||
BLI_assert((index >= 0) && (index < em->bm->totvert));
|
||||
return em->vert_index[index];
|
||||
}
|
||||
|
||||
BMEdge *EDBM_edge_at_index(BMEditMesh *em, int index)
|
||||
{
|
||||
return em->edge_index && index < em->bm->totedge ? em->edge_index[index] : NULL;
|
||||
BLI_assert((index >= 0) && (index < em->bm->totedge));
|
||||
return em->edge_index[index];
|
||||
}
|
||||
|
||||
BMFace *EDBM_face_at_index(BMEditMesh *em, int index)
|
||||
{
|
||||
return (em->face_index && index < em->bm->totface && index >= 0) ? em->face_index[index] : NULL;
|
||||
BLI_assert((index >= 0) && (index < em->bm->totface));
|
||||
return em->face_index[index];
|
||||
}
|
||||
|
||||
void EDBM_selectmode_flush_ex(BMEditMesh *em, const short selectmode)
|
||||
|
@ -237,7 +237,7 @@ static void mesh_foreachScreenFace__mapFunc(void *userData, int index, const flo
|
||||
foreachScreenFace_userData *data = userData;
|
||||
BMFace *efa = EDBM_face_at_index(data->vc.em, index);
|
||||
|
||||
if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
|
||||
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
|
||||
float screen_co[2];
|
||||
if (ED_view3d_project_float_object(data->vc.ar, cent, screen_co, data->clip_flag) == V3D_PROJ_RET_OK) {
|
||||
data->func(data->userData, efa, screen_co, index);
|
||||
|
Loading…
Reference in New Issue
Block a user