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-11-21 09:56:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-21 09:56:10 +0300
commit7de712e1e54e6a94cccee25cef207169898507c5 (patch)
treea3d9048512d3c43f8a50d7524d510d348354cc9d /source/blender/blenkernel/intern/paint.c
parent77a80d9f2ff98619c383a1d46e69c1bbcc3a68b7 (diff)
Fix uv-sculpt use w/ tool-system
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r--source/blender/blenkernel/intern/paint.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 24782af4d22..9445981538e 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -689,29 +689,30 @@ bool BKE_paint_ensure(const ToolSettings *ts, struct Paint **r_paint)
paint->flags |= PAINT_SHOW_BRUSH;
+ *r_paint = paint;
+
BKE_paint_runtime_init(ts, paint);
- *r_paint = paint;
return false;
}
void BKE_paint_init(Main *bmain, Scene *sce, ePaintMode mode, const char col[3])
{
UnifiedPaintSettings *ups = &sce->toolsettings->unified_paint_settings;
- Brush *brush;
Paint *paint = BKE_paint_get_active_from_paintmode(sce, mode);
/* If there's no brush, create one */
- brush = BKE_paint_brush(paint);
- if (brush == NULL) {
- eObjectMode ob_mode = BKE_paint_object_mode_from_paintmode(mode);
- brush = BKE_brush_first_search(bmain, ob_mode);
-
- if (!brush) {
- brush = BKE_brush_add(bmain, "Brush", ob_mode);
- id_us_min(&brush->id); /* fake user only */
+ if (PAINT_MODE_HAS_BRUSH(mode)) {
+ Brush *brush = BKE_paint_brush(paint);
+ if (brush == NULL) {
+ eObjectMode ob_mode = BKE_paint_object_mode_from_paintmode(mode);
+ brush = BKE_brush_first_search(bmain, ob_mode);
+ if (!brush) {
+ brush = BKE_brush_add(bmain, "Brush", ob_mode);
+ id_us_min(&brush->id); /* fake user only */
+ }
+ BKE_paint_brush_set(paint, brush);
}
- BKE_paint_brush_set(paint, brush);
}
memcpy(paint->paint_cursor_col, col, 3);