diff options
author | Nathan Vegdahl <cessen@cessen.com> | 2012-05-25 01:05:27 +0400 |
---|---|---|
committer | Nathan Vegdahl <cessen@cessen.com> | 2012-05-25 01:05:27 +0400 |
commit | 19e1d05461abafc32b5d952d5121f765f4208f94 (patch) | |
tree | 5c1f496aa0f00bb605b5c7bd8d69d02534d4c5c6 /source/blender/editors/curve | |
parent | 9dc161e8edc421463d4bb0b6237770b4656ca2a7 (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/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index aa29100ccbe..431ce15a26d 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4126,7 +4126,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot) /***************** pick select from 3d view **********************/ -int mouse_nurb(bContext *C, const int mval[2], int extend) +int mouse_nurb(bContext *C, const int mval[2], int extend, int deselect, int toggle) { Object *obedit = CTX_data_edit_object(C); Curve *cu = obedit->data; @@ -4146,12 +4146,8 @@ int mouse_nurb(bContext *C, const int mval[2], int extend) hand = findnearestNurbvert(&vc, 1, location, &nu, &bezt, &bp); if (bezt || bp) { - if (extend == 0) { - - setflagsNurb(editnurb, 0); - + if (extend) { if (bezt) { - if (hand == 1) { select_beztriple(bezt, SELECT, 1, HIDDEN); cu->lastsel = bezt; @@ -4167,9 +4163,26 @@ int mouse_nurb(bContext *C, const int mval[2], int extend) cu->lastsel = bp; select_bpoint(bp, SELECT, 1, HIDDEN); } - } - else { + else if (deselect) { + if (bezt) { + if (hand == 1) { + select_beztriple(bezt, DESELECT, 1, HIDDEN); + if (bezt == cu->lastsel) cu->lastsel = NULL; + } + else if (hand == 0) { + bezt->f1 &= ~SELECT; + } + else { + bezt->f3 &= ~SELECT; + } + } + else { + select_bpoint(bp, DESELECT, 1, HIDDEN); + if (cu->lastsel == bp) cu->lastsel = NULL; + } + } + else if (toggle) { if (bezt) { if (hand == 1) { if (bezt->f2 & SELECT) { @@ -4198,7 +4211,27 @@ int mouse_nurb(bContext *C, const int mval[2], int extend) cu->lastsel = bp; } } + } + else { + setflagsNurb(editnurb, 0); + if (bezt) { + + if (hand == 1) { + select_beztriple(bezt, SELECT, 1, HIDDEN); + cu->lastsel = bezt; + } + else { + if (hand == 0) bezt->f1 |= SELECT; + else bezt->f3 |= SELECT; + + cu->lastsel = NULL; + } + } + else { + cu->lastsel = bp; + select_bpoint(bp, SELECT, 1, HIDDEN); + } } if (nu != get_actNurb(obedit)) |