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/BKE_library.h1
-rw-r--r--source/blender/blenkernel/intern/library.c12
-rw-r--r--source/blender/editors/object/object_add.c3
3 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index 4bd762a0ca3..9cfc0373952 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -72,6 +72,7 @@ void BKE_id_lib_local_paths(struct Main *bmain, struct Library *lib, struct ID *
void id_lib_extern(struct ID *id);
void BKE_library_filepath_set(struct Library *lib, const char *filepath);
void id_us_ensure_real(struct ID *id);
+void id_us_clear_real(struct ID *id);
void id_us_plus(struct ID *id);
void id_us_min(struct ID *id);
void id_fake_user_set(struct ID *id);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index c06f776f6d0..c04eda00904 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -183,7 +183,7 @@ void id_us_ensure_real(ID *id)
}
/* Unused currently... */
-static void UNUSED_FUNCTION(id_us_clear_real)(ID *id)
+void id_us_clear_real(ID *id)
{
if (id && (id->tag & LIB_TAG_EXTRAUSER)) {
if (id->tag & LIB_TAG_EXTRAUSER_SET) {
@@ -1298,6 +1298,16 @@ void BKE_libblock_free_us(Main *bmain, void *idv) /* test users */
id_us_min(id);
+ /* XXX This is a temp (2.77) hack so that we keep same behavior as in 2.76 regarding groups when deleting an object.
+ * Since only 'user_one' usage of objects is groups, and only 'real user' usage of objects is scenes,
+ * removing that 'user_one' tag when there is no more real (scene) users of an object ensures it gets
+ * fully unlinked.
+ * Otherwise, there is no real way to get rid of an object anymore - better handling of this is TODO.
+ */
+ if ((GS(id->name) == ID_OB) && (id->us == 1)) {
+ id_us_clear_real(id);
+ }
+
if (id->us == 0) {
switch (GS(id->name)) {
case ID_OB:
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 57d16d3104b..88ab3450b04 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1151,7 +1151,6 @@ static int object_delete_exec(bContext *C, wmOperator *op)
}
}
/* end global */
-
}
CTX_DATA_END;
@@ -1159,7 +1158,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* delete has to handle all open scenes */
- BKE_main_id_tag_listbase(&bmain->scene, LIB_TAG_DOIT, 1);
+ BKE_main_id_tag_listbase(&bmain->scene, LIB_TAG_DOIT, true);
for (win = wm->windows.first; win; win = win->next) {
scene = win->screen->scene;