[Bf-blender-cvs] [566eb60d817] master: Fix T53363: Blender won't update mesh's usercount when deleting object datablocks in Editmode.

Bastien Montagne noreply at git.blender.org
Thu Jan 25 10:13:16 CET 2018


Commit: 566eb60d817da3e32661efda59b20f6f893ff7cc
Author: Bastien Montagne
Date:   Thu Jan 25 10:11:12 2018 +0100
Branches: master
https://developer.blender.org/rB566eb60d817da3e32661efda59b20f6f893ff7cc

Fix T53363: Blender won't update mesh's usercount when deleting object datablocks in Editmode.

Only do special handling of ob->data pointer in case we are remapping to
a valid (non-NULL) other obdata. Otherwise, handle it as any other
'remapping to NULL' case.

Hopefully not breaking anything else...

===================================================================

M	source/blender/blenkernel/intern/library_remap.c

===================================================================

diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c
index 49effd033e3..31dc46a55f0 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -194,9 +194,11 @@ static int foreach_libblock_remap_callback(void *user_data, ID *id_self, ID **id
 			id->tag |= LIB_TAG_DOIT;
 		}
 
-		/* Special hack in case it's Object->data and we are in edit mode (skipped_direct too). */
+		/* Special hack in case it's Object->data and we are in edit mode, and new_id is not NULL
+		 * (otherwise, we follow common NEVER_NULL flags).
+		 * (skipped_indirect too). */
 		if ((is_never_null && skip_never_null) ||
-		    (is_obj_editmode && (((Object *)id)->data == *id_p)) ||
+		    (is_obj_editmode && (((Object *)id)->data == *id_p) && new_id != NULL) ||
 		    (skip_indirect && is_indirect))
 		{
 			if (is_indirect) {



More information about the Bf-blender-cvs mailing list