diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-16 03:23:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-16 03:23:04 +0400 |
commit | bed5ae53660f742546db3467b31f8f390c59942b (patch) | |
tree | f4eef222d05ebaf7deac0efccd0b9912c8026e10 /source/blender/bmesh/intern/bmesh_operators.c | |
parent | 91c1f9ee770d12694425714a3c5966b9693b2ba5 (diff) |
*picky* fix for edge rotate
- Edge rotate would leave verts selected, this would give problems because those selections would leave edges that would try to rotate when run again. now de-select old verts on edge rotate.
- Rotating into hidden verts gave odd results, now make sure hidden state is ok.
- BMO_slot_buffer_hflag_disable / BMO_slot_buffer_hflag_enable now have flushing for the hide flag too.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operators.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index eb83d5f6b35..0d0dc226a24 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -785,26 +785,29 @@ void BMO_slot_buffer_from_flag(BMesh *bm, BMOperator *op, const char *slotname, * using the selection API where appropriate. */ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotname, - const char hflag, const char htype, char do_flush_select) + const char hflag, const char htype, const char do_flush) { BMOpSlot *slot = BMO_slot_get(op, slotname); BMElem **data = slot->data.p; int i; + const char do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT)); + const char do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN)); BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); - if (!(hflag & BM_ELEM_SELECT)) { - do_flush_select = FALSE; - } - - for (i = 0; i < slot->len; i++) { - if (!(htype & data[i]->head.htype)) + for (i = 0; i < slot->len; i++, data++) { + if (!(htype & (*data)->head.htype)) continue; if (do_flush_select) { - BM_elem_select_set(bm, data[i], TRUE); + BM_elem_select_set(bm, *data, TRUE); } - BM_elem_flag_enable(data[i], hflag); + + if (do_flush_hide) { + BM_elem_hide_set(bm, *data, FALSE); + } + + BM_elem_flag_enable(*data, hflag); } } @@ -815,29 +818,32 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam * using the selection API where appropriate. */ void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotname, - const char hflag, const char htype, char do_flush_select) + const char hflag, const char htype, const char do_flush) { BMOpSlot *slot = BMO_slot_get(op, slotname); BMElem **data = slot->data.p; int i; + const char do_flush_select = (do_flush && (hflag & BM_ELEM_SELECT)); + const char do_flush_hide = (do_flush && (hflag & BM_ELEM_HIDDEN)); BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); - if (!(hflag & BM_ELEM_SELECT)) { - do_flush_select = FALSE; - } - - for (i = 0; i < slot->len; i++) { - if (!(htype & data[i]->head.htype)) + for (i = 0; i < slot->len; i++, data++) { + if (!(htype & (*data)->head.htype)) continue; if (do_flush_select) { - BM_elem_select_set(bm, data[i], FALSE); + BM_elem_select_set(bm, *data, FALSE); } - BM_elem_flag_disable(data[i], hflag); + if (do_flush_hide) { + BM_elem_hide_set(bm, *data, FALSE); + } + + BM_elem_flag_disable(*data, hflag); } } + int BMO_vert_edge_flags_count(BMesh *bm, BMVert *v, const short oflag) { int count = 0; |