GP: Init new Eraser Hard
This commit is contained in:
@@ -487,17 +487,31 @@ void BKE_brush_gpencil_presets(bContext *C)
|
||||
brush->gpencil_settings->draw_strength = 1.0f;
|
||||
|
||||
/* Soft Eraser brush */
|
||||
brush = BKE_brush_add_gpencil(bmain, ts, "Eraser");
|
||||
brush = BKE_brush_add_gpencil(bmain, ts, "Eraser Soft");
|
||||
brush->size = 30.0f;
|
||||
brush->gpencil_settings->draw_strength = 0.5f;
|
||||
brush->gpencil_settings->flag |= (GP_BRUSH_ENABLE_CURSOR | GP_BRUSH_DEFAULT_ERASER);
|
||||
brush->gpencil_settings->flag |= GP_BRUSH_USE_PRESSURE;
|
||||
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
|
||||
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_SOFT;
|
||||
brush->gpencil_tool = GPAINT_TOOL_ERASE;
|
||||
brush->gpencil_settings->eraser_mode = GP_BRUSH_ERASER_SOFT;
|
||||
brush->gpencil_settings->era_strength_f = 100.0f;
|
||||
brush->gpencil_settings->era_thickness_f = 0.10f;
|
||||
brush->gpencil_settings->era_thickness_f = 10.0f;
|
||||
|
||||
/* Hard Eraser brush */
|
||||
brush = BKE_brush_add_gpencil(bmain, ts, "Eraser Vertex");
|
||||
brush = BKE_brush_add_gpencil(bmain, ts, "Eraser Hard");
|
||||
brush->size = 30.0f;
|
||||
brush->gpencil_settings->draw_strength = 1.0f;
|
||||
brush->gpencil_settings->flag |= (GP_BRUSH_ENABLE_CURSOR | GP_BRUSH_DEFAULT_ERASER);
|
||||
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_HARD;
|
||||
brush->gpencil_tool = GPAINT_TOOL_ERASE;
|
||||
brush->gpencil_settings->eraser_mode = GP_BRUSH_ERASER_SOFT;
|
||||
brush->gpencil_settings->era_strength_f = 100.0f;
|
||||
brush->gpencil_settings->era_thickness_f = 50.0f;
|
||||
|
||||
/* Point Eraser brush */
|
||||
brush = BKE_brush_add_gpencil(bmain, ts, "Eraser Point");
|
||||
brush->size = 30.0f;
|
||||
brush->gpencil_settings->flag |= GP_BRUSH_ENABLE_CURSOR;
|
||||
brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_HARD;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user