[Bf-blender-cvs] [622ce5672a5] master: MakeLocal: fix bad (missing) handling of proxy_from uglyness.

Bastien Montagne noreply at git.blender.org
Fri May 5 16:19:30 CEST 2017


Commit: 622ce5672a532fce9feedd1f85da331b14e553ed
Author: Bastien Montagne
Date:   Fri May 5 16:15:55 2017 +0200
Branches: master
https://developer.blender.org/rB622ce5672a532fce9feedd1f85da331b14e553ed

MakeLocal: fix bad (missing) handling of proxy_from uglyness.

Those shall not be considered while checking whether a to-be-made-local
ID will end up fully local, or still be partially used by linked data...
Even less since we already do have special handling of proxies later.

Fixes main remaining issue found with 04_01_H.lighting.blend Agent327
file, and allows us to switch back to optimized post-processing in
make_local 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 3cf9acc237d..c249577686e 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1722,10 +1722,19 @@ static void library_make_local_copying_check(ID *id, GSet *loop_tags, MainIDRela
 	for (; entry != NULL; entry = entry->next) {
 		ID *par_id = (ID *)entry->id_pointer;  /* used_to_user stores ID pointer, not pointer to ID pointer... */
 
-		/* Shapekeys are considered 'private' to their owner ID here, and never tagged (since they cannot be linked),
-		 * so we have to switch effective parent to their owner. */
-		if (GS(par_id->name) == ID_KE) {
-			par_id = ((Key *)par_id)->from;
+		/* Our oh-so-beloved 'from' pointers... */
+		if (entry->usage_flag & IDWALK_CB_LOOPBACK) {
+			/* We totally disregard Object->proxy_from 'usage' here, this one would only generate fake positives. */
+			if (GS(par_id->name) == ID_OB) {
+				BLI_assert(((Object *)par_id)->proxy_from == (Object *)id);
+				continue;
+			}
+
+			/* Shapekeys are considered 'private' to their owner ID here, and never tagged (since they cannot be linked),
+			 * so we have to switch effective parent to their owner. */
+			if (GS(par_id->name) == ID_KE) {
+				par_id = ((Key *)par_id)->from;
+			}
 		}
 
 		if (par_id->lib == NULL) {
@@ -1948,7 +1957,7 @@ void BKE_library_make_local(
 
 	/* Note: Keeping both version of the code (old one being safer, since it still has checks against unused IDs)
 	 * for now, we can remove old one once it has been tested for some time in master... */
-#if 0
+#if 1
 	/* Step 5: proxy 'remapping' hack. */
 	for (LinkNode *it = copied_ids; it; it = it->next) {
 		/* Attempt to re-link copied proxy objects. This allows appending of an entire scene




More information about the Bf-blender-cvs mailing list