Fix three obvious mistakes in brush/mask/cachefile ID copying.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 14 Jun 2017 20:33:04 +0000 (22:33 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 14 Jun 2017 20:38:11 +0000 (22:38 +0200)
They were modifying some source ID prop, instead of copied version of
it... Found while making all source of ID copying const. ;)

source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/cachefile.c
source/blender/blenkernel/intern/mask.c

index 57b707a31d3e1d8bfd4fd467c8aaa38f4f8eba65..ea22ea3a4c4eaf4edbfaa068035cc79d3f548c77 100644 (file)
@@ -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);
 
index 67c66d4e40bdc2567d5292525de1b0bf6160da12..4ee90d4e420971698f39fb92db23c3d751cfb98e 100644 (file)
@@ -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);
 
index 6f23b82c6df69e281471e0e204b3dfada9518551..1405c58cf99f166782619ddd78928c4cefbd3e67 100644 (file)
@@ -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);