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:
-rw-r--r--source/blender/blenkernel/intern/library_query.c14
-rw-r--r--source/blender/blenkernel/intern/library_remap.c4
2 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index afee80d5206..d068a394089 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -960,14 +960,19 @@ static bool library_ID_is_used(Main *bmain, void *idv, const bool check_linked)
{
IDUsersIter iter;
ListBase *lb_array[MAX_LIBARRAY];
+ ID *id = idv;
int i = set_listbasepointers(bmain, lb_array);
bool is_defined = false;
- iter.id = idv;
+ iter.id = id;
iter.count = 0;
while (i-- && !is_defined) {
ID *id_curr = lb_array[i]->first;
+ if (!id_curr || !BKE_library_idtype_can_use_idtype(GS(id->name), GS(id_curr->name))) {
+ continue;
+ }
+
for (; id_curr && !is_defined; id_curr = id_curr->next) {
if (check_linked != ID_IS_LINKED_DATABLOCK(id_curr)) {
continue;
@@ -1007,14 +1012,19 @@ void BKE_library_ID_test_usages(Main *bmain, void *idv, bool *is_used_local, boo
{
IDUsersIter iter_local, iter_linked;
ListBase *lb_array[MAX_LIBARRAY];
+ ID *id = idv;
int i = set_listbasepointers(bmain, lb_array);
bool is_defined = false;
- iter_local.id = iter_linked.id = idv;
+ iter_local.id = iter_linked.id = id;
iter_local.count = iter_linked.count = 0;
while (i-- && !is_defined) {
ID *id_curr = lb_array[i]->first;
+ if (!id_curr || !BKE_library_idtype_can_use_idtype(GS(id->name), GS(id_curr->name))) {
+ continue;
+ }
+
for (; id_curr && !is_defined; id_curr = id_curr->next) {
IDUsersIter *iter = (ID_IS_LINKED_DATABLOCK(id_curr)) ? &iter_linked : &iter_local;
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c
index a290c1c8cf5..491994a9555 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -283,6 +283,10 @@ static void libblock_remap_data(
while (i--) {
ID *id_curr = lb_array[i]->first;
+ if (!id_curr || !BKE_library_idtype_can_use_idtype(GS(id_curr->name), GS(old_id->name))) {
+ continue;
+ }
+
for (; id_curr; id_curr = id_curr->next) {
/* Note that we cannot skip indirect usages of old_id here (if requested), we still need to check it for
* the user count handling...