diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-09-02 12:06:53 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-09-02 12:06:53 +0400 |
commit | 5db18d474fa2c8b7176806368e5bc0aa68fef325 (patch) | |
tree | d914241547c9c076e966024cb59834d013b4ce42 /source/blender/editors | |
parent | 18954a711fc920da3933e71d7705f07337fd13eb (diff) |
"Fix" for [#23621] lattice modifier on particle hair when applied doesn't apply it to the hair
* Although not strictly a bug it is the expected behavior and won't mess anything else up.
* Note: the lattice is applied to the actual hair keys instead of the calculated strands so the applied result will differ a bit from the original.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 15 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 286e953a69a..5cc6cb9107d 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -453,6 +453,21 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob, BKE_report(reports, RPT_ERROR, "Cannot apply modifier for this object type"); return 0; } + + /* lattice modifier can be applied to particle system too */ + if(ob->particlesystem.first) { + + ParticleSystem *psys = ob->particlesystem.first; + + for(; psys; psys=psys->next) { + + if(psys->part->type != PART_HAIR) + continue; + + psys_apply_hair_lattice(scene, ob, psys); + } + } + return 1; } diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d491b1a9731..87b20ab1c41 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4151,6 +4151,13 @@ static int clear_edited_exec(bContext *C, wmOperator *op) DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } + else { /* some operation might have protected hair from editing so let's clear the flag */ + psys->recalc |= PSYS_RECALC_RESET; + psys->flag &= ~PSYS_GLOBAL_HAIR; + psys->flag &= ~PSYS_EDITED; + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + } return OPERATOR_FINISHED; } |