diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-30 07:03:12 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-30 07:03:12 +0300 |
commit | e74880a659270c91db721e9490a2fe15df837760 (patch) | |
tree | f3e7ca07169b6437a6cc87b95c6cfe92f137f4be /source/blender/editors/util | |
parent | 0f33f0de002af1a1c87ddd0fca10a96ae8fa6e15 (diff) |
Cleanup: use utility function to initialize SelectPick_Params
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/select_utils.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/util/select_utils.c b/source/blender/editors/util/select_utils.c index 380c7ed0e43..53f9aca8e8d 100644 --- a/source/blender/editors/util/select_utils.c +++ b/source/blender/editors/util/select_utils.c @@ -10,6 +10,12 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "DNA_windowmanager_types.h" + +#include "RNA_access.h" + +#include "WM_types.h" + #include "ED_select_utils.h" int ED_select_op_action(const eSelectOp sel_op, const bool is_select, const bool is_inside) @@ -113,8 +119,12 @@ bool ED_select_similar_compare_float_tree(const KDTree_1d *tree, return false; } -eSelectOp ED_select_op_from_booleans(const bool extend, const bool deselect, const bool toggle) +eSelectOp ED_select_op_from_operator(wmOperator *op) { + const bool extend = RNA_boolean_get(op->ptr, "extend"); + const bool deselect = RNA_boolean_get(op->ptr, "deselect"); + const bool toggle = RNA_boolean_get(op->ptr, "toggle"); + if (extend) { return SEL_OP_ADD; } @@ -126,3 +136,11 @@ eSelectOp ED_select_op_from_booleans(const bool extend, const bool deselect, con } return SEL_OP_SET; } + +void ED_select_pick_params_from_operator(wmOperator *op, struct SelectPick_Params *params) +{ + memset(params, 0x0, sizeof(*params)); + params->sel_op = ED_select_op_from_operator(op); + params->deselect_all = RNA_boolean_get(op->ptr, "deselect_all"); + params->select_passthrough = RNA_boolean_get(op->ptr, "select_passthrough"); +} |