diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-13 13:36:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-13 13:39:12 +0400 |
commit | 7ae1949517a41fbc46ca452f3fa40e7079273503 (patch) | |
tree | 64c329f903b2e9b70758c8dbf7789b71110bb94b /source/blender/windowmanager/intern | |
parent | f0fb60f8c968f482cefd25db11d080c268c2045d (diff) |
Select Random: add option to de-select
also made metaball operator behave like the others.
Path originally from Walid Shouman, with own edits.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 72ccf4d1015..99437479df1 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1216,6 +1216,12 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } +static void wm_operator_properties_select_action_ex(wmOperatorType *ot, int default_action, + const EnumPropertyItem *select_actions) +{ + RNA_def_enum(ot->srna, "action", select_actions, default_action, "Action", "Selection action to execute"); +} + void WM_operator_properties_select_action(wmOperatorType *ot, int default_action) { static EnumPropertyItem select_actions[] = { @@ -1226,7 +1232,21 @@ void WM_operator_properties_select_action(wmOperatorType *ot, int default_action {0, NULL, 0, NULL, NULL} }; - RNA_def_enum(ot->srna, "action", select_actions, default_action, "Action", "Selection action to execute"); + wm_operator_properties_select_action_ex(ot, default_action, select_actions); +} + +/** + * only SELECT/DESELECT + */ +void WM_operator_properties_select_action_simple(wmOperatorType *ot, int default_action) +{ + static EnumPropertyItem select_actions[] = { + {SEL_SELECT, "SELECT", 0, "Select", "Select all elements"}, + {SEL_DESELECT, "DESELECT", 0, "Deselect", "Deselect all elements"}, + {0, NULL, 0, NULL, NULL} + }; + + wm_operator_properties_select_action_ex(ot, default_action, select_actions); } void WM_operator_properties_select_all(wmOperatorType *ot) |