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.
This commit is contained in:
Julian Eisel 2020-02-14 16:58:32 +01:00
parent 332aed6399
commit 9b243b9a53
Notes: blender-bot 2023-02-14 05:12:59 +01:00
Referenced by issue #73611, "Texture properties" tab hidden after creating "New Scene"
1 changed files with 2 additions and 0 deletions

View File

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