[Bf-blender-cvs] [a0fd7ab] master: Revert "Make version_update() callback being invoked when linking/appending datablocks"

Sergey Sharybin noreply at git.blender.org
Thu Jan 15 10:24:35 CET 2015


Commit: a0fd7ab28d5365985c8684079097e102915a3bde
Author: Sergey Sharybin
Date:   Thu Jan 15 14:22:28 2015 +0500
Branches: master
https://developer.blender.org/rBa0fd7ab28d5365985c8684079097e102915a3bde

Revert "Make version_update() callback being invoked when linking/appending datablocks"

This reverts commit fbc2909cef83bce722fab8c68e49c878603b4ee8.

The reason for revert is that the commit made it so bpy.data is not set to any
of the new main (on both file open and file link/append) which basically totally
broke versioning code.

Needs some smarter solution there.

===================================================================

M	source/blender/blenloader/intern/readfile.c
M	source/blender/windowmanager/intern/wm_files.c
M	source/blender/windowmanager/intern/wm_init_exit.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5a3e914..7e10bff 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -105,7 +105,6 @@
 
 #include "BLI_endian_switch.h"
 #include "BLI_blenlib.h"
-#include "BLI_callbacks.h"
 #include "BLI_math.h"
 #include "BLI_threads.h"
 #include "BLI_mempool.h"
@@ -7890,12 +7889,8 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
 	}
 	
 	/* do before read_libraries, but skip undo case */
-	if (fd->memfile==NULL) {
+	if (fd->memfile==NULL)
 		do_versions(fd, NULL, bfd->main);
-		if (BLI_thread_is_main()) {
-			BLI_callback_exec(bfd->main, NULL, BLI_CB_EVT_VERSION_UPDATE);
-		}
-	}
 	
 	do_versions_userdef(fd, bfd);
 	
@@ -9532,9 +9527,6 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
 				do_versions(mainptr->curlib->filedata, mainptr->curlib, mainptr);
 			else
 				do_versions(basefd, NULL, mainptr);
-			if (BLI_thread_is_main()) {
-				BLI_callback_exec(mainptr, NULL, BLI_CB_EVT_VERSION_UPDATE);
-			}
 		}
 		
 		if (mainptr->curlib->filedata)
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index c6f12f5..c1c31f6 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -478,6 +478,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
 		WM_operatortype_last_properties_clear_all();
 
 		/* important to do before NULL'ing the context */
+		BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
 		BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
 
 		if (!G.background) {
@@ -671,6 +672,7 @@ int wm_homefile_read(bContext *C, ReportList *reports, bool from_memory, const c
 	WM_operatortype_last_properties_clear_all();
 
 	/* important to do before NULL'ing the context */
+	BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
 	BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
 
 	WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 03c6414..cb03d02 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -240,6 +240,7 @@ void WM_init(bContext *C, int argc, const char **argv)
 		 *
 		 * unlikely any handlers are set but its possible,
 		 * note that recovering the last session does its own callbacks. */
+		BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
 		BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
 	}
 }




More information about the Bf-blender-cvs mailing list