bugfix [#26156] Opening .blend files through OS ignores "Load UI" flag
This commit is contained in:
@@ -287,6 +287,7 @@ void ED_preview_init_dbase(void)
|
|||||||
BlendFileData *bfd;
|
BlendFileData *bfd;
|
||||||
extern int datatoc_preview_blend_size;
|
extern int datatoc_preview_blend_size;
|
||||||
extern char datatoc_preview_blend[];
|
extern char datatoc_preview_blend[];
|
||||||
|
const int fileflags= G.fileflags;
|
||||||
|
|
||||||
G.fileflags |= G_FILE_NO_UI;
|
G.fileflags |= G_FILE_NO_UI;
|
||||||
bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL);
|
bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL);
|
||||||
@@ -295,7 +296,7 @@ void ED_preview_init_dbase(void)
|
|||||||
|
|
||||||
MEM_freeN(bfd);
|
MEM_freeN(bfd);
|
||||||
}
|
}
|
||||||
G.fileflags &= ~G_FILE_NO_UI;
|
G.fileflags= fileflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_preview_free_dbase(void)
|
void ED_preview_free_dbase(void)
|
||||||
|
|||||||
@@ -257,6 +257,10 @@ static void wm_init_userdef(bContext *C)
|
|||||||
MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
|
MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
|
||||||
sound_init(CTX_data_main(C));
|
sound_init(CTX_data_main(C));
|
||||||
|
|
||||||
|
/* needed so loading a file from the command line respects user-pref [#26156] */
|
||||||
|
if(U.flag & USER_FILENOUI) G.fileflags |= G_FILE_NO_UI;
|
||||||
|
else G.fileflags &= ~G_FILE_NO_UI;
|
||||||
|
|
||||||
/* set the python auto-execute setting from user prefs */
|
/* set the python auto-execute setting from user prefs */
|
||||||
/* disabled by default, unless explicitly enabled in the command line */
|
/* disabled by default, unless explicitly enabled in the command line */
|
||||||
if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
|
if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
|
||||||
|
|||||||
Reference in New Issue
Block a user