Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sat, 12 Aug 2017 15:14:55 +0000 (01:14 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 12 Aug 2017 15:14:55 +0000 (01:14 +1000)
intern/cycles/util/util_types.h
source/blender/blenkernel/intern/blendfile.c
source/blender/windowmanager/intern/wm_init_exit.c

index d9642df8005e254ff5cbb087da1393482a6713dd..733b97e14329be8c7e92d9b29638a386e4a76c54 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 
 #include "util/util_defines.h"
+#include "util/util_optimization.h"
 
 #ifndef __KERNEL_GPU__
 #  include "util/util_simd.h"
index 09760fcc4cbf7a81103b4b6f13e6e72823f007b2..e1350aa8a46aa2e63235d707a4bb92d2abc3a4d9 100644 (file)
@@ -117,6 +117,7 @@ static void setup_app_data(
         const char *filepath, ReportList *reports)
 {
        Scene *curscene = NULL;
+       const bool is_startup = (bfd->filename[0] == '\0');
        const bool recover = (G.fileflags & G_FILE_RECOVER) != 0;
        enum {
                LOAD_UI = 1,
@@ -132,7 +133,7 @@ static void setup_app_data(
        else if (BLI_listbase_is_empty(&bfd->main->screen)) {
                mode = LOAD_UNDO;
        }
-       else if (G.fileflags & G_FILE_NO_UI) {
+       else if ((G.fileflags & G_FILE_NO_UI) && (is_startup == false)) {
                mode = LOAD_UI_OFF;
        }
        else {
@@ -264,7 +265,9 @@ static void setup_app_data(
                CTX_data_scene_set(C, curscene);
        }
        else {
-               G.fileflags = bfd->fileflags;
+               /* Keep state from preferences. */
+               const int fileflags_skip = G_FILE_FLAGS_RUNTIME;
+               G.fileflags = (G.fileflags & fileflags_skip) | (bfd->fileflags & ~fileflags_skip);
                CTX_wm_manager_set(C, G.main->wm.first);
                CTX_wm_screen_set(C, bfd->curscreen);
                CTX_data_scene_set(C, bfd->curscene);
index 5d90f0eb3e6627e164989aeaa3fd803bbaef0851..8346535cd6a9a0d4d307a58adec57630719d5483 100644 (file)
@@ -189,9 +189,6 @@ void WM_init(bContext *C, int argc, const char **argv)
        BLF_init(); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */
        BLT_lang_init();
 
-       /* Enforce loading the UI for the initial homefile */
-       G.fileflags &= ~G_FILE_NO_UI;
-
        /* reports cant be initialized before the wm,
         * but keep before file reading, since that may report errors */
        wm_init_reports(C);