Fix T75780: Gpencil Sculpt brushes not working with old files

The patching of brushes was not done.
This commit is contained in:
Antonio Vazquez 2020-04-16 15:53:03 +02:00
parent dcb443416e
commit a9dd6d004b
Notes: blender-bot 2023-02-14 07:18:54 +01:00
Referenced by issue #75780, Grease Pencil sculpt mode is not active
1 changed files with 13 additions and 0 deletions

View File

@ -1666,6 +1666,19 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
BKE_fcurves_id_cb(&ob->id, do_version_fcurve_hide_viewport_fix, NULL);
}
/* Reset all grease pencil brushes. */
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
BKE_brush_gpencil_paint_presets(bmain, scene->toolsettings);
BKE_brush_gpencil_sculpt_presets(bmain, scene->toolsettings);
BKE_brush_gpencil_weight_presets(bmain, scene->toolsettings);
BKE_brush_gpencil_vertex_presets(bmain, scene->toolsettings);
/* Ensure new Paint modes. */
BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_VERTEX_GPENCIL);
BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_SCULPT_GPENCIL);
BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_WEIGHT_GPENCIL);
}
}
/**