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:
authorAntonioya <blendergit@gmail.com>2018-11-22 18:26:17 +0300
committerAntonioya <blendergit@gmail.com>2018-11-22 18:26:39 +0300
commit76ea125c2ef10836bbde50e37c954826c0463816 (patch)
tree68718544ed3fd0caa5117612de6059a29569fddd /source/blender/blenloader/intern/versioning_defaults.c
parent6a3451fe4ef3de686b40a6701b8c7085844df1a5 (diff)
GP: Keep activated the same Brush in toolbar
Diffstat (limited to 'source/blender/blenloader/intern/versioning_defaults.c')
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index d6c1a5a6b98..420e3738427 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -48,6 +48,7 @@
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
+#include "BKE_paint.h"
#include "BKE_screen.h"
#include "BKE_workspace.h"
@@ -253,6 +254,9 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
/* create new hard brush (only create one, but need ToolSettings) */
br = (Brush *)BKE_libblock_find_name(bmain, ID_BR, "Eraser Hard");
if (!br) {
+ Paint *paint = &ts->gp_paint->paint;
+ Brush *old_brush = paint->brush;
+
br = BKE_brush_add_gpencil(bmain, ts, "Eraser Hard");
br->size = 30.0f;
br->gpencil_settings->draw_strength = 1.0f;
@@ -262,6 +266,9 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
br->gpencil_settings->eraser_mode = GP_BRUSH_ERASER_SOFT;
br->gpencil_settings->era_strength_f = 100.0f;
br->gpencil_settings->era_thickness_f = 50.0f;
+
+ /* back to default brush */
+ BKE_paint_brush_set(paint, old_brush);
}
}
}