diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-09 09:05:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-09 09:12:07 +0300 |
commit | 80a7c57e5e8d4ea9bec6597a49a1e606875e5d7b (patch) | |
tree | d764e017c9f3b6a749ffb904cdf5ee46e1ded542 /source/blender/editors/gpencil/gpencil_ops.c | |
parent | 39663fd049f00a0dff5cf8d8737aece5efd77520 (diff) |
Tool System: add grease pencil primitive tool
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_ops.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_ops.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index c2e078ff600..a343d9d680d 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -46,6 +46,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "WM_toolsystem.h" #include "RNA_access.h" @@ -91,7 +92,8 @@ static bool gp_stroke_paintmode_draw_poll(bContext *C) Brush *brush = BKE_brush_getactive_gpencil(ts); return ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush && brush->gpencil_settings) && - (brush->gpencil_tool == GPAINT_TOOL_DRAW)); + (brush->gpencil_tool == GPAINT_TOOL_DRAW) && + WM_toolsystem_active_tool_is_brush(C)); } /* Poll callback for stroke painting (erase brush) */ @@ -103,7 +105,8 @@ static bool gp_stroke_paintmode_erase_poll(bContext *C) Brush *brush = BKE_brush_getactive_gpencil(ts); return ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush && brush->gpencil_settings) && - (brush->gpencil_tool == GPAINT_TOOL_ERASE)); + (brush->gpencil_tool == GPAINT_TOOL_ERASE) && + WM_toolsystem_active_tool_is_brush(C)); } /* Poll callback for stroke painting (fill) */ @@ -115,7 +118,8 @@ static bool gp_stroke_paintmode_fill_poll(bContext *C) Brush *brush = BKE_brush_getactive_gpencil(ts); return ((gpd) && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush && brush->gpencil_settings) && - (brush->gpencil_tool == GPAINT_TOOL_FILL)); + (brush->gpencil_tool == GPAINT_TOOL_FILL) && + WM_toolsystem_active_tool_is_brush(C)); } /* Poll callback for stroke sculpting mode */ |