Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-20 20:03:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-20 20:03:34 +0400
commitf8611bac8f805974d71501b323ec4a8adf9405d0 (patch)
tree6356141f42e0aef1a58495c8a65c70455ceceeb3 /source/blender/editors/mesh/editmesh_knife_project.c
parent447de0a6c4b9be8d5ca37d4827f2e3b703657d08 (diff)
- add knife project to toolbar.
- when running knife project, disable vertex selection since it may select areas between the newly cut regions. add EDBM_selectmode_disable() function since loopcut does this too. - (optimization) avoid looping over all geometry when flushing and no selection exists.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_knife_project.c')
-rw-r--r--source/blender/editors/mesh/editmesh_knife_project.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife_project.c b/source/blender/editors/mesh/editmesh_knife_project.c
index c581ce5a2e8..0903dd54208 100644
--- a/source/blender/editors/mesh/editmesh_knife_project.c
+++ b/source/blender/editors/mesh/editmesh_knife_project.c
@@ -51,6 +51,7 @@
#include "WM_types.h"
+#include "ED_mesh.h"
#include "ED_screen.h"
#include "ED_view3d.h"
@@ -137,6 +138,12 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
/* select only tagged faces */
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
+
+ /* note essential, but switch out of vertex mode since the
+ * selected regions wont be nicely isolated after flushing.
+ * note: call after de-select to avoid selection flushing */
+ EDBM_selectmode_disable(scene, em, SCE_SELECT_VERTEX, SCE_SELECT_EDGE);
+
BM_mesh_elem_hflag_enable_test(em->bm, BM_FACE, BM_ELEM_SELECT, true, BM_ELEM_TAG);
BM_mesh_select_mode_flush(em->bm);
@@ -165,4 +172,3 @@ void MESH_OT_knife_project(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
}
-