[Bf-blender-cvs] [9b243b9a53c] master: Fix failing assert & uninitialized paint settings in empty scene

Julian Eisel noreply at git.blender.org
Fri Feb 14 17:18:19 CET 2020


Commit: 9b243b9a53ca48f5dba1142170944174716bbd72
Author: Julian Eisel
Date:   Fri Feb 14 16:58:32 2020 +0100
Branches: master
https://developer.blender.org/rB9b243b9a53ca48f5dba1142170944174716bbd72

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.

===================================================================

M	source/blender/blenkernel/intern/paint.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list