diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-09-08 12:36:12 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-09-08 12:36:12 +0400 |
commit | 741a53050f87886b83b092c49dd70697e3315aec (patch) | |
tree | 15d6d1c0b1ec20d60951c6faefc48d6abb7aca60 /source | |
parent | 06b1c933b358a986e2e2b2d720cc7afee63ed53b (diff) |
Hair disconnect/connect wasn't working properly.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; |