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>2016-07-19 17:27:40 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-07-19 17:27:40 +0300
commitb9e4e69a4d38372e62b52fa826274673b7dfaacf (patch)
tree2ca9848831f94326e6f651d2e84b012d990013fb /source/blender/blenkernel/intern/lamp.c
parenteeedcf38929b6c0897b91df26e2ba66e1e74d626 (diff)
Fix (IRC reported by Sergey) assert regarding icon_id of newly copied datablocks.
BKE_previewimg_copy() would simply copy PreviewImage's icon_id, without bothering about ID one. When we duplicate an ID, we want to reset its icon_id to zero (and regenerate it on-demand), not keep same icon_id as original, so added new BKE_previewimg_id_copy helper to handle that.
Diffstat (limited to 'source/blender/blenkernel/intern/lamp.c')
-rw-r--r--source/blender/blenkernel/intern/lamp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index c224b5ca0a7..81bcdbde1dc 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -135,8 +135,8 @@ Lamp *BKE_lamp_copy(Main *bmain, Lamp *la)
if (la->nodetree)
lan->nodetree = ntreeCopyTree(bmain, la->nodetree);
-
- lan->preview = BKE_previewimg_copy(la->preview);
+
+ BKE_previewimg_id_copy(&lan->id, &la->id);
if (ID_IS_LINKED_DATABLOCK(la)) {
BKE_id_expand_local(&lan->id);