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-03 08:52:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-03 08:52:06 +0300
commit888a0735eee5fbe05fc60d8755d83974a2f74680 (patch)
tree3ff8fb4e0712303b36ec7ddf9cbd6bf0c072e35e /source/blender/editors/sculpt_paint/paint_vertex.c
parent13c3c9b22fd8453d4418577efbc2ccb93209e92e (diff)
Tool System: validate tool slots when setting modes
Needed for entering paint modes on new scenes.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 7b3cfe184f5..94aeeb5d158 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1247,6 +1247,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
const int mode_flag = OB_MODE_WEIGHT_PAINT;
const bool is_mode_set = (ob->mode & mode_flag) != 0;
Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = scene->toolsettings;
if (!is_mode_set) {
if (!ED_object_mode_compat_set(C, ob, mode_flag, op->reports)) {
@@ -1263,6 +1264,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C);
wmWindowManager *wm = CTX_wm_manager(C);
ED_object_wpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
+ BKE_paint_toolslots_brush_validate(bmain, scene, &ts->wpaint->paint);
}
/* Weightpaint works by overriding colors in mesh,
@@ -2390,6 +2392,7 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
const int mode_flag = OB_MODE_VERTEX_PAINT;
const bool is_mode_set = (ob->mode & mode_flag) != 0;
Scene *scene = CTX_data_scene(C);
+ ToolSettings *ts = scene->toolsettings;
if (!is_mode_set) {
if (!ED_object_mode_compat_set(C, ob, mode_flag, op->reports)) {
@@ -2407,6 +2410,7 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C);
wmWindowManager *wm = CTX_wm_manager(C);
ED_object_vpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
+ BKE_paint_toolslots_brush_validate(bmain, scene, &ts->wpaint->paint);
}
BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL);