23# define _WIN32_IE 0x0400
31#include <fmt/format.h>
51#include BLI_SYSTEM_PID_H
182#define USE_THUMBNAIL_FAST_DOWNSCALE
191 if (
wm->file_saved) {
225 const bool is_read_homefile)
235 return wm_setup_data;
258 if (
wm->runtime->message_bus !=
nullptr) {
260 wm->runtime->message_bus =
nullptr;
282 return wm_setup_data;
294 wm->runtime->winactive = win;
298 wm->runtime->windrawable = win;
340 wm_setup_data->
old_wm =
nullptr;
353 if (screen !=
nullptr) {
362 if (screen->
winid == 0) {
372 bmain, workspace, layout_ref, &win);
405 wm->runtime->winactive =
nullptr;
410 bool has_match =
false;
423 old_wm,
wm, old_wm->
windows.first(),
wm->windows.first());
426 wm_setup_data->
old_wm =
nullptr;
435 wmWindow *win =
wm->runtime->winactive ?
wm->runtime->winactive :
wm->windows.first();
458 wm_setup_data->
old_wm ==
nullptr)
468 else if (wm_setup_data->
old_wm !=
nullptr) {
487 MEM_delete(wm_setup_data);
568#define BKE_READ_EXOTIC_FAIL_PATH -3
569#define BKE_READ_EXOTIC_FAIL_FORMAT -2
570#define BKE_READ_EXOTIC_FAIL_OPEN -1
571#define BKE_READ_EXOTIC_OK_BLEND 0
573# define BKE_READ_EXOTIC_OK_OTHER 1
590 int filepath_len = strlen(filepath);
591 if (filepath_len > 0 &&
ELEM(filepath[filepath_len - 1],
'/',
'\\')) {
606 if (std::holds_alternative<BlenderHeader>(header_variant)) {
620 if (
G.autoexec_override.has_value()) {
642 "Engine '%s' not available for scene '%s' (an add-on may need to be installed "
696 const char *filepath,
701 const bool use_data = params->
use_data;
707 bool addons_loaded =
false;
718 if (is_startup_file) {
723 bool reset_all = use_userdef;
724 if (use_userdef || reset_app_template) {
727 const char *imports[] = {
"bl_app_template_utils",
nullptr};
733 const char *imports[] = {
"bpy",
"addon_utils",
nullptr};
741 "bpy.utils.refresh_script_paths()\n"
743 "addon_utils.reset_all()");
748 addons_loaded =
true;
756 addons_loaded =
true;
765 if (is_factory_startup) {
788 if (is_factory_startup) {
808 if (is_startup_file) {
832 if (
wm->runtime->undo_stack ==
nullptr) {
890 if (success ==
false) {
908 double duration_whole_minutes, duration_whole_seconds;
909 double duration_libraries_minutes, duration_libraries_seconds;
910 double duration_lib_override_minutes, duration_lib_override_seconds;
911 double duration_lib_override_resync_minutes, duration_lib_override_resync_seconds;
912 double duration_lib_override_recursive_resync_minutes,
913 duration_lib_override_recursive_resync_seconds;
918 &duration_whole_minutes,
919 &duration_whole_seconds,
924 &duration_libraries_minutes,
925 &duration_libraries_seconds,
930 &duration_lib_override_minutes,
931 &duration_lib_override_seconds,
936 &duration_lib_override_resync_minutes,
937 &duration_lib_override_resync_seconds,
942 &duration_lib_override_recursive_resync_minutes,
943 &duration_lib_override_recursive_resync_seconds,
947 &
LOG,
"Blender file read in %.0fm%.2fs", duration_whole_minutes, duration_whole_seconds);
949 " * Loading libraries: %.0fm%.2fs",
950 duration_libraries_minutes,
951 duration_libraries_seconds);
953 " * Applying overrides: %.0fm%.2fs",
954 duration_lib_override_minutes,
955 duration_lib_override_seconds);
957 " * Resyncing overrides: %.0fm%.2fs (%d root overrides), including recursive "
958 "resyncs: %.0fm%.2fs)",
959 duration_lib_override_resync_minutes,
960 duration_lib_override_resync_seconds,
961 bf_reports->
count.resynced_lib_overrides,
962 duration_lib_override_recursive_resync_minutes,
963 duration_lib_override_recursive_resync_seconds);
967 node_lib = node_lib->
next)
972 "Library \"%s\" needs overrides resync",
977 if (bf_reports->
count.missing_libraries != 0 || bf_reports->
count.missing_linked_id != 0) {
980 "%d libraries and %d linked data-blocks are missing (including %d ObjectData), "
981 "please check the Info and Outliner editors for details",
982 bf_reports->
count.missing_libraries,
983 bf_reports->
count.missing_linked_id,
984 bf_reports->
count.missing_obdata);
987 if (bf_reports->
count.missing_obdata != 0) {
989 "%d local ObjectData are reported to be missing, this should never happen",
990 bf_reports->
count.missing_obdata);
997 "%d libraries have overrides needing resync (auto resynced in %.0fm%.2fs), "
998 "please check the Info editor for details",
1000 duration_lib_override_recursive_resync_minutes,
1001 duration_lib_override_recursive_resync_seconds);
1004 if (bf_reports->
count.proxies_to_lib_overrides_success != 0 ||
1005 bf_reports->
count.proxies_to_lib_overrides_failures != 0)
1009 "Proxies have been removed from Blender (%d proxies were automatically converted "
1010 "to library overrides, %d proxies could not be converted and were cleared). "
1011 "Consider re-saving any library .blend file with the newest Blender version",
1012 bf_reports->
count.proxies_to_lib_overrides_success,
1013 bf_reports->
count.proxies_to_lib_overrides_failures);
1016 if (bf_reports->
count.sequence_strips_skipped != 0) {
1019 "%d sequence strips were not read because they were in a channel larger than %d",
1020 bf_reports->
count.sequence_strips_skipped,
1031 "Loaded a pre-2.50 blend file, animation data has not been loaded. Open & save the file "
1032 "with Blender v4.5 to convert animation data.");
1037 const char *filepath,
1038 const bool use_scripts_autoexec_check,
1042 const bool do_history_file_update = (
G.background ==
false) &&
1044 bool success =
false;
1046 const bool use_data =
true;
1047 const bool use_userdef =
false;
1077 if (bfd !=
nullptr) {
1089 const int G_f_orig =
G.f;
1093 C, bfd, ¶ms, wm_setup_data, &bf_reports,
false,
nullptr);
1100 if (
G.f != G_f_orig) {
1103 G.f = (
G.f & ~flags_keep) | (G_f_orig & flags_keep);
1110 if (use_scripts_autoexec_check) {
1116 if (do_history_file_update) {
1122 read_file_post_params.
use_data = use_data;
1127 read_file_post_params.
success =
true;
1128 read_file_post_params.
is_alloc =
false;
1138 else if (retval == BKE_READ_EXOTIC_OK_OTHER) {
1139 BKE_undo_write(
C,
"Import file");
1145 "Cannot read file \"%s\": %s",
1147 errno ? strerror(errno) :
RPT_(
"unable to open the file"));
1177 if (project_root_path.empty()) {
1179 reports,
RPT_ERROR,
"Could not find a project within the specified path: %s", filepath);
1186 reports,
RPT_ERROR,
"Failed to load project from path: %s", project_root_path.c_str());
1192 read_homefile_params.
use_data =
true;
1198 if (!
G.background) {
1254 bool success =
false;
1257 const bool use_data = params_homefile->
use_data;
1258 const bool use_userdef = params_homefile->
use_userdef;
1264 const bool use_factory_settings_app_template_only =
1270 bool filepath_startup_is_factory =
true;
1276 char app_template_system[
FILE_MAX];
1279 char app_template_config[
FILE_MAX];
1283 if (use_data ==
false) {
1286 if (use_userdef ==
false) {
1292 bool is_factory_startup =
true;
1294 const char *app_template =
nullptr;
1295 bool update_defaults =
false;
1300 if (filepath_startup_override !=
nullptr) {
1303 else if (app_template_override) {
1305 app_template = app_template_override;
1307 else if (!use_factory_settings &&
U.app_template[0]) {
1308 app_template =
U.app_template;
1311 const bool reset_app_template = ((!app_template &&
U.app_template[0]) ||
1312 (app_template && !
STREQ(app_template,
U.app_template)));
1315 BLI_assert((use_factory_settings && filepath_startup_override) == 0);
1322 if (reset_app_template) {
1328 if (use_userdef || reset_app_template) {
1339 const char *imports[] = {
"addon_utils",
nullptr};
1363 filepath_startup[0] =
'\0';
1364 filepath_userdef[0] =
'\0';
1365 app_template_system[0] =
'\0';
1366 app_template_config[0] =
'\0';
1369 if (!use_factory_settings) {
1370 if (cfgdir.has_value()) {
1373 filepath_startup_is_factory =
false;
1380 use_factory_settings =
true;
1383 if (filepath_startup_override) {
1384 STRNCPY(filepath_startup, filepath_startup_override);
1385 filepath_startup_is_factory =
false;
1391 if (use_factory_settings_app_template_only) {
1395 else if (!use_factory_settings &&
BLI_exists(filepath_userdef)) {
1397 if (userdef !=
nullptr) {
1398 CLOG_INFO(&
LOG,
"Read prefs: \"%s\"", filepath_userdef);
1413 if ((app_template !=
nullptr) && (app_template[0] !=
'\0')) {
1415 app_template, app_template_system,
sizeof(app_template_system)))
1425 if (!use_factory_settings && cfgdir.has_value()) {
1427 app_template_config,
sizeof(app_template_config), cfgdir->c_str(), app_template);
1430 filepath_startup_is_factory =
false;
1431 if (
BLI_access(filepath_startup, R_OK) != 0) {
1432 filepath_startup[0] =
'\0';
1436 filepath_startup[0] =
'\0';
1439 if (filepath_startup[0] ==
'\0') {
1442 filepath_startup_is_factory =
true;
1445 update_defaults =
true;
1449 if (!use_factory_settings || (filepath_startup[0] !=
'\0')) {
1450 if (
BLI_access(filepath_startup, R_OK) == 0) {
1459 if (bfd !=
nullptr) {
1460 CLOG_INFO(&
LOG,
"Read startup: \"%s\"", filepath_startup);
1468 update_defaults && use_data,
1475 is_factory_startup = filepath_startup_is_factory;
1487 if (success ==
false && filepath_startup_override && reports) {
1492 bool loaded_factory_settings =
false;
1493 if (success ==
false) {
1500 if (bfd !=
nullptr) {
1504 C, bfd, &read_file_params, wm_setup_data, &read_report,
true,
nullptr);
1506 loaded_factory_settings =
true;
1511 if (use_empty_data) {
1518 if (app_template_system[0] !=
'\0') {
1520 temp_path[0] =
'\0';
1521 if (!use_factory_settings) {
1524 temp_path[0] =
'\0';
1528 if (temp_path[0] ==
'\0') {
1533 UserDef *userdef_template =
nullptr;
1537 if (userdef_template) {
1538 CLOG_INFO(&
LOG,
"Read prefs from app-template: \"%s\"", temp_path);
1541 if (userdef_template ==
nullptr) {
1545 if (userdef_template) {
1547 userdef_template =
nullptr;
1552 if (app_template_override) {
1553 STRNCPY(
U.app_template, app_template_override);
1572 if (
wm.runtime->defaultconf) {
1586 params_file_read_post.
use_data = use_data;
1594 params_file_read_post.
success = success;
1595 params_file_read_post.
is_alloc =
false;
1597 if (r_params_file_read_post ==
nullptr) {
1601 params_file_read_post.
is_alloc =
true;
1603 **r_params_file_read_post = params_file_read_post;
1620 const char *filepath =
"";
1623 if (params_file_read_post->
use_data) {
1627 if (params_file_read_post->
is_alloc) {
1628 MEM_delete(params_file_read_post);
1641 if (!cfgdir.has_value()) {
1657 const char *line =
static_cast<const char *
>(
l->link);
1686 for (
RecentFile &recent :
G.recent_files.items_mutable()) {
1709 if (!user_config_dir.has_value()) {
1718 fprintf(fp,
"%s\n", recent.
filepath);
1733 if (blendfile_path[0] ==
'\0') {
1737 recent =
G.recent_files.first();
1749 recent = recent_next)
1751 recent_next = recent->
next;
1780 return std::nullopt;
1782 return project->get_root_path();
1791 const RecentFile *recent =
G.recent_files.first();
1792 return recent ? recent->
filepath :
"";
1803 STRNCPY(dirpath, root_path->c_str());
1831#ifdef USE_THUMBNAIL_FAST_DOWNSCALE
1833 const int src_size[2],
1834 const int dst_size[2])
1851 BLI_assert(dst_size[0] <= src_size[0] && dst_size[1] <= src_size[1]);
1864 const uint32_t src_size_x = src_size[0];
1865 const uint32_t src_size_y = src_size[1];
1867 const uint32_t dst_size_x = dst_size[0];
1868 const uint32_t dst_size_y = dst_size[1];
1869 const uint8_t *src_px = src_rect;
1872 for (
uint32_t dst_y = 0; dst_y < dst_size_y; dst_y++) {
1874 const uint32_t src_y_end = ((dst_y + 1) * src_size_y) / dst_size_y;
1875 for (; src_y < src_y_end; src_y++) {
1878 for (
uint32_t dst_x = 0; dst_x < dst_size_x; dst_x++, accum += 4) {
1879 const uint32_t src_x_end = ((dst_x + 1) * src_size_x) / dst_size_x;
1880 for (; src_x < src_x_end; src_x++) {
1889 BLI_assert(accum == accum_row + (4 * dst_size[0]));
1893 uint8_t *dst_px = dst_rect + ((dst_y * dst_size_x) * 4);
1895 const uint32_t span_y = src_y_end - src_y_beg;
1896 for (
uint32_t dst_x = 0; dst_x < dst_size_x; dst_x++) {
1897 const uint32_t src_x_end = ((dst_x + 1) * src_size_x) / dst_size_x;
1898 const uint32_t span_x = src_x_end - src_x_beg;
1900 const uint32_t sample_count = span_x * span_y;
1901 dst_px[0] =
uint8_t(accum[0] / sample_count);
1902 dst_px[1] =
uint8_t(accum[1] / sample_count);
1903 dst_px[2] =
uint8_t(accum[2] / sample_count);
1904 dst_px[3] =
uint8_t(accum[3] / sample_count);
1905 accum[0] = accum[1] = accum[2] = accum[3] = 0;
1909 src_x_beg = src_x_end;
1911 sample_count_all += sample_count;
1915 BLI_assert(src_px == src_rect + (
sizeof(
uint8_t[4]) * src_size[0] * src_size[1]));
1916 BLI_assert(sample_count_all ==
size_t(src_size[0]) *
size_t(src_size[1]));
1918 MEM_delete(accum_row);
1926 if (size[0] > size[1]) {
1928 result.y =
max_ii(1,
int((
float(size[1]) /
float(size[0])) * limit));
1931 result.x =
max_ii(1,
int((
float(size[0]) /
float(size[1])) * limit));
1945 if (
G.background || (win ==
nullptr)) {
1958 ImBuf *ibuf =
nullptr;
1964#ifdef USE_THUMBNAIL_FAST_DOWNSCALE
1965 if ((thumb_size_2x[0] <= win_size[0]) && (thumb_size_2x[1] <= win_size[1])) {
1997 char version_str[10];
2019 if (
G.background || scene ==
nullptr) {
2027 const float pixelsize_old =
U.pixelsize;
2028 wmWindow *windrawable_old =
wm->runtime->windrawable;
2029 char err_out[256] =
"unknown";
2036 if (screen !=
nullptr) {
2044 if (scene->
camera ==
nullptr && v3d ==
nullptr) {
2057 (v3d) ? &v3d->
shading :
nullptr,
2089 U.pixelsize = pixelsize_old;
2092 if (windrawable_old) {
2103 char version_str[10];
2121 CLOG_WARN(&
LOG,
"failed to create thumbnail: %s", err_out);
2145 printf(
"%s: \"%s\"\n", success ?
"written" :
"failed", filepath);
2154 const char *filepath,
2157 const int filepath_len = strlen(filepath);
2158 if (filepath_len == 0) {
2169 BKE_report(reports,
RPT_ERROR,
"Cannot overwrite files that are managed by the asset system");
2187 const char *filepath,
2190 bool use_save_as_copy,
2195 ImBuf *ibuf_thumb =
nullptr;
2218 reports,
RPT_ERROR,
"Cannot save blend file, path \"%s\" is not writable", filepath);
2228 reports,
RPT_ERROR,
"Cannot save blend file, path \"%s\" is a directory", filepath);
2261 if (thumb !=
nullptr) {
2266 int file_preview_type =
U.file_preview_type;
2271 bool do_render = (scene !=
nullptr && scene->
camera !=
nullptr && screen !=
nullptr &&
2276 switch (file_preview_type) {
2307 blend_write_params.
thumb = thumb;
2309 const bool success =
BLO_write_file(bmain, filepath, fileflags, &blend_write_params, reports);
2312 if (use_save_as_copy ==
false) {
2325 if (saved_ibuf_thumb) {
2326 ibuf_thumb = saved_ibuf_thumb;
2342 const bool do_history_file_update = (
G.background ==
false) &&
2344 if (success && do_history_file_update) {
2352 if (thumb && thumb != main_thumb) {
2369 const int pid =
abs(getpid());
2377 if (blendfile_path && (blendfile_path[0] !=
'\0')) {
2379 int len = strlen(basename) - 6;
2392 if (
wm->file_saved) {
2424 return wm->autosave_scheduled;
2440 const bool success =
BLO_write_file(bmain, filepath, fileflags, ¶ms, reports);
2446 wm->autosave_scheduled = !success;
2466 if (
wm->autosavetimer) {
2468 wm->autosavetimer =
nullptr;
2495 wm->autosave_scheduled =
false;
2497 wm->autosave_scheduled =
true;
2531 ot->
name =
"Save Autosave";
2532 ot->
idname =
"WM_OT_save_auto_save";
2533 ot->
description =
"Create an autosave in the temp directory for the current file";
2551 "use_factory_startup_app_template_only",
2553 "Factory Startup App-Template Only",
2599 switch (source_of_trust) {
2606 if (filepath[0] ==
'\0') {
2613 .skip_overrides =
false,
2614 .canonicalize =
true,
2615 .strip_filename =
true,
2628 value =
G.autoexec_override.value_or(
false);
2655 const char *app_template =
U.app_template[0] ?
U.app_template :
nullptr;
2658 if (!cfgdir.has_value()) {
2694 bmain, filepath, fileflags, &blend_write_params, op->
reports);
2710 if (!
U.app_template[0]) {
2713 IFACE_(
"Overwrite Startup File"),
2714 IFACE_(
"Blender will start next time as it is now."),
2723 std::string message = fmt::format(
2724 fmt::runtime(
IFACE_(
"Template \"{}\" will start next time as it is now.")),
2728 IFACE_(
"Overwrite Template Startup File"),
2737 ot->
name =
"Save Startup File";
2738 ot->
idname =
"WM_OT_save_homefile";
2739 ot->
description =
"Make the current file the default startup file";
2766 ot->
name =
"Save Preferences";
2767 ot->
idname =
"WM_OT_save_userpref";
2768 ot->
description =
"Make the current preferences default";
2785#define USERDEF_RESTORE(member) \
2787 userdef_curr->member = userdef_prev->member; \
2794#undef USERDEF_RESTORE
2851 const bool use_data =
false;
2852 const bool use_userdef =
true;
2853 const bool use_factory_settings =
STREQ(op->
type->
idname,
"WM_OT_read_factory_userpref");
2854 const bool use_factory_settings_app_template_only =
2855 (use_factory_settings &&
RNA_boolean_get(op->
ptr,
"use_factory_startup_app_template_only"));
2862 read_homefile_params.
use_data = use_data;
2866 use_factory_settings_app_template_only;
2877 if (use_factory_settings) {
2878 U.runtime.is_dirty =
true;
2906 IFACE_(
"Revert to Saved Preferences"),
2907 IFACE_(
"Reload preferences from the last saved state"),
2915 ot->
name =
"Load Preferences";
2916 ot->
idname =
"WM_OT_read_userpref";
2929 const bool template_only =
U.app_template[0] &&
2932 if (template_only) {
2935 title = fmt::format(fmt::runtime(
IFACE_(
"Load Factory \"{}\" Preferences.")),
2939 title =
IFACE_(
"Load Factory Blender Preferences");
2946 IFACE_(
"To make changes to Preferences permanent, use \"Save Preferences\""),
2954 ot->
name =
"Load Factory Preferences";
2955 ot->
idname =
"WM_OT_read_factory_userpref";
2957 "Load factory default preferences. "
2958 "To make changes to preferences permanent, use \"Save Preferences\"";
2981 ot->
name =
"Reload History File";
2982 ot->
idname =
"WM_OT_read_history";
2983 ot->
description =
"Reloads history and bookmarks";
3003 "WM_OT_read_factory_settings");
3004 const bool use_factory_settings = use_factory_startup_and_userdef ||
3006 const bool use_factory_settings_app_template_only =
3007 (use_factory_startup_and_userdef &&
3010 bool use_userdef =
false;
3012 const char *filepath =
nullptr;
3015 if (!use_factory_settings) {
3025 filepath = filepath_buf;
3028 op->
reports,
RPT_ERROR,
"Cannot read alternative start-up file: \"%s\"", filepath);
3034 if (use_factory_startup_and_userdef) {
3045 char app_template_buf[
sizeof(
U.app_template)];
3046 const char *app_template;
3048 const bool use_splash = !use_factory_settings &&
RNA_boolean_get(op->
ptr,
"use_splash");
3053 app_template = app_template_buf;
3055 if (!use_factory_settings) {
3074 read_homefile_params.
use_data =
true;
3078 use_factory_settings_app_template_only;
3092 if (use_factory_settings) {
3093 U.runtime.is_dirty =
true;
3119 "WM_OT_read_homefile",
3139 prop =
RNA_def_string(ot->
srna,
"app_template",
"Template",
sizeof(
U.app_template),
"",
"");
3147 "After loading, remove everything except scenes, windows, and workspaces. This makes it "
3148 "possible to load the startup file with its scene configuration and window layout intact, "
3149 "but no objects, materials, animations, ...");
3156 ot->
name =
"Reload Start-Up File";
3157 ot->
idname =
"WM_OT_read_homefile";
3168 "Path to an alternative start-up file");
3173 ot->
srna,
"load_ui",
true,
"Load UI",
"Load user interface setup from the .blend file");
3184 "use_factory_startup",
3187 "Load the default ('factory startup') blend file. "
3188 "This is independent of the normal start-up file that the user can save");
3204 const bool template_only =
U.app_template[0] &&
3207 if (template_only) {
3210 title = fmt::format(fmt::runtime(
IFACE_(
"Load Factory \"{}\" Startup File and Preferences")),
3214 title =
IFACE_(
"Load Factory Default Startup File and Preferences");
3221 unsaved ?
IFACE_(
"To make changes to Preferences permanent, use \"Save Preferences\".\n"
3222 "Warning: Your file is unsaved! Proceeding will abandon your changes.") :
3223 IFACE_(
"To make changes to Preferences permanent, use \"Save Preferences\"."),
3231 ot->
name =
"Load Factory Settings";
3232 ot->
idname =
"WM_OT_read_factory_settings";
3234 "Load factory default startup file and preferences. "
3235 "To make changes permanent, use \"Save Startup File\" and \"Save Preferences\"";
3256 const char *filepath,
3257 const bool use_scripts_autoexec_check,
3264 const bool success =
WM_file_read(
C, filepath, use_scripts_autoexec_check, reports);
3299 for (
int i = 0; targets[i].
run; i++) {
3302 return target.
run(
C, op);
3326 "WM_OT_open_mainfile",
3364 if (!recent_filepath.empty()) {
3365 blendfile_path = recent_filepath.c_str();
3447 if (
BLI_stat(filepath, &stats) == -1) {
3448 return fmt::format(
"{}\n\n{}", filepath,
TIP_(
"File Not Found"));
3453 const time_t ts_now = time(
nullptr);
3469 "{}\n\n{}: {}\n{}: {}", filepath,
TIP_(
"Modified"), modified_s,
TIP_(
"Size"), size_str);
3482 bool is_untrusted =
false;
3492 is_untrusted =
true;
3500 return is_untrusted;
3507 const char *autoexec_text;
3513 autoexec_text =
IFACE_(
"Trusted Source [Untrusted Path]");
3518 autoexec_text =
IFACE_(
"Trusted Source");
3530 "Allow .blend file to execute scripts automatically, default available from "
3531 "system preferences");
3537 ot->
idname =
"WM_OT_open_mainfile";
3556 ot->
srna,
"load_ui",
true,
"Load UI",
"Load user interface setup in the .blend file");
3561 ot->
srna,
"display_file_selector",
true,
"Display File Selector",
"");
3577 std::string message =
IFACE_(
"Any unsaved changes will be lost.");
3580 message +=
IFACE_(
"Warning: There are unsaved external image(s).");
3585 IFACE_(
"Revert to the Saved File"),
3614 return (blendfile_path[0] !=
'\0');
3619 ot->
name =
"Revert";
3620 ot->
idname =
"WM_OT_revert_mainfile";
3637 const bool use_scripts_autoexec_check,
3650 const bool use_scripts_autoexec_check)
3654 if (!
G.background) {
3674 "WM_OT_recover_last_session",
3696 ot->
name =
"Recover Last Session";
3697 ot->
idname =
"WM_OT_recover_last_session";
3730 if (!
G.background) {
3758 ot->
name =
"Recover Auto Save";
3759 ot->
idname =
"WM_OT_recover_auto_save";
3760 ot->
description =
"Open an automatically saved file to recover it";
3807 if (show_save_image_dialog) {
3818 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
3829 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
3835 if (!is_successful) {
3874 char *path_info = strstr(message,
": ");
3877 path_info[1] =
'\0';
3881 uiItemL_ex(&row, message, ICON_NONE,
false,
true);
3883 uiItemL_ex(&row, path_info, ICON_NONE,
false,
true);
3885 MEM_delete(message);
3908 &layout,
RPT_(
"Images are not automatically saved with the file"), ICON_NONE,
true,
false);
3917 std::string message = fmt::format(fmt::runtime(
RPT_(
"Save {} modified image(s)")),
3918 modified_images_count);
3927 &
wm->runtime->save_modified_images_when_file_is_saved,
3938 const bool windows_layout =
true;
3940 const bool windows_layout =
false;
3943 if (windows_layout) {
3947 split.scale_y_set(1.2f);
3949 split.column(
false);
3952 split.column(
false);
3955 split.column(
false);
3962 split.scale_y_set(1.2f);
3964 split.column(
false);
3969 split_right.
column(
false);
3972 split_right.
column(
false);
3975 split_right.
column(
false);
4001 callback->
exec = post_action_fn;
4032 if (blendfile_path[0] !=
'\0') {
4051 if (blendfile_path[0] ==
'\0') {
4055 STRNCPY(filepath, blendfile_path);
4079 "WM_OT_save_as_mainfile",
4116 if (!is_successful) {
4123 "WM_OT_save_mainfile",
4140 if (is_filepath_set) {
4148 if (filepath[0] ==
'\0') {
4151 "Unable to save an unsaved file with an empty or unset \"filepath\" property");
4155 if ((is_save_as ==
false) && is_incremental) {
4160 if (
num == 0 && digits == 0) {
4165 const int tries_limit = 1000;
4173 }
while (in_use && tries < tries_limit &&
num <
INT_MAX);
4180 const int fileflags_orig =
G.fileflags;
4181 int fileflags =
G.fileflags;
4187 C, filepath, fileflags, remap_mode, use_save_as_copy, op->
reports);
4193 G.fileflags = fileflags_orig;
4196 if (success ==
false) {
4202 if (is_incremental) {
4205 else if (is_save_as) {
4207 if (use_save_as_copy) {
4218 if (!use_save_as_copy) {
4232 wm->autosave_scheduled =
false;
4274 "Save the current file in the desired location but do not make the saved file active"));
4283 ot->
name =
"Save As";
4284 ot->
idname =
"WM_OT_save_as_mainfile";
4285 ot->
description =
"Save the current file in the desired location";
4306 "Remap relative paths when saving to a different directory");
4312 "Save a copy of the actual working state but does not make saved file active");
4317 "show_save_modified_images_dialog",
4319 "Show Save Modified Images Dialog",
4320 "Show a popup dialog to save modified images before saving the blend file");
4339 "WM_OT_save_mainfile",
4361 if (blendfile_path[0] !=
'\0') {
4384 "Save the current Blender file with a numerically incremented name that does not "
4385 "overwrite any existing files");
4392 ot->
name =
"Save Blender File";
4393 ot->
idname =
"WM_OT_save_mainfile";
4394 ot->
description =
"Save the current Blender file";
4415 "Remap relative paths when saving to a different directory");
4424 "Save the current Blender file with a numerically incremented name that "
4425 "does not overwrite any existing files");
4430 "show_save_modified_images_dialog",
4432 "Show Save Modified Images Dialog",
4433 "Show a popup dialog to save modified images before saving the blend file");
4448 {0,
nullptr, 0,
nullptr,
nullptr},
4456 C, op, event,
IFACE_(
"Clear Recent Files List"),
IFACE_(
"Remove"));
4467 for (
RecentFile &recent :
G.recent_files.items_mutable()) {
4492 ot->
name =
"Clear Recent Files List";
4493 ot->
idname =
"WM_OT_clear_recent_files";
4513 C, op, event,
IFACE_(
"Clear Recent Projects List"),
IFACE_(
"Remove"));
4525 ot->
name =
"Clear Recent Projects List";
4526 ot->
idname =
"WM_OT_clear_recent_projects";
4527 ot->
description =
"Clear the recent projects list";
4550 popup_block_close(
C, win, block);
4560 popup_block_close(
C, win, block);
4572 popup_block_close(
C, win, block);
4592 const char *title =
RPT_(
4593 "For security reasons, automatic execution of Python scripts "
4594 "in this file was disabled:");
4595 const char *message =
RPT_(
"This may lead to unexpected behavior. Allow at your own risk.");
4601 text_width = std::max(text_width,
4604 const int dialog_width = std::max(
int(500.0f *
UI_SCALE_FAC),
4612 uiItemL_ex(&col, title, ICON_NONE,
true,
false);
4613 uiItemL_ex(&col,
G.autoexec_fail, ICON_NONE,
false,
true);
4614 col.
label(message, ICON_NONE);
4621 split.scale_y_set(1.2f);
4624 split.column(
false).separator();
4626 split.column(
false);
4630 if ((blendfile_path[0] !=
'\0') &&
wm->file_saved) {
4631 but = uiDefIconTextBut(block,
4634 IFACE_(
"Allow Execution"),
4640 TIP_(
"Reload file with execution of Python scripts enabled"));
4645 but = uiDefIconTextBut(block,
4648 IFACE_(
"Allow Execution"),
4654 TIP_(
"Run potentially unsafe scripts in this blend file"));
4655 button_func_set(but,
4660 split.column(
false);
4661 but = uiDefIconTextBut(block,
4664 IFACE_(
"Continue Safely"),
4670 TIP_(
"Continue using file without Python scripts"));
4711 if (ot ==
nullptr) {
4739 wmWindow *win = (
wm->runtime->winactive) ?
wm->runtime->winactive :
wm->windows.first();
4756 if (!
G_MAIN->is_read_invalid) {
4760 G_MAIN->is_read_invalid =
false;
4763 wmWindow *win = (
wm->runtime->winactive) ?
wm->runtime->winactive :
wm->windows.first();
4774 RPT_(
"Unable to Load File"),
4775 RPT_(
"The file is not a valid Blender file."),
4799 char writer_ver_str[16];
4800 char current_ver_str[16];
4809 writer_ver_str,
sizeof(writer_ver_str), bmain->
versionfile, -1);
4814 char message_line1[256];
4815 char message_line2[256];
4817 RPT_(
"This file was saved by a newer version of Blender (%s)."),
4820 RPT_(
"Saving it with this Blender (%s) may cause loss of data."),
4822 layout.
label(message_line1, ICON_NONE);
4823 layout.
label(message_line2, ICON_NONE);
4831 layout.
label(
RPT_(
"This file is managed by the Blender asset system. It can only be"),
4833 layout.
label(
RPT_(
"saved as a new, regular file."), ICON_NONE);
4841 RPT_(
"OpenColorIO configuration failed to load.") :
4842 RPT_(
"Displays, views or color spaces in this file were missing and have "
4845 layout.
label(
RPT_(
"Saving it with this OpenColorIO configuration may cause loss of data."),
4853 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
4875 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
4878 PointerRNA *operator_propptr_p = &operator_propptr;
4900 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
4940 RPT_(
"Cannot overwrite asset system files. Save as new file"),
4944 uiItemL_ex(&layout,
RPT_(
"with an older Blender version?"), ICON_NONE,
true,
false);
4948 &layout,
RPT_(
"Overwrite file with an older Blender version?"), ICON_NONE,
true,
false);
4953 RPT_(
"Cannot overwrite asset system files. Save as new file?"),
4964 RPT_(
"Overwrite file with current OpenColorIO configuration?"),
4973 if (blendfile_path[0] !=
'\0') {
4993 split.scale_y_set(1.2f);
4995 split.column(
false);
4998 if (allow_overwrite) {
5004 split_right.
column(
false);
5007 split_right.
column(
false);
5010 split_right.
column(
false);
5021 callback->
exec =
nullptr;
5043 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
5055 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
5067 bool execute_callback =
true;
5070 popup_block_close(
C, win,
static_cast<ui::Block *
>(arg_block));
5080 execute_callback =
false;
5086 if (file_has_been_saved_before) {
5097 execute_callback =
false;
5103 execute_callback =
false;
5110 execute_callback =
false;
5113 if (execute_callback) {
5145 const bool needs_overwrite_confirm)
5152 needs_overwrite_confirm ?
IFACE_(
"Save As...") :
IFACE_(
"Save"),
5168 char *save_catalogs_when_file_is_closed =
static_cast<char *
>(arg1);
5189 uiItemL_ex(&layout,
RPT_(
"Save changes before closing?"), ICON_NONE,
true,
false);
5194 if (blendfile_path[0] !=
'\0') {
5204 if (needs_overwrite_confirm) {
5215 bool has_extra_checkboxes =
false;
5218 if (modified_images_count > 0) {
5219 std::string message = fmt::format(fmt::runtime(
RPT_(
"Save {} modified image(s)")),
5220 modified_images_count);
5222 if (!has_extra_checkboxes) {
5236 has_extra_checkboxes =
true;
5240 static char save_catalogs_when_file_is_closed;
5245 if (!has_extra_checkboxes) {
5251 "Save modified asset catalogs",
5256 &save_catalogs_when_file_is_closed,
5260 button_func_set(but,
5262 &save_catalogs_when_file_is_closed,
5264 has_extra_checkboxes =
true;
5273 const bool windows_layout =
true;
5275 const bool windows_layout =
false;
5278 if (windows_layout) {
5282 split.scale_y_set(1.2f);
5284 split.column(
false);
5287 split.column(
false);
5290 split.column(
false);
5297 split.scale_y_set(1.2f);
5299 split.column(
false);
5304 split_right.
column(
false);
5307 split_right.
column(
false);
5310 split_right.
column(
false);
5339 callback->
exec = post_action_fn;
#define BLENDER_USERPREF_FILE
#define BLENDER_HISTORY_FILE
#define BLENDER_STARTUP_FILE
#define BLENDER_QUIT_FILE
#define BLENDER_FILE_SUBVERSION
#define BLENDER_FILE_VERSION
#define BLENDER_ASSET_FILE_SUFFIX
#define G_FLAG_ALL_READFILE
#define G_FLAG_INTERNET_OVERRIDE_PREF_ANY
#define G_FLAG_ALL_RUNTIME
#define BLF_DRAW_STR_DUMMY_MAX
File and directory operations.
#define FILELIST_DIRENTRY_SIZE_LEN
Wrapper for reading from various sources (e.g. raw files, compressed files, memory....
#define BLI_SCOPED_DEFER(function_to_defer)
#define BLI_path_join(...)
#define SNPRINTF(dst, format,...)
#define SNPRINTF_UTF8(dst, format,...)
Platform independent time functions.
Compatibility-like things for windows.
external readfile function prototypes.
external writefile.cc function prototypes.
#define BLT_I18NCONTEXT_ID_WORKSPACE
#define CTX_IFACE_(context, msgid)
#define CTX_DATA_(context, msgid)
#define CLOG_WARN(clg_ref,...)
#define CLOG_INFO_NOCHECK(clg_ref, format,...)
#define CLOG_INFO(clg_ref,...)
int datatoc_startup_blend_size
const char datatoc_startup_blend[]
#define PREVIEW_RENDER_LARGE_HEIGHT
void MEM_CacheLimiter_set_maximum(size_t m)
Read Blender memory allocation and freeing.
#define ND_ASSET_LIST_READING
#define BLI_assert_unreachable()
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLI_assert_msg(a, msg)
static GHOST_ISystemPaths * get()
virtual void addToSystemRecentFiles(const char *filepath) const =0
virtual void setUserData(const GHOST_TUserDataPtr user_data)=0
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
std::string datetime(const std::tm &date_time, StringRef locale_iso={}, DateFormat date_format=DateFormat::Default, TimeFormat time_format=TimeFormat::H24, const std::tm *now=nullptr, StringRef today={}, StringRef yesterday={})
std::tm localtime_safe(time_t time)
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
void catalogs_set_save_catalogs_when_file_is_saved(bool should_save)
bool catalogs_get_save_catalogs_when_file_is_saved()
void pre_save_assets(Main *bmain)
std::string filename(const std::string_view &str, size_t pos)
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
void set_approximate_size_limit(int64_t limit_in_bytes)
constexpr int MAX_CHANNELS
@ BLOCK_THEME_STYLE_POPUP
void fontstyle_set(const uiFontStyle *fs)
const uiStyle * style_get_dpi()
void popup_block_invoke(bContext *C, BlockCreateFunc func, void *arg, FreeArgFunc arg_free, StructRNA *srna_owner=nullptr)
void view2d_zoom_cache_reset()
bool popup_block_name_exists(const bScreen *screen, StringRef name)
void WM_main_add_notifier(uint type, void *reference)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static wmOperatorStatus wm_clear_recent_files_exec(bContext *, wmOperator *op)
WorkSpaceLayout * ED_workspace_layout_duplicate(Main *bmain, WorkSpace *workspace, const WorkSpaceLayout *layout_old, wmWindow *win) ATTR_NONNULL()
static void wm_file_read_setup_wm_use_new(bContext *C, Main *, BlendFileReadWMSetupData *wm_setup_data, wmWindowManager *wm)
void BKE_undosys_stack_init_from_main(UndoStack *ustack, Main *bmain)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static std::string wm_save_mainfile_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
void WM_OT_clear_recent_files(wmOperatorType *ot)
PropertyRNA * RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
@ V3D_RUNTIME_LOCAL_MAYBE_EMPTY
@ OPEN_MAINFILE_STATE_SELECT_FILE_PATH
@ OPEN_MAINFILE_STATE_DISCARD_CHANGES
@ OPEN_MAINFILE_STATE_OPEN
static bool wm_show_save_modified_images_dialog(const Main *bmain, wmOperator *op)
static ImBuf * blend_file_thumb_from_camera(const bContext *C, Scene *scene, bScreen *screen, BlendThumbnail **r_thumb)
unsigned __int64 uint64_t
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void BKE_blender_userdef_data_set_and_free(UserDef *userdef)
ImBuf * ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph, Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int sizex, int sizey, ImBufFlags imbuf_flag, int alpha_mode, const char *viewname, bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport, bool use_camera_view_bounds, char err_out[256])
void WM_OT_save_as_mainfile(wmOperatorType *ot)
void BKE_callback_exec_string(Main *bmain, const char *str, eCbEvent evt)
BLI_STATIC_ASSERT(ARRAY_SIZE(data_mode_strings)==CTX_MODE_NUM+1, "Must have a string for each context mode") const char *CTX_data_mode_string(const bContext *C)
static wmOperatorStatus wm_userpref_read_invoke(bContext *C, wmOperator *op, const wmEvent *)
static void wm_history_files_free()
void WM_report_banner_show(wmWindowManager *wm, wmWindow *win)
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS
char * STRNCPY(char(&dst)[N], const char *src)
int RNA_enum_get(PointerRNA *ptr, const char *name)
static void save_file_overwrite_cancel(bContext *C, void *arg_block, void *)
static bool wm_file_write_check_with_report_on_failure(Main *bmain, const char *filepath, ReportList *reports)
void BKE_ntree_update(Main &bmain, std::optional< Span< bNodeTree * > > modified_trees=std::nullopt, const NodeTreeUpdateExtraParams ¶ms={})
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
ImBuf * IMB_allocFromBufferOwn(uint8_t *byte_buffer, float *float_buffer, unsigned int w, unsigned int h, unsigned int channels)
wmOperatorStatus WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *)
bool ED_editors_flush_edits(Main *bmain)
void wm_history_file_read()
bool CTX_py_init_get(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void WM_generic_callback_free(wmGenericCallback *callback)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void WM_msgbus_destroy(wmMsgBus *mbus)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
static wmOperatorStatus wm_open_mainfile_dispatch(bContext *C, wmOperator *op)
static void rna_struct_update_when_changed(bContext *C, Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b)
static void create_operator_state(wmOperatorType *ot, int first_state)
const char * WM_init_state_app_template_get()
void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring)
static wmOperatorStatus wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
void BKE_blender_project_recent_clear(bool only_missing)
static void wm_history_file_update()
void IMB_colormanagement_project_read_post(Main *bmain)
static void wm_history_file_write()
static void wm_block_save_modified_images_save(bContext *C, void *arg_block, void *arg_data)
void WM_OT_read_factory_settings(wmOperatorType *ot)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BKE_blender_project_config_autosave(Main *bmain)
@ BKE_CB_EVT_LOAD_FACTORY_USERDEF_POST
@ BKE_CB_EVT_SAVE_POST_FAIL
@ BKE_CB_EVT_VERSION_UPDATE
@ BKE_CB_EVT_EXTENSION_REPOS_UPDATE_PRE
@ BKE_CB_EVT_EXTENSION_REPOS_UPDATE_POST
@ BKE_CB_EVT_LOAD_FACTORY_STARTUP_POST
@ BKE_CB_EVT_LOAD_POST_FAIL
void BKE_ntree_update_tag_id_changed(Main *bmain, ID *id)
void BLT_lang_set(const char *)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void save_file_overwrite_confirm_button(ui::Block *block, wmGenericCallback *post_action)
static std::string wm_open_mainfile_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
bool wm_operator_close_file_dialog_if_needed(bContext *C, wmOperator *op, wmGenericCallbackFn post_action_fn)
static void wm_block_file_close_discard(bContext *C, void *arg_block, void *arg_data)
ImBuf * BKE_main_thumbnail_to_imbuf(Main *bmain, BlendThumbnail *data)
void BKE_reports_free(ReportList *reports)
void BKE_report_print_level_set(ReportList *reports, eReportType level)
static void wm_block_file_close_save(bContext *C, void *arg_block, void *arg_data)
bool BLO_write_file(Main *mainvar, const char *filepath, int write_flags, const BlendFileWriteParams *params, ReportList *reports)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
static wmOperatorStatus wm_clear_recent_projects_exec(bContext *, wmOperator *op)
void BKE_callback_exec_null(Main *bmain, eCbEvent evt)
std::optional< std::string > BKE_appdir_folder_id_create(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
bool WM_file_read(bContext *C, const char *filepath, const bool use_scripts_autoexec_check, ReportList *reports)
void BKE_blendfile_read_make_empty(bContext *C)
@ WM_MSG_STATICTYPE_FILE_READ
void WM_operator_properties_free(PointerRNA *ptr)
ImBuf * IMB_thumb_create(const char *filepath, ThumbSize size, ThumbSource source, ImBuf *img)
static void save_file_overwrite_confirm(bContext *C, void *arg_block, void *arg_data)
UserDef * BKE_blendfile_userdef_read(const char *filepath, ReportList *reports)
static bool wm_open_mainfile_check(bContext *, wmOperator *op)
static wmOperatorStatus wm_revert_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *)
const char * RNA_property_identifier(const PropertyRNA *prop)
static void wm_block_save_modified_images_cancel(bContext *C, void *arg_block, void *)
static wmOperatorStatus wm_clear_recent_projects_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void wm_block_file_close_cancel_button(ui::Block *block, wmGenericCallback *post_action)
static void wm_block_autorun_warning_enable_scripts(bContext *C, ui::Block *block)
static void wm_block_file_close_discard_button(ui::Block *block, wmGenericCallback *post_action)
static void wm_read_callback_pre_wrapper(bContext *C, const char *filepath)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_reports_init(ReportList *reports, int flag)
bool wm_init_last_project_on_startup(Main *bmain)
bool BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static void wm_block_image_save_errors(ui::Layout &layout, ReportList &reports)
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void wm_window_ghostwindows_remove_invalid(bContext *C, wmWindowManager *wm)
void BLI_math_time_seconds_decompose(double seconds, double *r_days, double *r_hours, double *r_minutes, double *r_seconds, double *r_milliseconds)
void CTX_wm_window_set(bContext *C, wmWindow *win)
WorkSpaceLayout * WM_window_get_active_layout(const wmWindow *win)
static wmOperatorStatus wm_recover_auto_save_invoke(bContext *C, wmOperator *op, const wmEvent *)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
static void wm_block_file_close_save_button(ui::Block *block, wmGenericCallback *post_action, const bool needs_overwrite_confirm)
static void wm_gpu_backend_override_from_userdef()
void WM_keyconfig_update(wmWindowManager *wm)
void BKE_blender_project_refresh(Main *bmain, const char *filepath)
static BlendFileReadWMSetupData * wm_file_read_setup_wm_init(bContext *C, Main *bmain, const bool is_read_homefile)
static std::optional< std::string > wm_project_root_path_get(const Main *bmain)
void ED_editors_init(bContext *C)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter)
PointerRNA WM_operator_properties_create_ptr(wmOperatorType *ot)
static wmOperatorStatus wm_userpref_write_exec(bContext *C, wmOperator *op)
static void read_homefile_props(wmOperatorType *ot)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
FileReader * BLO_file_reader_uncompressed_from_descriptor(int filedes)
@ V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
void WM_window_set_active_layout(wmWindow *win, WorkSpace *workspace, WorkSpaceLayout *layout)
void ED_outliner_select_sync_from_all_tag(bContext *C)
static wmOperatorStatus wm_save_auto_save_exec(bContext *C, wmOperator *op)
int RNA_int_get(PointerRNA *ptr, const char *name)
static wmOperatorStatus wm_open_mainfile__open(bContext *C, wmOperator *op)
wmWindow * CTX_wm_window(const bContext *C)
bool AS_asset_library_has_any_unsaved_catalogs()
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void ED_file_read_bookmarks()
const char * BKE_main_blendfile_path_from_global()
MINLINE int max_ii(int a, int b)
static void wm_block_save_modified_images_save_button(ui::Block *block, wmGenericCallback *post_action)
static std::string wm_save_as_mainfile_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
void IMB_thumb_delete(const char *file_or_lib_path, ThumbSize size)
void WM_file_autosave_init(wmWindowManager *wm)
auto BKE_blender_project_read_callback(const Main *bmain, Fn lambda)
void BKE_blender_userdef_app_template_data_set_and_free(UserDef *userdef)
PropertyRNA * RNA_struct_iterator_property(StructRNA *type)
bool WM_autosave_write(wmWindowManager *wm, Main *bmain, ReportList *reports)
int BLI_file_stat_mode(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
UndoStack * BKE_undosys_stack_create()
void wm_test_autorun_warning(bContext *C)
BlendThumbnail * BKE_main_thumbnail_from_imbuf(Main *bmain, ImBuf *img)
void wm_save_file_overwrite_dialog(bContext *C, wmOperator *op)
bool GPU_backend_type_selection_is_overridden()
int BLI_open(const char *filepath, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static const char * save_modified_images_dialog_name
static void wm_read_callback_post_wrapper(bContext *C, const char *filepath, const bool success)
static ImBuf * blend_file_thumb_from_screenshot(bContext *C, BlendThumbnail **r_thumb)
bool BKE_appdir_app_template_any()
void WM_operatortype_last_properties_clear_all()
void WM_OT_open_mainfile(wmOperatorType *ot)
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
void WM_OT_save_homefile(wmOperatorType *ot)
void WM_reinit_gizmomap_all(Main *bmain)
static uint8_t * blend_file_thumb_fast_downscale(const uint8_t *src_rect, const int src_size[2], const int dst_size[2])
void wm_file_read_report(Main *bmain, wmWindow *win)
static wmOperatorStatus wm_open_mainfile__select_file_path_exec(bContext *C, wmOperator *op)
void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
static wmOperatorStatus operator_state_dispatch(bContext *C, wmOperator *op, OperatorDispatchTarget *targets)
void WM_init_splash(bContext *C)
bool wm_file_or_session_data_has_unsaved_changes(const Main *bmain, const wmWindowManager *wm)
bool ED_image_save_all_modified(const bContext *C, ReportList *reports)
static wmOperatorStatus wm_userpref_read_exec(bContext *C, wmOperator *op)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void BKE_libblock_free_data(ID *id, bool do_id_user) ATTR_NONNULL()
void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win)
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
static void save_set_compress(wmOperator *op)
void WM_window_set_active_screen(wmWindow *win, WorkSpace *workspace, bScreen *screen)
struct LinkNode * BLI_file_read_as_lines(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static void wm_file_read_setup_wm_keep_old(const bContext *C, Main *bmain, BlendFileReadWMSetupData *wm_setup_data, wmWindowManager *wm, const bool load_ui)
static wmOperatorStatus wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *)
void wm_close_and_free(bContext *C, wmWindowManager *wm)
bool BKE_main_needs_overwrite_confirm(const Main *bmain)
static wmOperatorStatus wm_recover_last_session_impl(bContext *C, wmOperator *op, const bool use_scripts_autoexec_check)
PropertyType RNA_property_type(PropertyRNA *prop)
void WM_OT_read_factory_userpref(wmOperatorType *ot)
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_path_extension_ensure(char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1
void BKE_blendfile_read_setup_readfile(bContext *C, BlendFileData *bfd, const BlendFileReadParams *params, BlendFileReadWMSetupData *wm_setup_data, BlendFileReadReport *reports, bool startup_update_defaults, const char *startup_app_template)
static void wm_userpref_update_when_changed(bContext *C, Main *bmain, UserDef *userdef_prev, UserDef *userdef_curr)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static ui::Block * block_create__close_file_dialog(bContext *C, ARegion *region, void *arg1)
@ G_BACKGROUND_NO_DEPSGRAPH
std::optional< std::string > BKE_appdir_folder_id(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
static void save_file_overwrite_saveas(bContext *C, void *arg_block, void *)
void WM_event_remove_handlers(bContext *C, ListBaseT< wmEventHandler > *handlers)
void wm_autosave_timer_begin(wmWindowManager *wm)
static int2 blend_file_thumb_clamp_size(const int size[2], const int limit)
void BKE_undosys_stack_clear(UndoStack *ustack)
void WM_OT_recover_last_session(wmOperatorType *ot)
void * BLI_findstring_ptr(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
static void wm_generic_callback_free_user_data_idproperties(void *user_data)
BlendThumbnail * BKE_main_thumbnail_from_buffer(Main *bmain, const uint8_t *rect, const int size[2])
static void wm_block_file_close_cancel(bContext *C, void *arg_block, void *)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
bool BLT_translate_new_dataname()
static void wm_save_modified_images_dialog(bContext *C, wmGenericCallback *post_action)
@ USER_SECTION_DEVELOPER_TOOLS
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
int BLI_path_canonicalize_native(char *path, int path_maxncpy)
bool WM_file_recover_last_session(bContext *C, const bool use_scripts_autoexec_check, ReportList *reports)
static wmOperatorStatus wm_history_file_read_exec(bContext *, wmOperator *)
void WM_keyconfig_reload(bContext *C)
@ BLO_WRITE_PATH_REMAP_RELATIVE
@ BLO_WRITE_PATH_REMAP_NONE
@ BLO_WRITE_PATH_REMAP_ABSOLUTE
static wmOperatorStatus wm_userpref_revert_invoke(bContext *C, wmOperator *op, const wmEvent *)
void WM_OT_revert_mainfile(wmOperatorType *ot)
static void wm_clear_recent_files_ui(bContext *, wmOperator *op)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BKE_blender_project_recent_update(const Main *bmain)
static void save_file_overwrite_saveas_button(ui::Block *block, wmGenericCallback *post_action)
static void file_overwrite_detailed_info_show(ui::Layout &parent_layout, Main *bmain)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void RNA_property_collection_end(CollectionPropertyIterator *iter)
static std::string wm_save_as_mainfile_get_name(wmOperatorType *ot, PointerRNA *ptr)
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void wm_homefile_read_post(bContext *C, const wmFileReadPost_Params *params_file_read_post)
bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_maxncpy) ATTR_NONNULL(1)
wmWindowManager * CTX_wm_manager(const bContext *C)
static ui::Block * block_create_save_modified_images_dialog(bContext *C, ARegion *region, void *arg)
int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL()
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
int BLI_access(const char *filepath, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void WM_OT_read_userpref(wmOperatorType *ot)
static char save_images_when_file_is_closed
static void wm_history_file_free(RecentFile *recent)
std::variant< BlenderHeaderInvalid, BlenderHeaderUnknown, BlenderHeader > BlenderHeaderVariant
void WM_toolsystem_init(const bContext *C)
static void read_factory_reset_props(wmOperatorType *ot)
void wm_window_close_request(bContext *C, wmWindowManager *wm, wmWindow *win)
void ED_image_internal_autosave_flush(const Main *bmain)
static void save_file_overwrite_cancel_button(ui::Block *block, wmGenericCallback *post_action)
WorkSpaceLayout * BKE_workspace_layout_find_global(const Main *bmain, const bScreen *screen, WorkSpace **r_workspace) ATTR_NONNULL(1
void GPU_backend_type_selection_set_override(GPUBackendType backend_type)
@ USER_FILE_PREVIEW_CAMERA
@ USER_FILE_PREVIEW_SCREENSHOT
void wm_test_autorun_revert_action_set(wmOperatorType *ot, PointerRNA *ptr)
static void wm_open_mainfile_ui(bContext *, wmOperator *op)
void BKE_scene_free_depsgraph_hash(Scene *scene)
void wm_event_do_depsgraph(bContext *C, bool is_after_open_file)
bool BKE_appdir_app_template_has_userpref(const char *app_template) ATTR_NONNULL(1)
void WM_init_input_devices()
static RecentFile * wm_history_file_new(const char *filepath)
void ED_editors_exit(Main *bmain, bool do_undo_system)
bool WM_file_read_project(bContext *C, const char *filepath, ReportList *reports)
void BLO_sanitize_experimental_features_userpref_blend(UserDef *userdef)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void wm_autosave_location(char filepath[FILE_MAX])
void wm_homefile_read_ex(bContext *C, const wmHomeFileRead_Params *params_homefile, ReportList *reports, wmFileReadPost_Params **r_params_file_read_post)
void BPY_python_reset(bContext *C)
bool BPY_run_string_eval(bContext *C, const char *imports[], const char *expr)
static wmOperatorStatus wm_homefile_read_invoke(bContext *C, wmOperator *op, const wmEvent *)
BlendFileData * BKE_blendfile_read_from_memory(const void *file_buf, int file_buf_size, const BlendFileReadParams *params, ReportList *reports)
int BLI_rename_overwrite(const char *from, const char *to) ATTR_NONNULL()
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
void AS_asset_libraries_exit()
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
static bool wm_save_mainfile_check(bContext *, wmOperator *op)
static bool wm_file_read_opwrap(bContext *C, const char *filepath, const bool use_scripts_autoexec_check, ReportList *reports)
static bool wm_open_init_use_scripts(wmOperator *op, const OpenTrust source_of_trust)
void wm_autosave_timer(Main *bmain, wmWindowManager *wm, wmTimer *)
void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose)
void wm_window_clear_drawable(wmWindowManager *wm)
bool BLI_file_is_writable(const char *filepath) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static int get_operator_state(wmOperator *op)
void WM_OT_clear_recent_projects(wmOperatorType *ot)
static bool wm_revert_mainfile_poll(bContext *)
static wmOperatorStatus wm_homefile_write_exec(bContext *C, wmOperator *op)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
ATTR_WARN_UNUSED_RESULT const size_t num
static void wm_block_save_modified_images_cancel_button(ui::Block *block, wmGenericCallback *post_action)
ListBaseT< RenderEngineType > R_engines
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
static void save_set_filepath(bContext *C, wmOperator *op)
wmOperatorStatus WM_operator_confirm_ex(bContext *C, wmOperator *op, const char *title, const char *message, const char *confirm_text, ui::AlertIcon icon, bool cancel_default)
void CTX_wm_region_popup_set(bContext *C, ARegion *region_popup)
static void set_next_operator_state(wmOperator *op, int state)
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
int BLI_path_slash_ensure(char *path, size_t path_maxncpy) ATTR_NONNULL(1)
bool BLI_path_extension_replace(char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1
static bool wm_autosave_write_try(Main *bmain, wmWindowManager *wm)
void WM_OT_save_mainfile(wmOperatorType *ot)
void WM_OT_save_userpref(wmOperatorType *ot)
void BLI_timer_on_file_load()
bool BKE_main_namemap_validate(Main &bmain)
int BLI_listbase_count_at_most(const ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static wmOperatorStatus wm_open_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *)
void BKE_sound_init(Main *bmain)
static void wm_homefile_read_after_dialog_callback(bContext *C, void *user_data)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void BKE_lib_override_library_main_operations_create(Main *bmain, bool force_auto, int *r_report_flags)
static const char * close_file_dialog_name
void BLI_path_to_display_name(char *display_name, int display_name_maxncpy, const char *name) ATTR_NONNULL(1
bool BLI_path_filename_ensure(char *filepath, size_t filepath_maxncpy, const char *filename) ATTR_NONNULL(1
void wm_exit_schedule_delayed(const bContext *C)
static void wm_recover_last_session_after_dialog_callback(bContext *C, void *user_data)
std::string BKE_is_path_inside_blender_project(const char *path)
void RNA_property_collection_next(CollectionPropertyIterator *iter)
wmOperatorStatus WM_operator_props_popup_confirm_ex(bContext *C, wmOperator *op, const wmEvent *, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)
static void wm_autosave_timer_begin_ex(wmWindowManager *wm, double timestep)
void wm_test_foreign_file_warning(bContext *C)
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
static struct blender::@303146302033074327013102311372206230213006073251 wm_init_state_app_template
wmOperatorStatus WM_operator_name_call_with_properties(bContext *C, const char *opstring, wm::OpCallContext context, IDProperty *properties, const wmEvent *event)
void IMB_colormanagement_file_save_post(Main *bmain)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
static const char * save_file_overwrite_dialog_name
void wm_add_default(Main *bmain, bContext *C)
static void wm_file_read_post(bContext *C, const char *filepath, const wmFileReadPost_Params *params)
void WM_msg_publish_static(wmMsgBus *mbus, int event)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
wmGenericCallback * WM_generic_callback_steal(wmGenericCallback *callback)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
IDNewNameResult BKE_libblock_rename(Main &bmain, ID &id, StringRefNull name, const IDNewNameMode mode=IDNewNameMode::RenameExistingNever)
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
static void wm_block_autorun_warning_ignore(bContext *C, ui::Block *block)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
static void wm_block_autorun_warning_reload_with_scripts(bContext *C, ui::Block *block)
void wm_autosave_delete()
void WM_file_tag_modified()
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
static void file_read_reports_finalize(BlendFileReadReport *bf_reports)
static wmOperatorStatus wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *)
@ G_FLAG_USERPREF_NO_SAVE_ON_EXIT
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET
@ G_FLAG_SCRIPT_AUTOEXEC_FAIL
Main * CTX_data_main(const bContext *C)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
void wm_homefile_read(bContext *C, const wmHomeFileRead_Params *params_homefile, ReportList *reports)
static void popup_block_wm_generic_callback_free(void *arg)
static void wm_file_read_setup_wm_substitute_old_window(wmWindowManager *oldwm, wmWindowManager *wm, wmWindow *oldwin, wmWindow *win)
void IDP_FreeProperty(IDProperty *prop)
static struct blender::@126022146021364353211265170353257024064164030157 wm_test_autorun_revert_action_data
static ui::Block * block_create_save_file_overwrite_dialog(bContext *C, ARegion *region, void *arg1)
BlendFileData * BKE_blendfile_read(const char *filepath, const BlendFileReadParams *params, BlendFileReadReport *reports)
void WM_OT_read_homefile(wmOperatorType *ot)
bool BKE_autoexec_default_trust_source(const char *path, const AutoExec_Params ¶ms)
bool WM_autosave_is_scheduled(wmWindowManager *wm)
static void wm_filepath_default(const Main *bmain, char *filepath)
void BKE_undosys_stack_init_from_context(UndoStack *ustack, bContext *C)
void WM_OT_save_auto_save(wmOperatorType *ot)
static wmOperatorStatus wm_clear_recent_files_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@ USER_SCRIPT_AUTOEXEC_DISABLE
bool BKE_blendfile_userdef_write_all(ReportList *reports)
static wmOperatorStatus wm_open_mainfile_exec(bContext *C, wmOperator *op)
bool BLI_path_contains(const char *container_path, const char *containee_path) ATTR_NONNULL(1
const char * BLT_lang_get()
static wmOperatorStatus wm_open_mainfile__discard_changes_exec(bContext *C, wmOperator *op)
bool BKE_addon_remove_safe(ListBaseT< bAddon > *addon_list, const char *module)
static ui::Block * block_create_autorun_warning(bContext *C, ARegion *region, void *)
wmOperatorStatus WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
static void save_catalogs_when_file_is_closed_set_fn(bContext *, void *arg1, void *)
static void wm_userpref_read_exceptions(UserDef *userdef_curr, const UserDef *userdef_prev)
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
int BLI_path_sequence_decode(const char *path, char *head, size_t head_maxncpy, char *tail, size_t tail_maxncpy, unsigned short *r_digits_len)
uint8_t * WM_window_pixels_read_from_frontbuffer(const wmWindowManager *wm, const wmWindow *win, int r_size[2])
bool BKE_autoexec_match(const char *path, bool canonicalize, bool strip_filename)
void BLI_path_sequence_encode(char *path, size_t path_maxncpy, const char *head, const char *tail, unsigned short numlen, int pic)
bool BKE_blendfile_extension_check(const char *str)
void WM_window_csd_params_update()
double BLI_time_now_seconds()
static std::string wm_recent_filepath_get(const Main *bmain)
static void wm_init_userdef(Main *bmain)
static void wm_file_read_pre(bool use_data, bool)
static void wm_test_autorun_revert_action_exec(bContext *C)
static wmOperatorStatus wm_homefile_write_invoke(bContext *C, wmOperator *op, const wmEvent *)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
Scene * CTX_data_scene(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
static bool wm_file_write(bContext *C, const char *filepath, int fileflags, eBLO_WritePathRemap remap_mode, bool use_save_as_copy, ReportList *reports)
bool BPY_run_string_exec(bContext *C, const char *imports[], const char *expr)
void WM_OT_recover_auto_save(wmOperatorType *ot)
static void wm_operator_save_modified_images_dialog(bContext *C, wmOperator *op, wmGenericCallbackFn post_action_fn)
void wm_clear_default_size(bContext *C)
bool ED_undosys_autosave_compatible(UndoStack *ustack)
void WM_jobs_kill_all(wmWindowManager *wm)
static wmOperatorStatus wm_revert_mainfile_exec(bContext *C, wmOperator *op)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const wmEventType event_type, const double time_step)
ImBuf * ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, Object *camera, int width, int height, ImBufFlags imbuf_flags, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
void wm_close_file_dialog(bContext *C, wmGenericCallback *post_action)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
int BLI_str_rstrip_digits(char *str) ATTR_NONNULL()
void WM_check(bContext *C)
void(*)(bContext *C, void *user_data) wmGenericCallbackFn
ImBuf * IMB_scale_into_new(const ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
ReportList * CTX_wm_reports(const bContext *C)
bool IMB_scale(ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
void BKE_blender_version_blendfile_string_from_values(char *str_buff, const size_t str_buff_maxncpy, const short file_version, const short file_subversion)
static void wm_file_read_setup_wm_finalize(bContext *C, Main *bmain, BlendFileReadWMSetupData *wm_setup_data)
static wmOperatorStatus wm_homefile_read_exec(bContext *C, wmOperator *op)
static RecentFile * wm_file_history_find(const char *filepath)
bScreen * WM_window_get_active_screen(const wmWindow *win)
void WM_cursor_wait(bool val)
void BLI_file_free_lines(struct LinkNode *lines)
static void wm_open_mainfile_def_property_use_scripts(wmOperatorType *ot)
bool BKE_blender_project_init_from_root_path(Main *bmain, std::string project_root_path)
int ED_image_save_all_modified_info(const Main *bmain, ReportList *reports)
void wm_autosave_timer_end(wmWindowManager *wm)
void ED_view3d_local_collections_reset(const bContext *C, bool reset_all)
static const EnumPropertyItem prop_clear_recent_types[]
static void wm_open_mainfile_after_dialog_callback(bContext *C, void *user_data)
void wm_open_init_load_ui(wmOperator *op, bool use_prefs)
bool ED_image_should_save_modified(const Main *bmain)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
static wmOperatorStatus wm_recover_last_session_invoke(bContext *C, wmOperator *op, const wmEvent *)
void BKE_tempdir_init(const char *userdir)
void IMB_metadata_set_field(IDProperty *metadata, const char *key, const char *value)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
bool WM_window_is_temp_screen(const wmWindow *win)
static wmOperatorStatus wm_recover_last_session_exec(bContext *C, wmOperator *op)
void WM_file_autoexec_init(const char *filepath)
void WM_OT_read_history(wmOperatorType *ot)
void WM_init_state_app_template_set(const char *app_template)
BlenderHeaderVariant BLO_readfile_blender_header_decode(FileReader *file)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
@ USER_SAVE_MODIFIED_IMAGES_ALWAYS
@ USER_SAVE_MODIFIED_IMAGES_ASK
static int wm_read_exotic(const char *filepath)
bool RNA_property_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, PropertyRNA *prop, eRNACompareMode mode)
void BKE_libblock_free_data_py(ID *id)
static wmOperatorStatus wm_read_factory_settings_invoke(bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus wm_recover_auto_save_exec(bContext *C, wmOperator *op)
void BLI_filelist_entry_size_to_string(const struct stat *st, uint64_t st_size_fallback, bool compact, char r_size[FILELIST_DIRENTRY_SIZE_LEN])
UserDef * BKE_blendfile_userdef_from_defaults()
static OperatorDispatchTarget wm_open_mainfile_dispatch_targets[]
int resynced_lib_overrides_libraries_count
struct blender::BlendFileReadReport::@140003175311343306107257242277261221002217304000 count
LinkNode * resynced_lib_overrides_libraries
bool pre_animato_file_loaded
struct blender::BlendFileReadReport::@070156237370130334241363347365056360307125257043 duration
eBLO_WritePathRemap remap_mode
const BlendThumbnail * thumb
IDProperty * metadata_for_write()
bke::library::LibraryRuntime * runtime
bool is_missing_opencolorio_config
bool is_failed_opencolorio_config
ListBaseT< wmWindowManager > wm
MainColorspace colorspace
ListBaseT< Library > libraries
ListBaseT< WorkSpace > workspaces
bool has_forward_compatibility_issues
ListBaseT< Scene > scenes
BlendThumbnail * blen_thumb
ListBaseT< bScreen > screens
wmOperatorStatus(*) run(bContext *C, wmOperator *op)
ListBaseT< SpaceLink > spacedata
ListBaseT< struct ScrArea > areabase
ListBaseT< wmKeyConfig > keyconfigs
wmKeyConfig * defaultconf
ListBaseT< wmEventHandler > handlers
ListBaseT< wmEventHandler > modalhandlers
wmEvent * event_last_handled
void enabled_set(bool enabled)
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)
void label(StringRef name, int icon)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
void active_set(bool active)
Layout & split(float percentage, bool align)
Layout & column(bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void scale_y_set(float scale)
eWM_EventHandlerType type
wmGenericUserDataFreeFn free_user_data
unsigned int is_first_time
unsigned int use_empty_data
unsigned int use_factory_settings
const char * filepath_startup_override
unsigned int use_factory_settings_app_template_only
const char * app_template_override
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) check(bContext *C, wmOperator *op)
const char * translation_context
void(*) ui(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
std::string(*) get_name(wmOperatorType *ot, PointerRNA *ptr)
struct ReportList * reports
struct wmOperatorType * type
ListBaseT< wmWindow > windows
bke::WindowManagerRuntime * runtime
bke::WindowRuntime * runtime
struct WorkSpaceInstanceHook * workspace_hook
#define BKE_READ_EXOTIC_OK_BLEND
#define BKE_READ_EXOTIC_FAIL_FORMAT
#define BKE_READ_EXOTIC_FAIL_OPEN
#define USERDEF_RESTORE(member)
#define BKE_READ_EXOTIC_FAIL_PATH