Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-13 13:36:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-13 13:39:12 +0400
commit7ae1949517a41fbc46ca452f3fa40e7079273503 (patch)
tree64c329f903b2e9b70758c8dbf7789b71110bb94b /source/blender/windowmanager
parentf0fb60f8c968f482cefd25db11d080c268c2045d (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')
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c22
2 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 8c4c41be84b..046152d07a1 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -249,6 +249,7 @@ void WM_operator_properties_mouse_select(struct wmOperatorType *ot);
void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor);
void WM_operator_properties_select_all(struct wmOperatorType *ot);
void WM_operator_properties_select_action(struct wmOperatorType *ot, int default_action);
+void WM_operator_properties_select_action_simple(struct wmOperatorType *ot, int default_action);
bool WM_operator_check_ui_enabled(const struct bContext *C, const char *idname);
wmOperator *WM_operator_last_redo(const struct bContext *C);
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)