Fix duplicate brushes being added to startup
authorCampbell Barton <ideasman42@gmail.com>
Tue, 29 Jan 2019 05:19:28 +0000 (16:19 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 29 Jan 2019 05:27:00 +0000 (16:27 +1100)
All builtin templates have this brush.

source/blender/blenloader/intern/versioning_defaults.c

index bc1ff3536656eb2eb181a9d4f7638eea360de224..c5df6a6fb8378449b8fd1d566e20b3b12bcb03e6 100644 (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) {