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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-01-04 12:25:27 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-01-04 12:28:59 +0300
commit351a9d084f59a6d11be9148830cec86eacb85529 (patch)
tree4e971000a84cb0685a082faebbb9afc6e30b0d4c /source/blender/blenkernel/intern/library_remap.c
parentc0c48cdacc13742e804b19abb7b9b2049fb1bcbd (diff)
Fix T50369: Objects can't be deleted from scene when using "link group objects to scene"
Main issue here was that in old usercount system 'user_real' did simply not allow that kind of thing to work. With new pait of 'USER_EXTRA' tags, it becomes possible to handle the case correctly, by merely refining checks about indirectly use objects whene removing them from a scene. Incidently, found another related bug, 'link group objects to scene' was not incrementing objects' usercount - bad, very very bad!
Diffstat (limited to 'source/blender/blenkernel/intern/library_remap.c')
-rw-r--r--source/blender/blenkernel/intern/library_remap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c
index 4f1f6d963ed..cc7de92c96a 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -883,9 +883,10 @@ void BKE_libblock_free_us(Main *bmain, void *idv) /* test users */
* 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.
+ * But only for local objects, not linked ones!
* 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)) {
+ if ((GS(id->name) == ID_OB) && (id->us == 1) && (id->lib == NULL)) {
id_us_clear_real(id);
}