Merge branch 'master' into blender2.8
[blender.git] / source / blender / blenkernel / intern / library_remap.c
index 255904841b26b070255b0e898f84119a85083bf1..02128ae9c3a6912d093be24499a67a7a739a932b 100644 (file)
@@ -550,8 +550,12 @@ void BKE_libblock_remap_locked(
                id_us_clear_real(old_id);
        }
 
-       BLI_assert(old_id->us - skipped_refcounted >= 0);
-       UNUSED_VARS_NDEBUG(skipped_refcounted);
+       if (old_id->us - skipped_refcounted < 0) {
+               printf("Error in remapping process from '%s' (%p) to '%s' (%p): "
+                      "wrong user count in old ID after process (summing up to %d)\n",
+                      old_id->name, old_id, new_id ? new_id->name : "<NULL>", new_id, old_id->us - skipped_refcounted);
+               BLI_assert(0);
+       }
 
        if (skipped_direct == 0) {
                /* old_id is assumed to not be used directly anymore... */