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:
authorCampbell Barton <ideasman42@gmail.com>2019-10-01 20:26:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-01 20:37:28 +0300
commit9f4dca8963373889cd4efb096d3ae44a19312cd9 (patch)
tree6bc0d915bac42dc39a8102777cfb1bc692e7858f /source/blender/blenloader/intern/versioning_defaults.c
parent5eebd7cc1fe94916edf1d7797a408ada3ac0186b (diff)
Fix mismatch in brush default versioning
Assign a variable to avoid repetition and having this happen again.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_defaults.c')
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 7bae0ede55b..2e2b4bcd1dd 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -419,7 +419,8 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
{
/* Enable for UV sculpt (other brush types will be created as needed),
* without this the grab brush will be active but not selectable from the list. */
- Brush *brush = BLI_findstring(&bmain->brushes, "Grab", offsetof(ID, name) + 2);
+ const char *brush_name = "Grab";
+ Brush *brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
if (brush) {
brush->ob_mode |= OB_MODE_EDIT;
}
@@ -431,35 +432,43 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
{
/* Change the spacing of the Smear brush to 3.0% */
- Brush *brush = BLI_findstring(&bmain->brushes, "Smear", offsetof(ID, name) + 2);
+ const char *brush_name;
+ Brush *brush;
+
+ brush_name = "Smear";
+ brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
if (brush) {
brush->spacing = 3.0;
}
- brush = BLI_findstring(&bmain->brushes, "Draw Sharp", offsetof(ID, name) + 2);
+ brush_name = "Draw Sharp";
+ brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
if (!brush) {
- brush = BKE_brush_add(bmain, "Draw Sharp", OB_MODE_SCULPT);
+ brush = BKE_brush_add(bmain, brush_name, OB_MODE_SCULPT);
id_us_min(&brush->id);
brush->sculpt_tool = SCULPT_TOOL_DRAW_SHARP;
}
- brush = BLI_findstring(&bmain->brushes, "Elastic Deform", offsetof(ID, name) + 2);
+ brush_name = "Elastic Deform";
+ brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
if (!brush) {
- brush = BKE_brush_add(bmain, "Elastic Defrom", OB_MODE_SCULPT);
+ brush = BKE_brush_add(bmain, brush_name, OB_MODE_SCULPT);
id_us_min(&brush->id);
brush->sculpt_tool = SCULPT_TOOL_ELASTIC_DEFORM;
}
- brush = BLI_findstring(&bmain->brushes, "Pose", offsetof(ID, name) + 2);
+ brush_name = "Pose";
+ brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
if (!brush) {
- brush = BKE_brush_add(bmain, "Pose", OB_MODE_SCULPT);
+ brush = BKE_brush_add(bmain, brush_name, OB_MODE_SCULPT);
id_us_min(&brush->id);
brush->sculpt_tool = SCULPT_TOOL_POSE;
}
- brush = BLI_findstring(&bmain->brushes, "Simplify", offsetof(ID, name) + 2);
+ brush_name = "Simplify";
+ brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
if (!brush) {
- brush = BKE_brush_add(bmain, "Simplify", OB_MODE_SCULPT);
+ brush = BKE_brush_add(bmain, brush_name, OB_MODE_SCULPT);
id_us_min(&brush->id);
brush->sculpt_tool = SCULPT_TOOL_SIMPLIFY;
}