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-08-23 05:47:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-23 05:47:32 +0300
commit99e6c413738ca001d501397ecf81081b4d23b347 (patch)
treeb51c0b26ea3af47a67fb43f8a809c7610dfc1a19 /source/blender/editors/sculpt_paint/paint_stroke.c
parent5203ebbaad48cb972d9e2ba8845bdb6e1e3e34f8 (diff)
Tool System: support non paint tools in paint mode
This is needed so non-paint-brush tools can be used in paint modes.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index fc008213ae0..b5d68786664 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -1390,7 +1390,15 @@ bool paint_poll(bContext *C)
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
- return p && ob && BKE_paint_brush(p) &&
- (sa && ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) &&
- (ar && ar->regiontype == RGN_TYPE_WINDOW);
+ if (p && ob && BKE_paint_brush(p) &&
+ (sa && ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) &&
+ (ar && ar->regiontype == RGN_TYPE_WINDOW))
+ {
+ /* Check the current tool is a brush. */
+ bToolRef *tref = sa->runtime.tool;
+ if (tref && tref->runtime && tref->runtime->data_block[0]) {
+ return true;
+ }
+ }
+ return false;
}