diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-09-27 17:52:08 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-09-27 17:52:50 +0300 |
commit | 3c7707b49fc634f4850c1b3f0e3a439a91bde891 (patch) | |
tree | 52f3e24faa2a853ce28026f076d57cb077e4ea05 /source/blender/blenloader/intern/versioning_defaults.c | |
parent | c69a771851d8c0504927e4e2b61c608338ae522f (diff) |
GPencil: New Brush default settings
This patch replaces D5787. Now instead to replace the startup.blend file, all the changes are done in versioning and moved to shared module to be reused by Brush reset.
Reviewers: brecht, mendio
Reviewed By: brecht
Subscribers: pepeland, mendio
Differential Revision: https://developer.blender.org/D5913
Diffstat (limited to 'source/blender/blenloader/intern/versioning_defaults.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 7da2272ce14..7bae0ede55b 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -47,6 +47,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_node.h" +#include "BKE_paint.h" #include "BKE_screen.h" #include "BKE_workspace.h" @@ -357,6 +358,12 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) scene->audio.flag &= ~AUDIO_SYNC; scene->flag &= ~SCE_FRAME_DROP; } + + /* Change default selection mode for Grease Pencil. */ + if (app_template && STREQ(app_template, "2D_Animation")) { + ToolSettings *ts = scene->toolsettings; + ts->gpencil_selectmode_edit = GP_SELECTMODE_STROKE; + } } /* Objects */ @@ -464,4 +471,69 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } } } + + if (app_template && STREQ(app_template, "2D_Animation")) { + /* Update Grease Pencil brushes. */ + Brush *brush; + + /* Pencil brush. */ + brush = BLI_findstring(&bmain->brushes, "Draw Pencil", offsetof(ID, name) + 2); + if (brush) { + /* Change brush name. */ + rename_id_for_versioning(bmain, ID_BR, "Draw Pencil", "Pencil"); + } + + /* Pen brush. */ + brush = BLI_findstring(&bmain->brushes, "Draw Pen", offsetof(ID, name) + 2); + if (brush) { + /* Change brush name. */ + rename_id_for_versioning(bmain, ID_BR, "Draw Pen", "Pen"); + } + + /* Pen Soft brush. */ + brush = BLI_findstring(&bmain->brushes, "Draw Soft", offsetof(ID, name) + 2); + if (brush) { + brush->gpencil_settings->icon_id = GP_BRUSH_ICON_PEN; + /* Change brush name. */ + rename_id_for_versioning(bmain, ID_BR, "Draw Soft", "Pencil Soft"); + } + + /* Ink Pen brush. */ + brush = BLI_findstring(&bmain->brushes, "Draw Ink", offsetof(ID, name) + 2); + if (brush) { + /* Change brush name. */ + rename_id_for_versioning(bmain, ID_BR, "Draw Ink", "Ink Pen"); + } + + /* Ink Pen Rough brush. */ + brush = BLI_findstring(&bmain->brushes, "Draw Noise", offsetof(ID, name) + 2); + if (brush) { + /* Change brush name. */ + rename_id_for_versioning(bmain, ID_BR, "Draw Noise", "Ink Pen Rough"); + } + + /* Marker Bold brush. */ + brush = BLI_findstring(&bmain->brushes, "Draw Marker", offsetof(ID, name) + 2); + if (brush) { + /* Change brush name. */ + rename_id_for_versioning(bmain, ID_BR, "Draw Marker", "Marker Bold"); + } + + /* Marker Chisel brush. */ + brush = BLI_findstring(&bmain->brushes, "Draw Block", offsetof(ID, name) + 2); + if (brush) { + /* Change brush name. */ + rename_id_for_versioning(bmain, ID_BR, "Draw Block", "Marker Chisel"); + } + + /* Remove useless Fill Area.001 brush. */ + brush = BLI_findstring(&bmain->brushes, "Fill Area.001", offsetof(ID, name) + 2); + if (brush) { + BKE_id_delete(bmain, brush); + } + + /* Reset all grease pencil brushes. */ + Scene *scene = bmain->scenes.first; + BKE_brush_gpencil_presets(bmain, scene->toolsettings); + } } |