diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-26 16:12:43 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-26 16:12:43 +0300 |
commit | b91aea60964e8f01b2ed269734bc2700659fcbb1 (patch) | |
tree | 6667228ba7e21c91a02b29ac9540e71712e4589d /source/blender/blenkernel/intern/library_query.c | |
parent | 01e3141ce6e4addec852ee842f939f56f18df3f6 (diff) |
Fix issues in ID usages checks - we are not interested in self-usages here.
Drivers or constraints referencing self object could break deletion of proxy objects
(due to their ambiguous, half-local, half-linked status).
Diffstat (limited to 'source/blender/blenkernel/intern/library_query.c')
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index 1ded6f6679f..2f83547c14b 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -1015,6 +1015,10 @@ static bool library_ID_is_used(Main *bmain, void *idv, const bool check_linked) } for (; id_curr && !is_defined; id_curr = id_curr->next) { + if (id_curr == id) { + /* We are not interested in self-usages (mostly from drivers or bone constraints...). */ + continue; + } iter.curr_id = id_curr; BKE_library_foreach_ID_link( id_curr, foreach_libblock_id_users_callback, &iter, IDWALK_NOP); @@ -1063,6 +1067,10 @@ void BKE_library_ID_test_usages(Main *bmain, void *idv, bool *is_used_local, boo } for (; id_curr && !is_defined; id_curr = id_curr->next) { + if (id_curr == id) { + /* We are not interested in self-usages (mostly from drivers or bone constraints...). */ + continue; + } iter.curr_id = id_curr; BKE_library_foreach_ID_link(id_curr, foreach_libblock_id_users_callback, &iter, IDWALK_NOP); |