diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2020-02-14 18:58:32 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2020-02-14 19:15:15 +0300 |
commit | 9b243b9a53ca48f5dba1142170944174716bbd72 (patch) | |
tree | 0580aa552453ed2a8d372deca3393612ed8d11f7 | |
parent | 332aed6399a69070f6ad3ef8c81740cddc6ee4fa (diff) |
Fix failing assert & uninitialized paint settings in empty scene
Steps to reproduce were:
* Add new (empty) scene
* Add some mesh object
* Change to texture paint mode
While it can be argued that we should already init the settings when
creating a new scene (so that the texture tab can show up),
BKE_paint_init() should always ensure paint settings are initialized
either way.
Related to T73611.
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index e72540ed499..2cc1681d436 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -771,6 +771,8 @@ void BKE_paint_init(Main *bmain, Scene *sce, ePaintMode mode, const char col[3]) UnifiedPaintSettings *ups = &sce->toolsettings->unified_paint_settings; Paint *paint = BKE_paint_get_active_from_paintmode(sce, mode); + BKE_paint_ensure_from_paintmode(sce, mode); + /* If there's no brush, create one */ if (PAINT_MODE_HAS_BRUSH(mode)) { Brush *brush = BKE_paint_brush(paint); |