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/texture.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/texture.c')
-rw-r--r--source/blender/blenkernel/intern/texture.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 460417cc2c0..ecc169077cd 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -863,7 +863,6 @@ Tex *BKE_texture_copy(Main *bmain, Tex *tex)
if (texn->pd) texn->pd = BKE_texture_pointdensity_copy(texn->pd);
if (texn->vd) texn->vd = MEM_dupallocN(texn->vd);
if (texn->ot) texn->ot = BKE_texture_ocean_copy(texn->ot);
- if (tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
if (tex->nodetree) {
if (tex->nodetree->execdata) {
@@ -871,8 +870,8 @@ Tex *BKE_texture_copy(Main *bmain, Tex *tex)
}
texn->nodetree = ntreeCopyTree(bmain, tex->nodetree);
}
-
- texn->preview = BKE_previewimg_copy(tex->preview);
+
+ BKE_previewimg_id_copy(&texn->id, &tex->id);
if (ID_IS_LINKED_DATABLOCK(tex)) {
BKE_id_expand_local(&texn->id);