fix [#33806] weight paint crash and computer freeze when painting
authorCampbell Barton <ideasman42@gmail.com>
Wed, 9 Jan 2013 04:17:53 +0000 (04:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 9 Jan 2013 04:17:53 +0000 (04:17 +0000)
clear weight paint runtime data on file-load.

source/blender/blenloader/intern/readfile.c

index 34c08a917b3002dc3249270c905182261eae5ece..43c1179dbbac48b8282eed553be61d557c2fef51 100644 (file)
@@ -5124,6 +5124,16 @@ static void direct_link_scene(FileData *fd, Scene *sce)
                
                sce->toolsettings->imapaint.paintcursor = NULL;
                sce->toolsettings->particle.paintcursor = NULL;
+
+               /* in rare cases this is needed, see [#33806] */
+               if (sce->toolsettings->vpaint) {
+                       sce->toolsettings->vpaint->vpaint_prev = NULL;
+                       sce->toolsettings->vpaint->tot = 0;
+               }
+               if (sce->toolsettings->wpaint) {
+                       sce->toolsettings->wpaint->wpaint_prev = NULL;
+                       sce->toolsettings->wpaint->tot = 0;
+               }
        }
 
        if (sce->ed) {