Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-03-11 16:34:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-11 16:40:52 +0300
commit5812bc7d8908015b8a06d240da7964be0a19a2c3 (patch)
tree4b1e62d92c877d894d750732e723cd6eaa15e80e /source/blender/blenkernel/BKE_blendfile.h
parentf7616c6eaf8d983e84aeb838d51fe67e4fa98e16 (diff)
Cleanup: split file read and setup into separate steps
Currently file loading performs almost all reloading logic even in the case loading the file fails, causing the file to be in a state that isn't well defined: undo is cleared, timers are canceled & scripts are re-registered.
Diffstat (limited to 'source/blender/blenkernel/BKE_blendfile.h')
-rw-r--r--source/blender/blenkernel/BKE_blendfile.h53
1 files changed, 25 insertions, 28 deletions
diff --git a/source/blender/blenkernel/BKE_blendfile.h b/source/blender/blenkernel/BKE_blendfile.h
index f73c4a70809..429e294a337 100644
--- a/source/blender/blenkernel/BKE_blendfile.h
+++ b/source/blender/blenkernel/BKE_blendfile.h
@@ -23,6 +23,7 @@
extern "C" {
#endif
+struct BlendFileData;
struct BlendFileReadParams;
struct ID;
struct Main;
@@ -31,36 +32,32 @@ struct ReportList;
struct UserDef;
struct bContext;
-bool BKE_blendfile_read_ex(struct bContext *C,
- const char *filepath,
- const struct BlendFileReadParams *params,
- struct ReportList *reports,
- /* Extra args. */
- const bool startup_update_defaults,
- const char *startup_app_template);
-bool BKE_blendfile_read(struct bContext *C,
- const char *filepath,
- const struct BlendFileReadParams *params,
- struct ReportList *reports);
+void BKE_blendfile_read_setup_ex(struct bContext *C,
+ struct BlendFileData *bfd,
+ const struct BlendFileReadParams *params,
+ struct ReportList *reports,
+ /* Extra args. */
+ const bool startup_update_defaults,
+ const char *startup_app_template);
-bool BKE_blendfile_read_from_memory_ex(struct bContext *C,
- const void *filebuf,
- int filelength,
- const struct BlendFileReadParams *params,
- struct ReportList *reports,
- /* Extra args. */
- const bool startup_update_defaults,
- const char *startup_app_template);
-bool BKE_blendfile_read_from_memory(struct bContext *C,
- const void *filebuf,
- int filelength,
- const struct BlendFileReadParams *params,
- struct ReportList *reports);
+void BKE_blendfile_read_setup(struct bContext *C,
+ struct BlendFileData *bfd,
+ const struct BlendFileReadParams *params,
+ struct ReportList *reports);
-bool BKE_blendfile_read_from_memfile(struct bContext *C,
- struct MemFile *memfile,
- const struct BlendFileReadParams *params,
- struct ReportList *reports);
+struct BlendFileData *BKE_blendfile_read(const char *filepath,
+ const struct BlendFileReadParams *params,
+ struct ReportList *reports);
+
+struct BlendFileData *BKE_blendfile_read_from_memory(const void *filebuf,
+ int filelength,
+ const struct BlendFileReadParams *params,
+ struct ReportList *reports);
+
+struct BlendFileData *BKE_blendfile_read_from_memfile(struct Main *bmain,
+ struct MemFile *memfile,
+ const struct BlendFileReadParams *params,
+ struct ReportList *reports);
void BKE_blendfile_read_make_empty(struct bContext *C);
struct UserDef *BKE_blendfile_userdef_read(const char *filepath, struct ReportList *reports);