[Bf-blender-cvs] [31437b0d4de] master: Fix three obvious mistakes in brush/mask/cachefile ID copying.
Bastien Montagne
noreply at git.blender.org
Wed Jun 14 22:39:08 CEST 2017
Commit: 31437b0d4de01dbd8986cb97a019079e473b397f
Author: Bastien Montagne
Date: Wed Jun 14 22:33:04 2017 +0200
Branches: master
https://developer.blender.org/rB31437b0d4de01dbd8986cb97a019079e473b397f
Fix three obvious mistakes in brush/mask/cachefile ID copying.
They were modifying some source ID prop, instead of copied version of
it... Found while making all source of ID copying const. ;)
===================================================================
M source/blender/blenkernel/intern/brush.c
M source/blender/blenkernel/intern/cachefile.c
M source/blender/blenkernel/intern/mask.c
===================================================================
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 57b707a31d3..ea22ea3a4c4 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -195,7 +195,7 @@ Brush *BKE_brush_copy(Main *bmain, Brush *brush)
brushn->curve = curvemapping_copy(brush->curve);
/* enable fake user by default */
- id_fake_user_set(&brush->id);
+ id_fake_user_set(&brushn->id);
BKE_id_copy_ensure_local(bmain, &brush->id, &brushn->id);
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index 67c66d4e40b..4ee90d4e420 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -105,7 +105,7 @@ CacheFile *BKE_cachefile_copy(Main *bmain, CacheFile *cache_file)
CacheFile *new_cache_file = BKE_libblock_copy(bmain, &cache_file->id);
new_cache_file->handle = NULL;
- BLI_listbase_clear(&cache_file->object_paths);
+ BLI_listbase_clear(&new_cache_file->object_paths);
BKE_id_copy_ensure_local(bmain, &cache_file->id, &new_cache_file->id);
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index 6f23b82c6df..1405c58cf99 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -851,7 +851,7 @@ Mask *BKE_mask_copy(Main *bmain, Mask *mask)
BKE_mask_layer_copy_list(&mask_new->masklayers, &mask->masklayers);
/* enable fake user by default */
- id_fake_user_set(&mask->id);
+ id_fake_user_set(&mask_new->id);
BKE_id_copy_ensure_local(bmain, &mask->id, &mask_new->id);
More information about the Bf-blender-cvs
mailing list