diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-06 15:54:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-06 15:54:28 +0300 |
commit | 90ebf4832f8f9745a60300a1f9bad4bab5af52bc (patch) | |
tree | a4e8c9505822040856e12a5718eca4e5a592d82d /source/blender/blenkernel/intern/library_query.c | |
parent | a9572c282038cd9bdbe18e26e7349d8e0f549cb1 (diff) | |
parent | 0eef40ed514b1370c78be6f6479f1d67cc4de88c (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/library_query.c')
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index 24ddf67a815..3c8d1c6d888 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -560,7 +560,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call if (object->proxy_from) { data.cb_flag = ID_IS_LINKED_DATABLOCK(object->proxy_from) ? IDWALK_CB_INDIRECT_USAGE : 0; } - CALLBACK_INVOKE(object->proxy_from, IDWALK_CB_NOP); + CALLBACK_INVOKE(object->proxy_from, IDWALK_CB_LOOPBACK); data.cb_flag = data_cb_flag; CALLBACK_INVOKE(object->poselib, IDWALK_CB_USER); @@ -765,12 +765,8 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call case ID_KE: { - /* XXX Only ID pointer from shapekeys is the 'from' one, which is not actually ID usage. - * Maybe we should even nuke it from here, not 100% sure yet... - * (see also foreach_libblock_id_users_callback). - */ Key *key = (Key *) id; - CALLBACK_INVOKE_ID(key->from, IDWALK_CB_NOP); + CALLBACK_INVOKE_ID(key->from, IDWALK_CB_LOOPBACK); break; } @@ -1166,20 +1162,15 @@ typedef struct IDUsersIter { int count_direct, count_indirect; /* Set by callback. */ } IDUsersIter; -static int foreach_libblock_id_users_callback(void *user_data, ID *self_id, ID **id_p, int cb_flag) +static int foreach_libblock_id_users_callback(void *user_data, ID *UNUSED(self_id), ID **id_p, int cb_flag) { IDUsersIter *iter = 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... + /* 'Loopback' ID pointers (the ugly 'from' ones, Object->proxy_from and Key->from). + * Those are not actually ID usage, we can ignore them here. */ - 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)) { + if (cb_flag & IDWALK_CB_LOOPBACK) { return IDWALK_RET_NOP; } |