diff options
author | Matt Ebb <matt@mke3.net> | 2010-06-04 10:02:46 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-06-04 10:02:46 +0400 |
commit | 6255105896679c26caafcd61d21540e98aaf33be (patch) | |
tree | 53f648a84e20fbbc7fa07b4c4ca98ff3be730596 /source/blender/editors/space_view3d/view3d_select.c | |
parent | b0eee216d4e551fc3c344d73983928e97bd59bb0 (diff) |
Fix [#22480] brush/circle select (C-key) causes problems in other modes
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 7fe9ed968c5..714297b7807 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -218,6 +218,23 @@ void arrows_move_cursor(unsigned short event) /* *********************** GESTURE AND LASSO ******************* */ +static int view3d_selectable_data(bContext *C) +{ + Object *ob = CTX_data_active_object(C); + + if (!ED_operator_view3d_active(C)) + return 0; + + if (!CTX_data_edit_object(C)) + if (ob && ob->mode & OB_MODE_SCULPT) + return 0; + if (ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob)) + return 0; + + return 1; +} + + /* helper also for borderselect */ static int edge_fully_inside_rect(rcti *rect, short x1, short y1, short x2, short y2) { @@ -778,7 +795,7 @@ void VIEW3D_OT_select_lasso(wmOperatorType *ot) ot->invoke= WM_gesture_lasso_invoke; ot->modal= WM_gesture_lasso_modal; ot->exec= view3d_lasso_select_exec; - ot->poll= WM_operator_winactive; + ot->poll= view3d_selectable_data; /* flags */ ot->flag= OPTYPE_UNDO; @@ -1706,8 +1723,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) ot->invoke= WM_border_select_invoke; ot->exec= view3d_borderselect_exec; ot->modal= WM_border_select_modal; - - ot->poll= ED_operator_view3d_active; + ot->poll= view3d_selectable_data; /* flags */ ot->flag= OPTYPE_UNDO; @@ -2113,7 +2129,7 @@ void VIEW3D_OT_select_circle(wmOperatorType *ot) ot->invoke= WM_gesture_circle_invoke; ot->modal= WM_gesture_circle_modal; ot->exec= view3d_circle_select_exec; - ot->poll= ED_operator_view3d_active; + ot->poll= view3d_selectable_data; /* flags */ ot->flag= OPTYPE_UNDO; |