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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-04-30 00:04:25 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-04-30 00:04:25 +0400
commitf7ec94cbc6c7dc761f127c50081b3383a58a1c2e (patch)
tree715ceee7a26b754890954cc38672ae5cfe334a3e /source/blender/blenloader
parent44d81faa432b3b778da10139b652371cfdc7cbb3 (diff)
Add per-brush weight field.
Patch from Jaggz H, thanks! [#31096] Weight-painting: Brush-specific weights http://projects.blender.org/tracker/?func=detail&atid=127&aid=31096&group_id=9 Each brush's weight can now be set individually, can also enable unified setting (same as size and strength have.) Added readfile code to the patch: subversion bumped to 1, brushes get default weight of 0.5, unified weight enabled by default and value from old vgroup_weight field.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b7ffa77a502..79904793715 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -13261,6 +13261,27 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
part->flag |= PART_ROTATIONS;
}
+ if (main->versionfile <= 263 && main->subversionfile == 0) {
+ Scene *scene;
+ Brush *brush;
+
+ /* For weight paint, each brush now gets its own weight;
+ unified paint settings also have weight. Update unified
+ paint settings and brushes with a default weight value. */
+
+ for (scene = main->scene.first; scene; scene = scene->id.next) {
+ ToolSettings *ts = scene->toolsettings;
+ if (ts) {
+ ts->unified_paint_settings.weight = ts->vgroup_weight;
+ ts->unified_paint_settings.flag |= UNIFIED_PAINT_WEIGHT;
+ }
+ }
+
+ for (brush = main->brush.first; brush; brush = brush->id.next) {
+ brush->weight = 0.5;
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */