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>2018-11-02 01:10:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-02 11:40:39 +0300
commitac8d7873278c47e8e282b7f83888108e2720a451 (patch)
tree902a404882e4ab22b8d7a153fbfc2e306747b083 /source/blender/blenloader
parent5bd3f3e64b7eba34e6c1676b82eec5b3c7d49d97 (diff)
Tool System: brushes are now categorized by tool
The toolbar now shows brush types, the brush selector now only shows brushes matching the current tool type. Details: - Add's Paint.tool_slots (used by the toolbar). - Removed custom grease pencil brush tool code. - Bumped subversion. See T57526 for details.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c7
-rw-r--r--source/blender/blenloader/intern/versioning_280.c11
-rw-r--r--source/blender/blenloader/intern/writefile.c1
3 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ddda9eb610e..6b5b5c59706 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5910,6 +5910,11 @@ static void link_paint(FileData *fd, Scene *sce, Paint *p)
{
if (p) {
p->brush = newlibadr_us(fd, sce->id.lib, p->brush);
+ for (int i = 0; i < p->tool_slots_len; i++) {
+ if (p->tool_slots[i].brush != NULL) {
+ p->tool_slots[i].brush = newlibadr_us(fd, sce->id.lib, p->tool_slots[i].brush);
+ }
+ }
p->palette = newlibadr_us(fd, sce->id.lib, p->palette);
p->paint_cursor = NULL;
}
@@ -6205,6 +6210,8 @@ static void direct_link_paint(FileData *fd, Paint *p)
direct_link_curvemapping(fd, p->cavity_curve);
else
BKE_paint_cavity_curve_preset(p, CURVE_PRESET_LINE);
+
+ p->tool_slots = newdataadr(fd, p->tool_slots);
}
static void direct_link_paint_helper(FileData *fd, Paint **paint)
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 98bebd70d14..1384a4f28e2 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -909,6 +909,15 @@ void do_versions_after_linking_280(Main *bmain)
}
}
}
+
+ if (!MAIN_VERSION_ATLEAST(bmain, 280, 30)) {
+ for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) {
+ if (brush->gpencil_settings != NULL) {
+ brush->gpencil_tool = brush->gpencil_settings->brush_type;
+ }
+ }
+ BKE_paint_toolslots_init_from_main(bmain);
+ }
}
/* NOTE: this version patch is intended for versions < 2.52.2, but was initially introduced in 2.27 already.
@@ -2030,7 +2039,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) {
if (brush->gpencil_settings != NULL) {
BrushGpencilSettings *gp = brush->gpencil_settings;
- if (gp->brush_type == GP_BRUSH_TYPE_ERASE) {
+ if (gp->brush_type == GPAINT_TOOL_ERASE) {
gp->era_strength_f = 100.0f;
gp->era_thickness_f = 10.0f;
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 16bc845a3e9..c3693de4866 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2434,6 +2434,7 @@ static void write_paint(WriteData *wd, Paint *p)
if (p->cavity_curve) {
write_curvemapping(wd, p->cavity_curve);
}
+ writedata(wd, DATA, sizeof(PaintToolSlot) * p->tool_slots_len, p->tool_slots);
}
static void write_layer_collections(WriteData *wd, ListBase *lb)