diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-05 20:32:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-05 20:32:06 +0300 |
commit | 8109b13e8369418f81ffa4f362f40d4d2f783851 (patch) | |
tree | 42d741f98110ea3564fd28e774756faf60b05602 /source/blender/editors/space_view3d/view3d_select.c | |
parent | aec5fb98041a369d30c4f3c07981169a2e12a5ae (diff) |
- converted circle select use a modal map
- now works exactly like 2.4x, except that its accessed from the CKey
- hack to remember circle size, need some better way to do this
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 0c90347063f..04658df3861 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1917,17 +1917,20 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) int x= RNA_int_get(op->ptr, "x"); int y= RNA_int_get(op->ptr, "y"); int radius= RNA_int_get(op->ptr, "radius"); + int gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); + int selecting; + selecting= (gesture_mode==GESTURE_MODAL_SELECT); + if(CTX_data_edit_object(C) || (obact && obact->mode & OB_MODE_PARTICLE_EDIT)) { ViewContext vc; - short mval[2], selecting; + short mval[2]; view3d_operator_needs_opengl(C); view3d_set_viewcontext(C, &vc); mval[0]= x; mval[1]= y; - selecting= LEFTMOUSE==RNA_int_get(op->ptr, "event_type"); // XXX solve if(CTX_data_edit_object(C)) { obedit_circle_select(&vc, selecting, mval, (float)radius); @@ -1938,7 +1941,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) } else { Base *base; - + selecting= selecting?BA_SELECT:BA_DESELECT; for(base= FIRSTBASE; base; base= base->next) { if(base->lay & v3d->lay) { project_short(ar, base->object->obmat[3], &base->sx); @@ -1946,7 +1949,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) int dx= base->sx-x; int dy= base->sy-y; if( dx*dx + dy*dy < radius*radius) - ED_base_object_select(base, BA_SELECT); + ED_base_object_select(base, selecting); } } } @@ -1974,5 +1977,5 @@ void VIEW3D_OT_select_circle(wmOperatorType *ot) RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "radius", 0, INT_MIN, INT_MAX, "Radius", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); } |