From 6d99b2c021847c1015a3945530d4d32049e0d659 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 18 Mar 2019 11:47:54 +0100 Subject: 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... --- source/blender/blenkernel/intern/library_query.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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; } -- cgit v1.2.3