diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-02-24 14:10:27 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-03-23 14:21:29 +0300 |
commit | a73fa2e02c8b97dbf30b744c45fb9b515591ecd6 (patch) | |
tree | 3f14cae0a9f80344c77a5823c8be605db9b91d2f /source/blender/blenkernel/intern/group.c | |
parent | a12f53ab83664c2d52033236ee513c5212cfa2fc (diff) |
Unlink and cleanup functions when objects or the cached group get
unlinked or changed.
Diffstat (limited to 'source/blender/blenkernel/intern/group.c')
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index ae3ab833a87..f3869e4eb72 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -36,6 +36,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_cache_library_types.h" #include "DNA_group_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" @@ -45,7 +46,7 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" - +#include "BKE_cache_library.h" #include "BKE_depsgraph.h" #include "BKE_global.h" #include "BKE_group.h" @@ -78,6 +79,7 @@ void BKE_group_unlink(Group *group) Scene *sce; SceneRenderLayer *srl; ParticleSystem *psys; + CacheLibrary *cachelib; for (ma = bmain->mat.first; ma; ma = ma->id.next) { if (ma->group == group) @@ -128,6 +130,13 @@ void BKE_group_unlink(Group *group) } } + for (cachelib = bmain->cache_library.first; cachelib; cachelib = cachelib->id.next) { + if (cachelib->group == group) { + cachelib->group = NULL; + BKE_cache_library_group_update(G.main, cachelib); + } + } + /* group stays in library, but no members */ BKE_group_free(group); group->id.us = 0; |