diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-15 13:03:04 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-16 06:48:25 +0300 |
commit | 5e5285baf621a0c225cb5fc06fcec6ffed8302d7 (patch) | |
tree | fcdc655a6b063d32a7630b648e126c20ade295f2 /source/blender/editors/mesh/editmesh_tools.c | |
parent | 9a763d24f2b50ad38d22cad0a23d7344afe5f1c7 (diff) |
View 3D: move picking arguments into a struct & minor refactor
- Add SelectPick_Params struct to make picking logic more
straightforward and easier to extend.
- Use `eSelectOp` instead of booleans (extend, deselect, toggle)
which were used to represent 4 states (which wasn't obvious).
- Handle deselect_all when pocking instead of view3d_select_exec,
de-duplicate de-selection which was already needed in when replacing
the selection in picking functions.
- Handle outliner update & notifiers in the picking functions
instead of view3d_select_exec.
- Fix particle select deselect_all option which did nothing.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 54cc3efe986..10d121ffd32 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -57,6 +57,7 @@ #include "ED_object.h" #include "ED_outliner.h" #include "ED_screen.h" +#include "ED_select_utils.h" #include "ED_transform.h" #include "ED_uvedit.h" #include "ED_view3d.h" @@ -8540,7 +8541,10 @@ static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent * case EDBM_CLNOR_MODAL_POINTTO_SET_USE_SELECTED: new_mode = EDBM_CLNOR_POINTTO_MODE_COORDINATES; view3d_operator_needs_opengl(C); - if (EDBM_select_pick(C, event->mval, false, false, false)) { + const struct SelectPick_Params params = { + .sel_op = SEL_OP_SET, + }; + if (EDBM_select_pick(C, event->mval, ¶ms)) { /* Point to newly selected active. */ ED_object_calc_active_center_for_editmode(obedit, false, target); |