Fix #32209: Autosave ignores multires sculpting
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 1 Aug 2012 09:04:40 +0000 (09:04 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 1 Aug 2012 09:04:40 +0000 (09:04 +0000)
Use a bit different fix, which gets active scene from context and
uses this scene to figure out active object instead of itterating
through all the objects.

source/blender/windowmanager/intern/wm_files.c

index cb0f9c226b48797b69de66a038e588e45616b5cb..a90a1dfe43a2eb8cb4dc450764d75382f2b442cc 100644 (file)
@@ -77,6 +77,7 @@
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
+#include "BKE_multires.h"
 #include "BKE_packedFile.h"
 #include "BKE_report.h"
 #include "BKE_sound.h"
@@ -930,6 +931,7 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(w
        wmEventHandler *handler;
        char filepath[FILE_MAX];
        int fileflags;
+       Scene *scene = CTX_data_scene(C);
 
        WM_event_remove_timer(wm, NULL, wm->autosavetimer);
 
@@ -942,7 +944,14 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(w
                        }
                }
        }
-       
+
+       if (scene) {
+               Object *ob = OBACT;
+
+               if (ob && ob->mode & OB_MODE_SCULPT)
+                       multires_force_update(ob);
+       }
+
        wm_autosave_location(filepath);
 
        /*  force save as regular blend file */