BMesh: remove exception from face-join function

Callers need to check for NULL, if we need to know exact cause it could be a return arg.
This commit is contained in:
Campbell Barton 2016-05-12 04:42:45 +10:00
parent 1b003511be
commit 135064c45e

@ -1246,7 +1246,6 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
BLI_array_staticdeclare(deledges, BM_DEFAULT_NGON_STACK_SIZE); BLI_array_staticdeclare(deledges, BM_DEFAULT_NGON_STACK_SIZE);
BLI_array_staticdeclare(delverts, BM_DEFAULT_NGON_STACK_SIZE); BLI_array_staticdeclare(delverts, BM_DEFAULT_NGON_STACK_SIZE);
BMVert *v1 = NULL, *v2 = NULL; BMVert *v1 = NULL, *v2 = NULL;
const char *err = NULL;
int i, tote = 0; int i, tote = 0;
const int cd_loop_mdisp_offset = CustomData_get_offset(&bm->ldata, CD_MDISPS); const int cd_loop_mdisp_offset = CustomData_get_offset(&bm->ldata, CD_MDISPS);
@ -1267,7 +1266,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
int rlen = bm_loop_systag_count_radial(l_iter, _FLAG_JF); int rlen = bm_loop_systag_count_radial(l_iter, _FLAG_JF);
if (rlen > 2) { if (rlen > 2) {
err = N_("Input faces do not form a contiguous manifold region"); /* Input faces do not form a contiguous manifold region */
goto error; goto error;
} }
else if (rlen == 1) { else if (rlen == 1) {
@ -1328,9 +1327,8 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
/* create region face */ /* create region face */
f_new = tote ? BM_face_create_ngon(bm, v1, v2, edges, tote, faces[0], BM_CREATE_NOP) : NULL; f_new = tote ? BM_face_create_ngon(bm, v1, v2, edges, tote, faces[0], BM_CREATE_NOP) : NULL;
if (UNLIKELY(!f_new || BMO_error_occurred(bm))) { if (UNLIKELY(f_new == NULL)) {
if (!BMO_error_occurred(bm)) /* Invalid boundary region to join faces */
err = N_("Invalid boundary region to join faces");
goto error; goto error;
} }
@ -1428,9 +1426,6 @@ error:
BLI_array_free(deledges); BLI_array_free(deledges);
BLI_array_free(delverts); BLI_array_free(delverts);
if (err) {
BMO_error_raise(bm, bm->currentop, BMERR_DISSOLVEFACES_FAILED, err);
}
return NULL; return NULL;
} }