diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_effect.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index a9271335be6..dfcb482ec06 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -110,6 +110,7 @@ typedef struct EffectorRelation { struct PartDeflect *BKE_partdeflect_new(int type); +struct PartDeflect *BKE_partdeflect_copy(const struct PartDeflect *pd_src); void BKE_partdeflect_free(struct PartDeflect *pd); struct ListBase *BKE_effector_relations_create( diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 48b427d5837..d1ad7f10206 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -131,6 +131,18 @@ PartDeflect *BKE_partdeflect_new(int type) /************************ PARTICLES ***************************/ +PartDeflect *BKE_partdeflect_copy(const struct PartDeflect *pd_src) +{ + if (pd_src == NULL) { + return NULL; + } + PartDeflect *pd_dst = MEM_dupallocN(pd_src); + if (pd_dst->rng != NULL) { + pd_dst->rng = BLI_rng_copy(pd_dst->rng); + } + return pd_dst; +} + void BKE_partdeflect_free(PartDeflect *pd) { if (!pd) { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index d7210f28565..5d29c8c5941 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3297,8 +3297,8 @@ void BKE_particlesettings_twist_curve_init(ParticleSettings *part) void BKE_particlesettings_copy_data( Main *UNUSED(bmain), ParticleSettings *part_dst, const ParticleSettings *part_src, const int UNUSED(flag)) { - part_dst->pd = MEM_dupallocN(part_src->pd); - part_dst->pd2 = MEM_dupallocN(part_src->pd2); + part_dst->pd = BKE_partdeflect_copy(part_src->pd); + part_dst->pd2 = BKE_partdeflect_copy(part_src->pd2); part_dst->effector_weights = MEM_dupallocN(part_src->effector_weights); part_dst->fluid = MEM_dupallocN(part_src->fluid); |