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-21 20:03:38 +0300
committerAntonioya <blendergit@gmail.com>2018-11-21 20:04:08 +0300
commit2261aed031d81680c38f9ad3f9b07a9ac449526b (patch)
tree9064e90d711f1a90d8238a4353f03c67d83a9e90 /source/blender/blenloader/intern/versioning_defaults.c
parent96e39af9481cdaf644a80936af5dda2539d60cf9 (diff)
GP: Init new Eraser Hard
Diffstat (limited to 'source/blender/blenloader/intern/versioning_defaults.c')
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 2fd332c460f..ec5c8e70d12 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -42,8 +42,10 @@
#include "DNA_windowmanager_types.h"
#include "DNA_workspace_types.h"
+#include "BKE_brush.h"
#include "BKE_colortools.h"
#include "BKE_layer.h"
+#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_screen.h"
@@ -234,4 +236,30 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
mesh->smoothresh = DEG2RADF(30);
}
}
+
+ /* Grease Pencil New Eraser Brush */
+ if (builtin_template) {
+ Brush *br;
+ /* Rename old Hard Eraser */
+ br = (Brush *)BKE_libblock_find_name(bmain, ID_BR, "Eraser Hard");
+ if (br) {
+ strcpy(br->id.name, "BREraser Point");
+ }
+ for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+ ToolSettings *ts = scene->toolsettings;
+ /* create new hard brush (only create one, but need ToolSettings) */
+ br = (Brush *)BKE_libblock_find_name(bmain, ID_BR, "Eraser Hard");
+ if (!br) {
+ br = BKE_brush_add_gpencil(bmain, ts, "Eraser Hard");
+ br->size = 30.0f;
+ br->gpencil_settings->draw_strength = 1.0f;
+ br->gpencil_settings->flag = (GP_BRUSH_ENABLE_CURSOR | GP_BRUSH_DEFAULT_ERASER);
+ br->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_HARD;
+ br->gpencil_tool = GPAINT_TOOL_ERASE;
+ 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;
+ }
+ }
+ }
}