[Bf-blender-cvs] [22f5a17] id-remap: Fix some bad id->flag/tag mismatch from not-so-recent merge with master...

Bastien Montagne noreply at git.blender.org
Thu Jan 7 16:15:12 CET 2016


Commit: 22f5a17b9c8309a7410fe664bae45ff44fc0ced1
Author: Bastien Montagne
Date:   Thu Jan 7 16:14:16 2016 +0100
Branches: id-remap
https://developer.blender.org/rB22f5a17b9c8309a7410fe664bae45ff44fc0ced1

Fix some bad id->flag/tag mismatch from not-so-recent merge with master...

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

M	source/blender/blenkernel/intern/library.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 0d75285..d523807 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1089,7 +1089,7 @@ static bool foreach_libblock_remap_callback(void *user_data, ID **id_p, int cb_f
 		const bool skip_never_null = (id_remap_data->flag & ID_REMAP_SKIP_NEVER_NULL_USAGE) != 0;
 
 		if ((id_remap_data->flag & ID_REMAP_FLAG_NEVER_NULL_USAGE) && (cb_flag & IDWALK_NEVER_NULL)) {
-			id->flag |= LIB_TAG_DOIT;
+			id->tag |= LIB_TAG_DOIT;
 		}
 
 //		if (GS(old_id->name) == ID_TXT) {
@@ -1220,9 +1220,9 @@ static void libblock_remap_data(
 
 	id_us_clear_real(old_id);
 
-	if (new_id && (new_id->flag & LIB_TAG_INDIRECT) && (r_id_remap_data->status & ID_REMAP_IS_LINKED_DIRECT)) {
-		new_id->flag &= ~LIB_TAG_INDIRECT;
-		new_id->flag |= LIB_TAG_EXTERN;
+	if (new_id && (new_id->tag & LIB_TAG_INDIRECT) && (r_id_remap_data->status & ID_REMAP_IS_LINKED_DIRECT)) {
+		new_id->tag &= ~LIB_TAG_INDIRECT;
+		new_id->tag |= LIB_TAG_EXTERN;
 	}
 
 //	printf("%s: %d occurences skipped (%d direct and %d indirect ones)\n", __func__,
@@ -1306,9 +1306,9 @@ void BKE_libblock_remap_locked(
 
 	if (skipped_direct == 0) {
 		/* old_id is assumed to not be used directly anymore... */
-		if (old_id->lib && (old_id->flag & LIB_TAG_EXTERN)) {
-			old_id->flag &= ~LIB_TAG_EXTERN;
-			old_id->flag |= LIB_TAG_INDIRECT;
+		if (old_id->lib && (old_id->tag & LIB_TAG_EXTERN)) {
+			old_id->tag &= ~LIB_TAG_EXTERN;
+			old_id->tag |= LIB_TAG_INDIRECT;
 		}
 	}
 
@@ -1622,8 +1622,8 @@ void BKE_libblock_delete(Main *bmain, void *idv)
 
 		for (id = lb->first; id; id = id->next) {
 			/* Note: in case we delete a library, we also delete all its datablocks! */
-			if ((id == (ID *)idv) || (id->lib == (Library *)idv) || (id->flag & LIB_TAG_DOIT)) {
-				id->flag |= LIB_TAG_DOIT;
+			if ((id == (ID *)idv) || (id->lib == (Library *)idv) || (id->tag & LIB_TAG_DOIT)) {
+				id->tag |= LIB_TAG_DOIT;
 				/* Will tag 'never NULL' users of this ID too.
 				 * Note that we cannot use BKE_libblock_unlink() here, since it would ignore indirect (and proxy!)
 				 * links, this can lead to nasty crashing here in second, actual deleting loop.
@@ -1643,7 +1643,7 @@ void BKE_libblock_delete(Main *bmain, void *idv)
 
 		for (id = lb->first; id; id = id_next) {
 			id_next = id->next;
-			if (id->flag & LIB_TAG_DOIT) {
+			if (id->tag & LIB_TAG_DOIT) {
 				if (id->us != 0) {
 					printf("%s: deleting %s (%d)\n", __func__, id->name, id->us);
 					BLI_assert(id->us == 0);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 1047cb0..68c55f6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9648,9 +9648,9 @@ static ID *link_named_part(
 			if (G.debug)
 				printf("append: already linked\n");
 			oldnewmap_insert(fd->libmap, bhead->old, id, bhead->code);
-			if (!force_indirect && (id->flag & LIB_TAG_INDIRECT)) {
-				id->flag &= ~LIB_TAG_INDIRECT;
-				id->flag |= LIB_TAG_EXTERN;
+			if (!force_indirect && (id->tag & LIB_TAG_INDIRECT)) {
+				id->tag &= ~LIB_TAG_INDIRECT;
+				id->tag |= LIB_TAG_EXTERN;
 			}
 		}
 	}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 62f5121..14856cc 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2924,7 +2924,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, const bool reloa
 //					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_TAG_INDIRECT) == 0) {
+					if (new_id->lib->parent && (new_id->tag & LIB_TAG_INDIRECT) == 0) {
 						BLI_assert(0);  /* Should not happen in reload case... */
 						new_id->lib->parent = NULL;
 					}
@@ -3059,7 +3059,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, const bool reloa
 //					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_TAG_INDIRECT) == 0) {
+					if (new_id->lib->parent && (new_id->tag & LIB_TAG_INDIRECT) == 0) {
 						new_id->lib->parent = NULL;
 					}
 				}




More information about the Bf-blender-cvs mailing list