From 820517ba9155b50077f6f8bc2892e7be80f68368 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 2 Feb 2010 18:54:23 +0000 Subject: [PATCH] Fix semi-exit of particle edit mode after adding/removing hairs, when child particles were enabled, should only free edit in case the parent particle amount changes. --- source/blender/blenkernel/intern/particle_system.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 8dca00e2e85..65209005f27 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -172,12 +172,6 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart) PARTICLE_P; int totpart, totsaved = 0; - if(psys->edit && psys->free_edit) { - psys->free_edit(psys->edit); - psys->edit = NULL; - psys->free_edit = NULL; - } - if(new_totpart<0) { if(part->distr==PART_DISTR_GRID && part->from != PART_FROM_VERT) { totpart= part->grid_res; @@ -190,6 +184,12 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart) totpart=new_totpart; if(totpart && totpart != psys->totpart) { + if(psys->edit && psys->free_edit) { + psys->free_edit(psys->edit); + psys->edit = NULL; + psys->free_edit = NULL; + } + newpars= MEM_callocN(totpart*sizeof(ParticleData), "particles"); if(psys->part->phystype == PART_PHYS_BOIDS) newboids= MEM_callocN(totpart*sizeof(BoidParticle), "boid particles");