From 741a53050f87886b83b092c49dd70697e3315aec Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Wed, 8 Sep 2010 08:36:12 +0000 Subject: Hair disconnect/connect wasn't working properly. --- source/blender/editors/physics/particle_object.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/physics/particle_object.c') diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index ba5d1ee5250..e364a881601 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -595,6 +595,7 @@ static int disconnect_hair_exec(bContext *C, wmOperator *op) disconnect_hair(scene, ob, psys); } + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); return OPERATOR_FINISHED; @@ -638,7 +639,8 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) point= edit ? edit->points : NULL; if(psmd->dm->deformedOnly) - dm= psmd->dm; + /* we don't want to mess up psmd->dm when converting to global coordinates below */ + dm= CDDM_copy(psmd->dm); else dm= mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); @@ -703,8 +705,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) } free_bvhtree_from_mesh(&bvhtree); - if(!psmd->dm->deformedOnly) - dm->release(dm); + dm->release(dm); psys_free_path_cache(psys, psys->edit); @@ -734,6 +735,7 @@ static int connect_hair_exec(bContext *C, wmOperator *op) connect_hair(scene, ob, psys); } + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); return OPERATOR_FINISHED; -- cgit v1.2.3