[Bf-blender-cvs] [6f90aa2] id-remap: Fix issue when reloading a lib with selected object.

Bastien Montagne noreply at git.blender.org
Mon Nov 30 15:41:17 CET 2015


Commit: 6f90aa2016fe83b00f3a081e493fdf7561f74663
Author: Bastien Montagne
Date:   Mon Nov 30 10:48:55 2015 +0100
Branches: id-remap
https://developer.blender.org/rB6f90aa2016fe83b00f3a081e493fdf7561f74663

Fix issue when reloading a lib with selected object.

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

M	source/blender/blenkernel/intern/library_query.c
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index 0af3067..627b0fc 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -254,7 +254,8 @@ void BKE_library_foreach_ID_link(ID *id, LibraryIDLinkCallback callback, void *u
 				BKE_library_foreach_ID_link((ID *)scene->nodetree, callback, user_data, flag);
 			}
 			if (scene->basact) {
-				CALLBACK_INVOKE(scene->basact->object, IDWALK_NOP);
+				/* Eeeek... baseact is also in scene->base list, any good reason to call this twice? */
+				CALLBACK_INVOKE(scene->basact->object, IDWALK_USER);
 			}
 			CALLBACK_INVOKE(scene->obedit, IDWALK_NOP);
 
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index d573482..bd2acb5 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -3123,7 +3123,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, const bool reloa
 				/* Since we asked for placeholders in case of missing IDs, we expect to always get a valid one. */
 				BLI_assert(new_id);
 				if (new_id) {
-//					printf("before remap, old_id users: %d (%p), new_id users: %d (%p)\n", old_id->us, old_id->lib, new_id->us, new_id->lib);
+//					printf("before remap, old_id users: %d (%p), new_id users: %d (%p)\n", old_id->us, old_id, new_id->us, new_id);
 					/* Note that here, we also want to replace indirect usages. */
 					BKE_libblock_remap_locked(bmain, old_id, new_id, false);
 
@@ -3253,7 +3253,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, const bool reloa
 
 				BLI_assert(old_id);
 				if (new_id) {
-					printf("before remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us);
+//					printf("before remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us);
 					BKE_libblock_remap_locked(bmain, old_id, new_id, true);
 
 					if (old_id->flag & LIB_FAKEUSER) {
@@ -3261,7 +3261,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, const bool reloa
 						id_fake_user_set(new_id);
 					}
 
-					printf("after remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us);
+//					printf("after remap, old_id users: %d, new_id users: %d\n", old_id->us, new_id->us);
 
 					/* In some cases, new_id might become direct link, remove parent of library in this case. */
 					if (new_id->lib->parent && (new_id->flag & LIB_INDIRECT) == 0) {




More information about the Bf-blender-cvs mailing list