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/include/ED_mesh.h | |
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/include/ED_mesh.h')
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 68e46dfa0e5..03ca4cd062b 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -31,6 +31,7 @@ struct Mesh; struct Object; struct ReportList; struct Scene; +struct SelectPick_Params; struct UndoType; struct UvMapVert; struct UvVertMap; @@ -268,8 +269,9 @@ bool EDBM_unified_findnearest_from_raycast(struct ViewContext *vc, struct BMEdge **r_eed, struct BMFace **r_efa); -bool EDBM_select_pick( - struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); +bool EDBM_select_pick(struct bContext *C, + const int mval[2], + const struct SelectPick_Params *params); /** * When switching select mode, makes sure selection is consistent for editing @@ -387,12 +389,13 @@ void ED_keymap_mesh(struct wmKeyConfig *keyconf); * use in object mode when selecting faces (while painting). */ void paintface_flush_flags(struct bContext *C, struct Object *ob, short flag); +/** + * \return True when pick finds an element or the selection changed. + */ bool paintface_mouse_select(struct bContext *C, - struct Object *ob, const int mval[2], - bool extend, - bool deselect, - bool toggle); + const struct SelectPick_Params *params, + struct Object *ob); bool paintface_deselect_all_visible(struct bContext *C, struct Object *ob, int action, |