diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-07 20:55:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-07 20:55:58 +0300 |
commit | 4a23c3f9e1aaaefcb7b5586b908c51d2922d71fb (patch) | |
tree | 1a686be1348ef5bb334e250bcb49b9ca503c8f87 /source/blender/editors/physics | |
parent | f8f7f5755768fa745b5dc759974ff38c45261a9c (diff) |
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.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 12 |
1 files changed, 9 insertions, 3 deletions
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); } |