diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_particle.h | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index e5b547d2557..78a6e47ec48 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -368,7 +368,10 @@ struct ModifierData *object_copy_particle_system(struct Main *bmain, struct Scene *scene, struct Object *ob, const struct ParticleSystem *psys_orig); -void object_remove_particle_system(struct Main *bmain, struct Scene *scene, struct Object *ob); +void object_remove_particle_system(struct Main *bmain, + struct Scene *scene, + struct Object *ob, + struct ParticleSystem *psys); struct ParticleSettings *BKE_particlesettings_add(struct Main *bmain, const char *name); void psys_reset(struct ParticleSystem *psys, int mode); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 29849c69b6f..50b0fb1c9f5 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3967,16 +3967,18 @@ ModifierData *object_copy_particle_system(Main *bmain, return object_add_or_copy_particle_system(bmain, scene, ob, NULL, psys_orig); } -void object_remove_particle_system(Main *bmain, Scene *UNUSED(scene), Object *ob) +void object_remove_particle_system(Main *bmain, + Scene *UNUSED(scene), + Object *ob, + ParticleSystem *psys) { - ParticleSystem *psys = psys_get_current(ob); - ParticleSystemModifierData *psmd; - ModifierData *md; - - if (!psys) { + if (!ob || !psys) { return; } + ParticleSystemModifierData *psmd; + ModifierData *md; + /* Clear particle system in fluid modifier. */ if ((md = BKE_modifiers_findby_type(ob, eModifierType_Fluid))) { FluidModifierData *fmd = (FluidModifierData *)md; |