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:
authorHoward Trickey <howard.trickey@gmail.com>2013-11-01 15:42:11 +0400
committerHoward Trickey <howard.trickey@gmail.com>2013-11-01 15:42:11 +0400
commite8c54b682a2ab658a0e87b45f442220c1caaadcd (patch)
tree22044650746182dd21b695a84239848afef9eccb /source/blender/editors/mesh/editmesh_knife_project.c
parent2c57e4f57773f469697bfd788c37decb239af620 (diff)
Add 'cut-through' option for Knife Project operator.
If enabled, it makes knife project act as the cut-through (Shift-K) version of knife. This option will soon be more useful when a better cut-though Knife change is submitted, allowing this to work for cuts within faces in addition to cuts across them.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_knife_project.c')
-rw-r--r--source/blender/editors/mesh/editmesh_knife_project.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife_project.c b/source/blender/editors/mesh/editmesh_knife_project.c
index f473939d0aa..57a85f1162d 100644
--- a/source/blender/editors/mesh/editmesh_knife_project.c
+++ b/source/blender/editors/mesh/editmesh_knife_project.c
@@ -42,6 +42,9 @@
#include "BKE_editmesh.h"
#include "BKE_report.h"
+#include "RNA_define.h"
+#include "RNA_access.h"
+
#include "MEM_guardedalloc.h"
#include "WM_types.h"
@@ -117,6 +120,7 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BKE_editmesh_from_object(obedit);
+ const bool cut_through = RNA_boolean_get(op->ptr, "cut_through");
LinkNode *polys = NULL;
@@ -129,7 +133,7 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
if (polys) {
- EDBM_mesh_knife(C, polys, true);
+ EDBM_mesh_knife(C, polys, true, cut_through);
/* select only tagged faces */
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
@@ -166,4 +170,7 @@ void MESH_OT_knife_project(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
+
+ /* parameters */
+ RNA_def_boolean(ot->srna, "cut_through", false, "Cut through", "Cut through all faces, not just visible ones");
}