fix for minor glitch in recent addition to create faces from partial selections.

BM_edge_exists() would return an edge if both verts passed match, now assert instead.
This commit is contained in:
Campbell Barton 2013-03-13 14:54:47 +00:00
parent f530adf73d
commit 25e579c631
3 changed files with 7 additions and 4 deletions

@ -157,8 +157,8 @@ static void bm_face_calc_poly_normal_vertex_cos(BMFace *f, float n[3],
/**
* For tools that insist on using triangles, ideally we would cache this data.
*
* \param r_loops Empty array of loops, (f->len)
* \param r_index Empty array of loops, ((f->len - 2) * 3)
* \param r_loops Store face loop pointers, (f->len)
* \param r_index Store triangle triples, indicies into \a r_loops, ((f->len - 2) * 3)
*/
void BM_face_calc_tessellation(BMFace *f, BMLoop **r_loops, int (*_r_index)[3])
{

@ -1352,6 +1352,8 @@ BMEdge *BM_edge_exists(BMVert *v1, BMVert *v2)
BMIter iter;
BMEdge *e;
BLI_assert(v1 != v2);
BM_ITER_ELEM (e, &iter, v1, BM_EDGES_OF_VERT) {
if (e->v1 == v2 || e->v2 == v2)
return e;

@ -1185,8 +1185,9 @@ static BMElem *edbm_add_edge_face_exec__tricky_extend_sel(BMesh *bm)
(BM_edge_share_face_check(e, ed_pair_v2[0]) == false))
)
{
BMEdge *e_other = BM_edge_exists(BM_edge_other_vert(ed_pair_v1[0], e->v1),
BM_edge_other_vert(ed_pair_v2[0], e->v2));
BMVert *v1_other = BM_edge_other_vert(ed_pair_v1[0], e->v1);
BMVert *v2_other = BM_edge_other_vert(ed_pair_v2[0], e->v2);
BMEdge *e_other = (v1_other != v2_other) ? BM_edge_exists(v1_other, v2_other) : NULL;
BM_edge_select_set(bm, ed_pair_v1[0], true);
BM_edge_select_set(bm, ed_pair_v2[0], true);
if (e_other) {