From 4a23c3f9e1aaaefcb7b5586b908c51d2922d71fb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 7 Dec 2009 17:55:58 +0000 Subject: Particles: child editing bugfixes * Make partial update work again for faster editing. * Draw parents over children again, nicer for editing. * Fix crash with remove tools & showing child particles. * Fix children not disappearing always when setting to None. * Fix wrong normal for last point in child path. * Fix a python error in the hair dynamics panel. --- source/blender/editors/physics/particle_edit.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/physics') diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 68e673c31b1..349db7746a1 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -1174,8 +1174,11 @@ static void update_velocities(Object *ob, PTCacheEdit *edit) } } } + void PE_update_object(Scene *scene, Object *ob, int useflag) { + /* use this to do partial particle updates, not usable when adding or + removing, then a full redo is necessary and calling this may crash */ ParticleEditSettings *pset= PE_settings(scene); PTCacheEdit *edit = PE_get_current(scene, ob); POINT_P; @@ -2064,6 +2067,12 @@ static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psy edit->mirror_cache= NULL; } + if(psys->child) { + MEM_freeN(psys->child); + psys->child= NULL; + psys->totchild=0; + } + edit->totpoint= psys->totpart= new_totpart; } @@ -2330,7 +2339,6 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved); - PE_update_object(scene, ob, 0); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob); @@ -2507,7 +2515,6 @@ static int delete_exec(bContext *C, wmOperator *op) recalc_lengths(data.edit); } - PE_update_object(data.scene, data.ob, 0); DAG_id_flush_update(&data.ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob); @@ -3733,7 +3740,6 @@ void PE_undo_step(Scene *scene, int step) } } - PE_update_object(scene, OBACT, 0); DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA); } -- cgit v1.2.3