Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-05-15 17:43:50 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-15 17:50:38 +0300
commit1cad0a627e882cf0c5a98d1b482327e59f65a87a (patch)
tree99e951f7231e55125b0a2f3a1b28aacd7355148b /source/blender/blenloader
parenta269761ec1bce0f551cf7fc9c373f3c735df412c (diff)
GPencil: Fix unreported missing Sculpt/Vertex/Weight paint brushes
This error was introduced wit the change in commit https://developer.blender.org/rB6a850f3cc840 As the brushes were not created, all modes except Edit were broken. Now, the brushes and palette are not created when load the file in versioning code, but when the mode is enabled. Also, if the brush already exist, the parameters are not reset as it was done in the versioning code in order to keep user settings. The same logic is used for the default palette.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c9
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 72c7c10d7ee..2d44da3c737 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -5065,6 +5065,15 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
ListBase *lb = which_libbase(bmain, id_codes[i]);
BKE_main_id_repair_duplicate_names_listbase(lb);
}
+
+ /* Set Brush default color for grease pencil. */
+ LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
+ if (brush->gpencil_settings) {
+ brush->rgb[0] = 0.498f;
+ brush->rgb[1] = 1.0f;
+ brush->rgb[2] = 0.498f;
+ }
+ }
}
/**
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index b404ec4a2c0..8a7fd80ea0e 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -462,7 +462,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
/* Reset all grease pencil brushes. */
Scene *scene = bmain->scenes.first;
- BKE_brush_gpencil_paint_presets(bmain, scene->toolsettings);
+ BKE_brush_gpencil_paint_presets(bmain, scene->toolsettings, true);
/* Ensure new Paint modes. */
BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_VERTEX_GPENCIL);