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:
authorNathan Vegdahl <cessen@cessen.com>2012-05-25 01:05:27 +0400
committerNathan Vegdahl <cessen@cessen.com>2012-05-25 01:05:27 +0400
commit19e1d05461abafc32b5d952d5121f765f4208f94 (patch)
tree5c1f496aa0f00bb605b5c7bd8d69d02534d4c5c6 /source/blender/editors/metaball
parent9dc161e8edc421463d4bb0b6237770b4656ca2a7 (diff)
Modifications to the view3d.select() operator:
1. Two new boolean options have been added to the operator: "deselect" and "toggle". 2. The previous behavior of "extend" (toggling the selection) has been moved to the "toggle" option. 3. "extend" now only extends the selection, it never deselects. 4. "deselect" is pretty self-explanatory: it deselects (i.e. opposite of extend). 5. The built-in keymap has been changed to use "toggle" where "extend" was used before for this operator, to maintain the previous behavior in the default keymap. In short, this works towards making "extend" and "deselect" fully consistent across all selection tools (adding to and removing from selection, respectively), but still preserves the old behavior as well. (Patch reviewed by Brecht.)
Diffstat (limited to 'source/blender/editors/metaball')
-rw-r--r--source/blender/editors/metaball/mball_edit.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index 701a3517535..7b7aaf5a3db 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -415,7 +415,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
/* Select MetaElement with mouse click (user can select radius circle or
* stiffness circle) */
-int mouse_mball(bContext *C, const int mval[2], int extend)
+int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int toggle)
{
static MetaElem *startelem = NULL;
Object *obedit = CTX_data_edit_object(C);
@@ -467,7 +467,19 @@ int mouse_mball(bContext *C, const int mval[2], int extend)
/* When some metaelem was found, then it is necessary to select or
* deselect it. */
if (act) {
- if (extend == 0) {
+ if (extend) {
+ act->flag |= SELECT;
+ }
+ else if (deselect) {
+ act->flag &= ~SELECT;
+ }
+ else if (toggle) {
+ if (act->flag & SELECT)
+ act->flag &= ~SELECT;
+ else
+ act->flag |= SELECT;
+ }
+ else {
/* Deselect all existing metaelems */
ml = mb->editelems->first;
while (ml) {
@@ -477,12 +489,7 @@ int mouse_mball(bContext *C, const int mval[2], int extend)
/* Select only metaelem clicked on */
act->flag |= SELECT;
}
- else {
- if (act->flag & SELECT)
- act->flag &= ~SELECT;
- else
- act->flag |= SELECT;
- }
+
mb->lastelem = act;
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, mb);