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/windowmanager | |
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/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index c65f1064830..febf69aa789 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -595,6 +595,8 @@ void WM_toolsystem_link(struct bContext *C, struct WorkSpace *workspace); void WM_toolsystem_set(struct bContext *C, const struct bToolDef *tool); void WM_toolsystem_init(struct bContext *C); +bool WM_toolsystem_active_tool_is_brush(const struct bContext *C); + /* wm_tooltip.c */ typedef struct ARegion *(*wmTooltipInitFn)(struct bContext *, struct ARegion *, bool *); diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 66e84406ebb..690628bbd3b 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -140,3 +140,13 @@ void WM_toolsystem_init(bContext *C) WM_toolsystem_link(C, workspace); } } + +/** + * For paint modes to support non-brush tools. + */ +bool WM_toolsystem_active_tool_is_brush(const bContext *C) +{ + WorkSpace *workspace = CTX_wm_workspace(C); + /* Will need to become more comprehensive, for now check tool data-block. */ + return workspace->tool.data_block[0] != '\0'; +} |