diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-19 20:20:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-19 20:20:07 +0400 |
commit | bea1a127511ff7659dcff7a30f2af46fc8a29304 (patch) | |
tree | d8e07aaf1aeb2bc7c27f442f49d08113b4f793ee /source/blender | |
parent | 6b006059ec55c6d0f0c8e7302b9b16bb81ee2365 (diff) |
fix [#31015] Rip has weird results in vertex selection mode vs face
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 43e9b885037..7ccfaf6074e 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -31,6 +31,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_scene_types.h" #include "DNA_object_types.h" #include "RNA_define.h" @@ -361,6 +362,25 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) EdgeLoopPair *eloop_pairs; + /* running in face mode hardly makes sense, if we try to run code below it almost works ok + * but doesnt make sense logically because ripping is supposed to rip an edge apart. + * + * Rather then disable, we can split in this case + */ + if (em->selectmode == SCE_SELECT_FACE) { + EDBM_op_init(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, TRUE); + BMO_op_exec(em->bm, &bmop); + BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE); + BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ALL, BM_ELEM_SELECT, TRUE); + if (!EDBM_op_finish(em, &bmop, op, TRUE)) { + return OPERATOR_CANCELLED; + } + else { + return OPERATOR_FINISHED; + } + } + + /* note on selection: * When calling edge split we operate on tagged edges rather then selected * this is important because the edges to operate on are extended by one, |