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>2018-08-14 03:28:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-14 18:48:55 +0300
commite88e80a6a0c8976ac2d245c274ca5a0388736743 (patch)
tree870bc13538dfb5b55d4063cdab0aa611573dde60 /source/blender/editors/mesh
parentd92d310b158d4b946aa8b811248b25e7a39f7a1a (diff)
3D View boarder/lasso select tool options
Add tool options to control how select operates (add/sub/set/and/xor). Note: edit mode armature select still needs to support all options, this is complicated by how it handles partial end-point selection.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editface.c18
-rw-r--r--source/blender/editors/mesh/editmesh_select.c1
-rw-r--r--source/blender/editors/mesh/mesh_ops.c1
3 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index dde66b8aa13..6c126551228 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -46,6 +46,7 @@
#include "ED_mesh.h"
#include "ED_screen.h"
+#include "ED_select_utils.h"
#include "ED_view3d.h"
#include "WM_api.h"
@@ -391,7 +392,7 @@ bool paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], b
return true;
}
-int do_paintface_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
+int do_paintface_box_select(ViewContext *vc, rcti *rect, int sel_op)
{
Object *ob = vc->obact;
Mesh *me;
@@ -412,7 +413,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, bool select, bool exten
selar = MEM_callocN(me->totpoly + 1, "selar");
- if (extend == false && select) {
+ if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
paintface_deselect_all_visible(vc->obact, SEL_DESELECT, false);
}
@@ -439,13 +440,12 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, bool select, bool exten
mpoly = me->mpoly;
for (a = 1; a <= me->totpoly; a++, mpoly++) {
- if (selar[a]) {
- if (mpoly->flag & ME_HIDE) {
- /* pass */
- }
- else {
- if (select) mpoly->flag |= ME_FACE_SEL;
- else mpoly->flag &= ~ME_FACE_SEL;
+ if ((mpoly->flag & ME_HIDE) == 0) {
+ const bool is_select = mpoly->flag & ME_FACE_SEL;
+ const bool is_inside = (selar[a] != 0);
+ const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside);
+ if (sel_op_result != -1) {
+ SET_FLAG_FROM_TEST(mpoly->flag, sel_op_result, ME_FACE_SEL);
}
}
}
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index cdb8981801a..8c3c9df54dd 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -59,6 +59,7 @@
#include "ED_mesh.h"
#include "ED_screen.h"
+#include "ED_select_utils.h"
#include "ED_view3d.h"
#include "DNA_mesh_types.h"
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index 842a1ecab35..9419caa4d65 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -40,6 +40,7 @@
#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_screen.h"
+#include "ED_select_utils.h"
#include "mesh_intern.h" /* own include */