diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-19 17:27:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-19 17:27:40 +0300 |
commit | b9e4e69a4d38372e62b52fa826274673b7dfaacf (patch) | |
tree | 2ca9848831f94326e6f651d2e84b012d990013fb /source/blender/blenkernel/intern/material.c | |
parent | eeedcf38929b6c0897b91df26e2ba66e1e74d626 (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/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 2ae369fdd1b..75fa42f1b61 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -243,7 +243,7 @@ Material *BKE_material_copy(Main *bmain, Material *ma) man->nodetree = ntreeCopyTree(bmain, ma->nodetree); } - man->preview = BKE_previewimg_copy(ma->preview); + BKE_previewimg_id_copy(&man->id, &ma->id); BLI_listbase_clear(&man->gpumaterial); |