[Bf-blender-cvs] [c286fa309ef] master: Fix T74899: Add Draw Face Sets brush to versioning defaults

Pablo Dobarro noreply at git.blender.org
Thu Mar 26 15:41:26 CET 2020


Commit: c286fa309ef3939b8e0cf93515c4b9245edcf681
Author: Pablo Dobarro
Date:   Fri Mar 20 19:49:20 2020 +0100
Branches: master
https://developer.blender.org/rBc286fa309ef3939b8e0cf93515c4b9245edcf681

Fix T74899: Add Draw Face Sets brush to versioning defaults

Brushes are created automatically when the tools is enabled, but this
way it gets correct defaults and it is accesible from scripts.

Reviewed By: jbakker

Maniphest Tasks: T74899

Differential Revision: https://developer.blender.org/D7199

===================================================================

M	source/blender/blenloader/intern/versioning_defaults.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 045edc8413f..80395177100 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -582,6 +582,14 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
       brush->sculpt_tool = SCULPT_TOOL_SIMPLIFY;
     }
 
+    brush_name = "Draw Face Sets";
+    brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
+    if (!brush) {
+      brush = BKE_brush_add(bmain, brush_name, OB_MODE_SCULPT);
+      id_us_min(&brush->id);
+      brush->sculpt_tool = SCULPT_TOOL_DRAW_FACE_SETS;
+    }
+
     /* Use the same tool icon color in the brush cursor */
     for (brush = bmain->brushes.first; brush; brush = brush->id.next) {
       if (brush->ob_mode & OB_MODE_SCULPT) {



More information about the Bf-blender-cvs mailing list