[Bf-blender-cvs] [172cc302157] greasepencil-object: GPencil: Set default draw brush in all templates
Antonio Vazquez
noreply at git.blender.org
Fri Nov 15 10:53:36 CET 2019
Commit: 172cc3021579c5054974d7cf9d37e0a2b6f20fcf
Author: Antonio Vazquez
Date: Fri Nov 15 10:53:24 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB172cc3021579c5054974d7cf9d37e0a2b6f20fcf
GPencil: Set default draw brush in all templates
===================================================================
M source/blender/blenloader/intern/versioning_280.c
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 6c31b99a046..fa42997792d 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1294,11 +1294,18 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
if (!MAIN_VERSION_ATLEAST(bmain, 282, 2)) {
/* Init all Vertex Paint brushes. */
for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
- BKE_brush_gpencil_vertex_presets(bmain, scene->toolsettings);
+ ToolSettings *ts = scene->toolsettings;
+
+ BKE_brush_gpencil_vertex_presets(bmain, ts);
/* Ensure new Vertex Paint mode. */
BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_GPENCIL_VERTEX);
+ /* Set default Draw brush. */
+ Brush *brush = BLI_findstring(&bmain->brushes, "Pencil", offsetof(ID, name) + 2);
+ Paint *paint = &ts->gp_paint->paint;
+ BKE_paint_brush_set(paint, brush);
+
/* Ensure Palette by default. */
BKE_gpencil_palette_ensure(bmain, scene);
}
More information about the Bf-blender-cvs
mailing list