Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 29 Oct 2018 04:23:02 +0000 (15:23 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 29 Oct 2018 04:23:02 +0000 (15:23 +1100)
source/blender/blenloader/intern/readfile.c

index 3b0d946ba478c3dbb3e447fd3ab14dd215dc63ed..84a57e9449a2a79e0a9c7fa51638b8df695a38c2 100644 (file)
@@ -5679,7 +5679,13 @@ static void direct_link_object(FileData *fd, Object *ob)
        CLAMP(ob->rotmode, ROT_MODE_MIN, ROT_MODE_MAX);
 
        if (ob->sculpt) {
-               ob->sculpt = MEM_callocN(sizeof(SculptSession), "reload sculpt session");
+               if (ob->mode & OB_MODE_ALL_SCULPT) {
+                       ob->sculpt = MEM_callocN(sizeof(SculptSession), "reload sculpt session");
+                       ob->sculpt->mode_type = ob->mode;
+               }
+               else {
+                       ob->sculpt = NULL;
+               }
        }
 
        link_list(fd, &ob->lodlevels);