Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-05-01 12:22:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-01 12:23:46 +0300
commit2c9670b92d32e79d0f071475731bcaf79aae42f5 (patch)
tree4087292d347f3731ccfbe68018776b3d8174e558 /source/blender/windowmanager
parent1e8021a58af3757e8a4c2a543ddab622b75c00d0 (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.h2
-rw-r--r--source/blender/windowmanager/intern/wm_toolsystem.c10
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';
+}