Fix T48897: Flatten brush fails on first stroke
authorCampbell Barton <ideasman42@gmail.com>
Wed, 20 Jul 2016 03:54:55 +0000 (13:54 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 20 Jul 2016 03:54:55 +0000 (13:54 +1000)
The flatten brush depended on accumulate being disabled,
Adding dynotopo support for accumulate caused problems for this tool (see T44390).
Enable for existing files.

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

index ac2811aeb0679c1e763a024ae58d07705afe6364..8d96d7c3807582ff8ad7c81a85290b97fbf35708 100644 (file)
@@ -1225,5 +1225,11 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                                }
                        }
                }
+
+               for (Brush *br = main->brush.first; br; br = br->id.next) {
+                       if (br->sculpt_tool == SCULPT_TOOL_FLATTEN) {
+                               br->flag |= BRUSH_ACCUMULATE;
+                       }
+               }
        }
 }
index ad7a3c5b9c4dc41e4da4151a64f54097cef81677..0ed7a397e0b957ec4ca21fc2063e6aee765b774a 100644 (file)
@@ -256,6 +256,11 @@ void BLO_update_defaults_startup_blend(Main *bmain)
                if (br) {
                        br->alpha = 1.0f;
                }
+
+               br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Flatten/Contrast");
+               if (br) {
+                       br->flag |= BRUSH_ACCUMULATE;
+               }
        }
 }