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>2015-08-10 16:41:28 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-08-10 16:41:28 +0300
commit0c82ba4213577c1b02b2060888f8c43c265c1637 (patch)
tree870d6cdf52b97cd199c8ec8000d7cbbb029465bb /source/blender/blenkernel/intern/group.c
parentd70ffd375fdf444f50a693f74ca79fe248337cda (diff)
Data previews: add preview to Object, Group and Scene.
This commit does not add anything yet to users, it’s purely internal one. Useful commit is next. ;)
Diffstat (limited to 'source/blender/blenkernel/intern/group.c')
-rw-r--r--source/blender/blenkernel/intern/group.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index ae3ab833a87..ae99ff1bbf3 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -49,6 +49,7 @@
#include "BKE_depsgraph.h"
#include "BKE_global.h"
#include "BKE_group.h"
+#include "BKE_icons.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_object.h"
@@ -64,7 +65,9 @@ void BKE_group_free(Group *group)
{
/* don't free group itself */
GroupObject *go;
-
+
+ BKE_previewimg_free(&group->preview);
+
while ((go = BLI_pophead(&group->gobject))) {
free_group_object(go);
}
@@ -139,6 +142,9 @@ Group *BKE_group_add(Main *bmain, const char *name)
group = BKE_libblock_alloc(bmain, ID_GR, name);
group->layer = (1 << 20) - 1;
+
+ group->preview = NULL;
+
return group;
}
@@ -149,6 +155,8 @@ Group *BKE_group_copy(Group *group)
groupn = BKE_libblock_copy(&group->id);
BLI_duplicatelist(&groupn->gobject, &group->gobject);
+ /* Do not copy group's preview (same behavior as for objects). */
+
if (group->id.lib) {
BKE_id_lib_local_paths(G.main, group->id.lib, &groupn->id);
}