Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| /* Call pre-save callbacks before writing preview, | /* Call pre-save callbacks before writing preview, | ||||
| * that way you can generate custom file thumbnail. */ | * that way you can generate custom file thumbnail. */ | ||||
| BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_PRE); | BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_PRE); | ||||
| ED_assets_pre_save(bmain); | ED_assets_pre_save(bmain); | ||||
| /* Enforce full override check/generation on file save. */ | /* Enforce full override check/generation on file save. */ | ||||
| BKE_lib_override_library_main_operations_create(bmain, true); | BKE_lib_override_library_main_operations_create(bmain, true); | ||||
| if (!G.background && BLI_thread_is_main()) { | /* NOTE: Ideally we would call `WM_redraw_windows` here to remove any open menus. But we | ||||
| /* Redraw to remove menus that might be open. | * can crash if saving from a script, see T92704 & T97627. Just checking `!G.background | ||||
| * But only in the main thread otherwise this can crash, see T92704. */ | * && BLI_thread_is_main()` is not sufficient to fix this. */ | ||||
| WM_redraw_windows(C); | |||||
| } | |||||
campbellbarton: Use `*` prefixed block comments, otherwise LGTM. | |||||
| /* don't forget not to return without! */ | /* don't forget not to return without! */ | ||||
| WM_cursor_wait(true); | WM_cursor_wait(true); | ||||
| if (U.file_preview_type != USER_FILE_PREVIEW_NONE) { | if (U.file_preview_type != USER_FILE_PREVIEW_NONE) { | ||||
| /* Blend file thumbnail. | /* Blend file thumbnail. | ||||
| * | * | ||||
| * - Save before exiting edit-mode, otherwise evaluated-mesh for shared data gets corrupted. | * - Save before exiting edit-mode, otherwise evaluated-mesh for shared data gets corrupted. | ||||
| * See T27765. | * See T27765. | ||||
| ▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines | |||||
Use * prefixed block comments, otherwise LGTM.