From 5e5285baf621a0c225cb5fc06fcec6ffed8302d7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Mar 2022 21:03:04 +1100 Subject: 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. --- source/blender/editors/include/ED_mball.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/include/ED_mball.h') diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h index e0c921ea0db..74071765716 100644 --- a/source/blender/editors/include/ED_mball.h +++ b/source/blender/editors/include/ED_mball.h @@ -13,6 +13,7 @@ extern "C" { struct Base; struct Object; +struct SelectPick_Params; struct UndoType; struct bContext; struct wmKeyConfig; @@ -32,10 +33,13 @@ struct MetaElem *ED_mball_add_primitive(struct bContext *C, int type); /** - * Select MetaElement with mouse click (user can select radius circle or stiffness circle). + * Select meta-element with mouse click (user can select radius circle or stiffness circle). + * + * \return True when pick finds an element or the selection changed. */ -bool ED_mball_select_pick( - struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); +bool ED_mball_select_pick(struct bContext *C, + const int mval[2], + const struct SelectPick_Params *params); bool ED_mball_deselect_all_multi_ex(struct Base **bases, uint bases_len); bool ED_mball_deselect_all_multi(struct bContext *C); -- cgit v1.2.3