[Bf-blender-cvs] [5fb4b2d6ce4] blender-projects-basics: Fix project not updated correctly on file save and write
Julian Eisel
noreply at git.blender.org
Thu Sep 29 15:48:52 CEST 2022
Commit: 5fb4b2d6ce44fc1e570110fa05e7b2467cf8ac02
Author: Julian Eisel
Date: Thu Sep 29 15:46:01 2022 +0200
Branches: blender-projects-basics
https://developer.blender.org/rB5fb4b2d6ce44fc1e570110fa05e7b2467cf8ac02
Fix project not updated correctly on file save and write
===================================================================
M source/blender/blenkernel/intern/blendfile.c
M source/blender/blenloader/intern/writefile.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index 96ae5de7b90..057a96fac61 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -448,6 +448,13 @@ static void setup_app_blend_file_data(bContext *C,
}
}
+static void setup_app_project_data(BlendFileData *bfd, const struct BlendFileReadParams *params)
+{
+ if ((params->skip_flags & BLO_READ_SKIP_DATA) == 0) {
+ BKE_project_active_load_from_path(bfd->main->filepath);
+ }
+}
+
static void handle_subversion_warning(Main *main, BlendFileReadReport *reports)
{
if (main->minversionfile > BLENDER_FILE_VERSION ||
@@ -474,8 +481,8 @@ void BKE_blendfile_read_setup_ex(bContext *C,
BLO_update_defaults_startup_blend(bfd->main, startup_app_template);
}
}
+ setup_app_project_data(bfd, params);
setup_app_blend_file_data(C, bfd, params, reports);
- BKE_project_active_load_from_path(bfd->filepath);
BLO_blendfiledata_free(bfd);
}
diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc
index ee01e35c5aa..2e0ee08530f 100644
--- a/source/blender/blenloader/intern/writefile.cc
+++ b/source/blender/blenloader/intern/writefile.cc
@@ -1443,7 +1443,7 @@ bool BLO_write_file(Main *mainvar,
}
/* Update active project information based on the new file location. */
- BKE_project_active_load_from_path(mainvar->filepath);
+ BKE_project_active_load_from_path(filepath);
/* actual file writing */
const bool err = write_file_handle(
More information about the Bf-blender-cvs
mailing list