Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-03-18 13:47:54 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-18 13:47:54 +0300
commit6d99b2c021847c1015a3945530d4d32049e0d659 (patch)
tree633c0469db672d24b685566fed8a790eb181f7a9
parent07355ff74baf08f4470748ff189e4367493d8758 (diff)
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...
-rw-r--r--source/blender/blenkernel/intern/library_query.c14
1 files 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;
}