Fix duplicate brushes being added to startup

All builtin templates have this brush.
This commit is contained in:
Campbell Barton 2019-01-29 16:19:28 +11:00
parent 78719abc01
commit c305759762
Notes: blender-bot 2023-02-14 06:49:57 +01:00
Referenced by commit 475a07cd0c, Fix duplicate brushes from recent startup files
1 changed files with 0 additions and 30 deletions

View File

@ -315,36 +315,6 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
/* Match default for new meshes. */
mesh->smoothresh = DEG2RADF(30);
}
/* Grease Pencil New Eraser Brush */
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) {
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;
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;
/* back to default brush */
BKE_paint_brush_set(paint, old_brush);
}
}
}
for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {