[Bf-blender-cvs] [6d99b2c0218] master: Cleanup: we now have a way to tag 'from' ID pointers in libquery code.

Bastien Montagne noreply at git.blender.org
Mon Mar 18 11:49:55 CET 2019


Commit: 6d99b2c021847c1015a3945530d4d32049e0d659
Author: Bastien Montagne
Date:   Mon Mar 18 11:47:54 2019 +0100
Branches: master
https://developer.blender.org/rB6d99b2c021847c1015a3945530d4d32049e0d659

Cleanup: we now have a way to tag 'from' ID pointers in libquery code.

So no need to have custom verbose own detection cases for those guys...

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

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

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

diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index 9861b232dd9..453cbe16de0 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -1331,20 +1331,14 @@ void BKE_library_ID_test_usages(Main *bmain, void *idv, bool *is_used_local, boo
 
 /* ***** IDs usages.checking/tagging. ***** */
 static int foreach_libblock_used_linked_data_tag_clear_cb(
-        void *user_data, ID *self_id, ID **id_p, int UNUSED(cb_flag))
+        void *user_data, ID *self_id, ID **id_p, int cb_flag)
 {
 	bool *is_changed = user_data;
 
 	if (*id_p) {
-		/* XXX This is actually some kind of hack...
-		 * Issue is, shapekeys' 'from' ID pointer is not actually ID usage.
-		 * Maybe we should even nuke it from BKE_library_foreach_ID_link, not 100% sure yet...
-		 */
-		if ((GS(self_id->name) == ID_KE) && (((Key *)self_id)->from == *id_p)) {
-			return IDWALK_RET_NOP;
-		}
-		/* XXX another hack, for similar reasons as above one. */
-		if ((GS(self_id->name) == ID_OB) && (((Object *)self_id)->proxy_from == (Object *)*id_p)) {
+		/* The infamous 'from' pointers (Key.from, Object.proxy_from, ...).
+		 * those are not actually ID usage, so we ignore them here. */
+		if (cb_flag & IDWALK_CB_LOOPBACK) {
 			return IDWALK_RET_NOP;
 		}



More information about the Bf-blender-cvs mailing list