[Bf-blender-cvs] [8b01a6e] master: BKE_library_make_local(): some minor improvements.

Bastien Montagne noreply at git.blender.org
Fri Nov 11 23:18:15 CET 2016


Commit: 8b01a6e0f1ea057f52658ab33a4582d51cea031c
Author: Bastien Montagne
Date:   Fri Nov 11 23:15:55 2016 +0100
Branches: master
https://developer.blender.org/rB8b01a6e0f1ea057f52658ab33a4582d51cea031c

BKE_library_make_local(): some minor improvements.

Do not set 'real user' to groups every time we run the first clearing loop.

And do fully clear properly LIB_TAG_DOIT (this is not yet enforced in
existing code, but would love to get to that stage in future, so let's
do it at least with new code!).

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

M	source/blender/blenkernel/intern/library.c

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

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index d8d700d..823901d 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1745,6 +1745,12 @@ void BKE_library_make_local(
 		if (old_to_new_ids) {
 			BLI_ghash_insert(old_to_new_ids, id, id->newid);
 		}
+
+		/* Special hack for groups... Thing is, since we can't instantiate them here, we need to ensure
+		 * they remain 'alive' (only instantiation is a real group 'user'... *sigh* See T49722. */
+		if (GS(id->name) == ID_GR && (id->tag & LIB_TAG_INDIRECT) != 0) {
+			id_us_ensure_real(id->newid);
+		}
 	}
 
 	/* Step 5: remove datablocks that have been copied to be localized and are no more used in the end...
@@ -1794,11 +1800,6 @@ void BKE_library_make_local(
 					ob->proxy = ob->proxy_from = ob->proxy_group = NULL;
 				}
 			}
-			/* Special hack for groups... Thing is, since we can't instantiate them here, we need to ensure
-			 * they remain 'alive' (only instantiation is a real group 'user'... *sigh* See T49722. */
-			else if (GS(id->name) == ID_GR && (id->tag & LIB_TAG_INDIRECT) != 0) {
-				id_us_ensure_real(id->newid);
-			}
 
 			if (!is_local) {
 				if (!is_lib) {  /* Not used at all, we can free it! */
@@ -1852,6 +1853,7 @@ void BKE_library_make_local(
 #endif
 			((LinkNode *)it->link)->link = NULL;  /* Not strictly necessary, but safer (see T49903)... */
 			it->link = NULL;
+			id->tag &= ~LIB_TAG_DOIT;
 		}
 	}




More information about the Bf-blender-cvs mailing list