diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-11 22:27:15 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-11 22:30:02 +0300 |
commit | 7212ebd09f9720883581221be923ae5e97ff5d76 (patch) | |
tree | 546606626647d473ae9d4a037ce8e24e17943e08 /source/blender/blenkernel/intern/particle.c | |
parent | 3b8e0606e1cfa484971d09c5060a78dbadbe1569 (diff) |
Remove usercount handling from BKE_id_expand_local.
Idea looked good, but we have too much custom situations here (some half-fake-sub-ID
being copied with their 'owner', animdata, etc.), let's let datablock copy functions
handle that themselves.
Also allows to safely call BKE_id_expand_local from all copy functions now (only when
copying linked data).
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index f50f8cfb4cb..934c5b9ff06 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3329,14 +3329,14 @@ ParticleSettings *BKE_particlesettings_copy(Main *bmain, ParticleSettings *part) if (part->mtex[a]) { partn->mtex[a] = MEM_mallocN(sizeof(MTex), "psys_copy_tex"); memcpy(partn->mtex[a], part->mtex[a], sizeof(MTex)); + id_us_plus((ID *)partn->mtex[a]->tex); } } BLI_duplicatelist(&partn->dupliweights, &part->dupliweights); - BKE_id_expand_local(&partn->id, true); - if (ID_IS_LINKED_DATABLOCK(part)) { + BKE_id_expand_local(&partn->id); BKE_id_lib_local_paths(bmain, part->id.lib, &partn->id); } @@ -3361,7 +3361,7 @@ void BKE_particlesettings_make_local(Main *bmain, ParticleSettings *part) if (is_local) { if (!is_lib) { id_clear_lib_data(bmain, &part->id); - BKE_id_expand_local(&part->id, false); + BKE_id_expand_local(&part->id); } else { ParticleSettings *part_new = BKE_particlesettings_copy(bmain, part); |