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:
authorCampbell Barton <ideasman42@gmail.com>2021-03-28 10:39:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-28 10:48:57 +0300
commit3944560b4a3a8c08a51c955977e3be3ae07a1afa (patch)
tree0331dc9a1bf16f1c3ff34428943f6caf4934c916 /source/blender/editors/space_outliner/outliner_tools.c
parent0a6bca1f75398aa9acbeae8bd596550cd2ee23e6 (diff)
Cleanup: re-order expensive checks for indirect ID use
Check for indirect ID use after other simple user count checks are made. Also assert ED_object_base_free_and_unlink_no_indirect_check object argument isn't indirectly used.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tools.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 95ff42a9946..66eb6ab15dc 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -699,8 +699,8 @@ static void outliner_object_delete_fn(bContext *C, ReportList *reports, Scene *s
reports, RPT_WARNING, "Cannot delete indirectly linked object '%s'", ob->id.name + 2);
return;
}
- if (BKE_library_ID_is_indirectly_used(bmain, ob) && ID_REAL_USERS(ob) <= 1 &&
- ID_EXTRA_USERS(ob) == 0) {
+ if (ID_REAL_USERS(ob) <= 1 && ID_EXTRA_USERS(ob) == 0 &&
+ BKE_library_ID_is_indirectly_used(bmain, ob)) {
BKE_reportf(reports,
RPT_WARNING,
"Cannot delete object '%s' from scene '%s', indirectly used objects need at "
@@ -1422,8 +1422,8 @@ static Base *outline_batch_delete_hierarchy(
base->object->id.name + 2);
return base_next;
}
- if (BKE_library_ID_is_indirectly_used(bmain, object) && ID_REAL_USERS(object) <= 1 &&
- ID_EXTRA_USERS(object) == 0) {
+ if (ID_REAL_USERS(object) <= 1 && ID_EXTRA_USERS(object) == 0 &&
+ BKE_library_ID_is_indirectly_used(bmain, object)) {
BKE_reportf(reports,
RPT_WARNING,
"Cannot delete object '%s' from scene '%s', indirectly used objects need at least "