diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-10-19 14:17:19 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-10-19 14:17:19 +0400 |
commit | bb922659955b851a1ed5190961cd5fc51c104444 (patch) | |
tree | 051ca59d7aee359549ab21db3c1193125506b9b9 /source/blender/editors/object/object_modifier.c | |
parent | f979bca91132f1b5cff04ca57658f0ef8b4ce06d (diff) |
Fix for [#24319] Removing a cloth or softbody simulation in paticle mode problem
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index c273b375a06..3d36ed9f45e 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -196,6 +196,11 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob CustomData_free_layer_active(&me->fdata, CD_MDISPS, me->totface); } + if(ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) && + ob->particlesystem.first == NULL) { + ob->mode &= ~OB_MODE_PARTICLE_EDIT; + } + BLI_remlink(&ob->modifiers, md); modifier_free(md); @@ -658,11 +663,18 @@ static int modifier_remove_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *ob = ED_object_active_context(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); + int mode_orig = ob->mode; if(!ob || !md || !ED_object_modifier_remove(op->reports, bmain, scene, ob, md)) return OPERATOR_CANCELLED; WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + /* if cloth/softbody was removed, particle mode could be cleared */ + if(mode_orig & OB_MODE_PARTICLE_EDIT) + if((ob->mode & OB_MODE_PARTICLE_EDIT)==0) + if(scene->basact && scene->basact->object==ob) + WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL); return OPERATOR_FINISHED; } |