diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-01 12:22:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-01 12:23:46 +0300 |
commit | 2c9670b92d32e79d0f071475731bcaf79aae42f5 (patch) | |
tree | 4087292d347f3731ccfbe68018776b3d8174e558 /source/blender/editors/sculpt_paint | |
parent | 1e8021a58af3757e8a4c2a543ddab622b75c00d0 (diff) |
Tool System: support non-brush tools w/ paint modes
Allows select, gradient tools not to conflict with brush keymap.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index dbb12282d0a..06df1632593 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -273,7 +273,9 @@ static int image_paint_poll(bContext *C) obact = CTX_data_active_object(C); if ((obact && obact->mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) { - return 1; + if (WM_toolsystem_active_tool_is_brush(C)) { + return 1; + } } else { SpaceImage *sima = CTX_wm_space_image(C); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 7e9c98d3822..fc43fe97648 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -214,8 +214,11 @@ int vertex_paint_poll(bContext *C) ScrArea *sa = CTX_wm_area(C); if (sa && sa->spacetype == SPACE_VIEW3D) { ARegion *ar = CTX_wm_region(C); - if (ar->regiontype == RGN_TYPE_WINDOW) - return 1; + if (ar->regiontype == RGN_TYPE_WINDOW) { + if (WM_toolsystem_active_tool_is_brush(C)) { + return 1; + } + } } } return 0; @@ -241,7 +244,9 @@ int weight_paint_poll(bContext *C) { ARegion *ar = CTX_wm_region(C); if (ar->regiontype == RGN_TYPE_WINDOW) { - return 1; + if (WM_toolsystem_active_tool_is_brush(C)) { + return 1; + } } } return 0; |